aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrame.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-09-10 09:53:21 (GMT)
committerfluxgen <fluxgen>2003-09-10 09:53:21 (GMT)
commit37c8e349fbec21889abcb1a2f04452982cd35cbc (patch)
treeb16d459881f262bc55aad1c74c561ec0c330af53 /src/FbWinFrame.cc
parent7df61abcbd9c0e533ad34d55d6e42e7a22b0b024 (diff)
downloadfluxbox_pavel-37c8e349fbec21889abcb1a2f04452982cd35cbc.zip
fluxbox_pavel-37c8e349fbec21889abcb1a2f04452982cd35cbc.tar.bz2
fixed timer to update transparent while moving
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r--src/FbWinFrame.cc63
1 files changed, 39 insertions, 24 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 37d0c0b..c546d54 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.cc,v 1.43 2003/08/25 16:17:18 fluxgen Exp $ 22// $Id: FbWinFrame.cc,v 1.44 2003/09/10 09:53:21 fluxgen Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -28,6 +28,7 @@
28#include "FbTk/TextButton.hh" 28#include "FbTk/TextButton.hh"
29#include "FbTk/App.hh" 29#include "FbTk/App.hh"
30#include "FbTk/Compose.hh" 30#include "FbTk/Compose.hh"
31#include "FbTk/SimpleCommand.hh"
31 32
32#include "FbWinFrameTheme.hh" 33#include "FbWinFrameTheme.hh"
33#ifdef SHAPE 34#ifdef SHAPE
@@ -169,26 +170,12 @@ void FbWinFrame::move(int x, int y) {
169 if (theme().alpha() == 255) 170 if (theme().alpha() == 255)
170 return; 171 return;
171 172
172 redrawTitlebar(); 173 // restart update timer
174 m_update_timer.start();
173 175
174 ButtonList::iterator btn_it = m_buttons_left.begin(); 176 /*
175 ButtonList::iterator btn_it_end = m_buttons_left.begin(); 177
176 for (; btn_it != btn_it_end; ++btn_it) { 178 */
177 (*btn_it)->clear();
178 (*btn_it)->updateTransparent();
179 }
180 btn_it = m_buttons_right.begin();
181 btn_it_end = m_buttons_right.end();
182 for (; btn_it != btn_it_end; ++btn_it) {
183 (*btn_it)->clear();
184 (*btn_it)->updateTransparent();
185 }
186 m_grip_left.clear();
187 m_grip_right.clear();
188 m_handle.clear();
189 m_grip_left.updateTransparent();
190 m_grip_right.updateTransparent();
191 m_handle.updateTransparent();
192} 179}
193 180
194void FbWinFrame::resize(unsigned int width, unsigned int height) { 181void FbWinFrame::resize(unsigned int width, unsigned int height) {
@@ -219,7 +206,8 @@ void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) {
219 206
220void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height) { 207void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height) {
221 move(x, y); 208 move(x, y);
222 resize(width, height); 209 if (width != FbWinFrame::width() || height != FbWinFrame::height())
210 resize(width, height);
223} 211}
224 212
225void FbWinFrame::setTitle(const std::string &titletext) { 213void FbWinFrame::setTitle(const std::string &titletext) {
@@ -699,7 +687,8 @@ void FbWinFrame::redrawTitle() {
699 (*btn_it)->clear(); 687 (*btn_it)->clear();
700 (*btn_it)->updateTransparent(); 688 (*btn_it)->updateTransparent();
701 } 689 }
702 690 m_titlebar.clear();
691 m_label.clear();
703} 692}
704 693
705void FbWinFrame::redrawTitlebar() { 694void FbWinFrame::redrawTitlebar() {
@@ -894,6 +883,12 @@ void FbWinFrame::renderButtons() {
894} 883}
895 884
896void FbWinFrame::init() { 885void FbWinFrame::init() {
886 // setup update timer
887 FbTk::RefCount<FbTk::Command> update_transp(new FbTk::SimpleCommand<FbWinFrame>(*this,
888 &FbWinFrame::updateTransparent));
889 m_update_timer.setCommand(update_transp);
890 m_update_timer.setTimeout(10L);
891 m_update_timer.fireOnce(true);
897 892
898 m_disable_shape = false; 893 m_disable_shape = false;
899 894
@@ -979,13 +974,13 @@ void FbWinFrame::getCurrentFocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
979 title_color = m_title_focused_color; 974 title_color = m_title_focused_color;
980 975
981 } else { 976 } else {
982 getUnFocusPixmap(label_pm, title_pm, 977 getUnfocusPixmap(label_pm, title_pm,
983 label_color, title_color); 978 label_color, title_color);
984 } 979 }
985 980
986} 981}
987 982
988void FbWinFrame::getUnFocusPixmap(Pixmap &label_pm, Pixmap &title_pm, 983void FbWinFrame::getUnfocusPixmap(Pixmap &label_pm, Pixmap &title_pm,
989 FbTk::Color &label_color, 984 FbTk::Color &label_color,
990 FbTk::Color &title_color) { 985 FbTk::Color &title_color) {
991 if (m_label_unfocused_pm != 0) { 986 if (m_label_unfocused_pm != 0) {
@@ -1086,4 +1081,24 @@ void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) {
1086 button.clear(); 1081 button.clear();
1087} 1082}
1088 1083
1084void FbWinFrame::updateTransparent() {
1085 redrawTitlebar();
1086
1087 ButtonList::iterator button_it = m_buttons_left.begin();
1088 ButtonList::iterator button_it_end = m_buttons_left.begin();
1089 for (; button_it != button_it_end; ++button_it) {
1090 (*button_it)->clear();
1091 (*button_it)->updateTransparent();
1092 }
1089 1093
1094 button_it = m_buttons_right.begin();
1095 button_it_end = m_buttons_right.end();
1096 for (; button_it != button_it_end; ++button_it) {
1097 (*button_it)->clear();
1098 (*button_it)->updateTransparent();
1099 }
1100
1101 m_grip_left.updateTransparent();
1102 m_grip_right.updateTransparent();
1103 m_handle.updateTransparent();
1104}