aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-10 13:57:07 (GMT)
committerfluxgen <fluxgen>2003-05-10 13:57:07 (GMT)
commit4a396013c67a2d5c95009b6b401266fcf4fc1566 (patch)
tree82d8308007d80c77ba327e0e1de4cf4e54eefeb9 /src/Toolbar.cc
parent94deb10b014a0f6bb27bc34a130b5c4df9ee764e (diff)
downloadfluxbox-4a396013c67a2d5c95009b6b401266fcf4fc1566.zip
fluxbox-4a396013c67a2d5c95009b6b401266fcf4fc1566.tar.bz2
minor cleaning
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 541bdea..8027a0b 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.cc,v 1.77 2003/04/28 16:48:23 rathnor Exp $ 25// $Id: Toolbar.cc,v 1.78 2003/05/10 13:57:07 fluxgen Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -246,9 +246,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
246 do_auto_hide(scrn.doToolbarAutoHide()), 246 do_auto_hide(scrn.doToolbarAutoHide()),
247 frame(*this, scrn.getScreenNumber()), 247 frame(*this, scrn.getScreenNumber()),
248 m_screen(scrn), 248 m_screen(scrn),
249 image_ctrl(*scrn.getImageControl()), 249 m_clock_timer(this), // get the clock updating every minute
250 clock_timer(this), // get the clock updating every minute 250 m_hide_timer(&hide_handler),
251 hide_timer(&hide_handler),
252 m_toolbarmenu(menu), 251 m_toolbarmenu(menu),
253 m_placementmenu(*scrn.menuTheme(), 252 m_placementmenu(*scrn.menuTheme(),
254 scrn.getScreenNumber(), *scrn.getImageControl()), 253 scrn.getScreenNumber(), *scrn.getImageControl()),
@@ -279,12 +278,12 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
279 timeval delay; 278 timeval delay;
280 delay.tv_sec = 1; 279 delay.tv_sec = 1;
281 delay.tv_usec = 0; 280 delay.tv_usec = 0;
282 clock_timer.setTimeout(delay); 281 m_clock_timer.setTimeout(delay);
283 clock_timer.start(); 282 m_clock_timer.start();
284 283
285 hide_handler.toolbar = this; 284 hide_handler.toolbar = this;
286 hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); 285 m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay());
287 hide_timer.fireOnce(true); 286 m_hide_timer.fireOnce(true);
288 287
289 frame.grab_x = frame.grab_y = 0; 288 frame.grab_x = frame.grab_y = 0;
290 289
@@ -320,7 +319,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
320 319
321 320
322Toolbar::~Toolbar() { 321Toolbar::~Toolbar() {
323 322 FbTk::ImageControl &image_ctrl = *screen().getImageControl();
324 if (frame.base) image_ctrl.removeImage(frame.base); 323 if (frame.base) image_ctrl.removeImage(frame.base);
325 if (frame.label) image_ctrl.removeImage(frame.label); 324 if (frame.label) image_ctrl.removeImage(frame.label);
326 if (frame.wlabel) image_ctrl.removeImage(frame.wlabel); 325 if (frame.wlabel) image_ctrl.removeImage(frame.wlabel);
@@ -388,7 +387,7 @@ void Toolbar::reconfigure() {
388 387
389 if (do_auto_hide == false && 388 if (do_auto_hide == false &&
390 do_auto_hide != screen().doToolbarAutoHide()) { 389 do_auto_hide != screen().doToolbarAutoHide()) {
391 hide_timer.start(); 390 m_hide_timer.start();
392 } 391 }
393 392
394 do_auto_hide = screen().doToolbarAutoHide(); 393 do_auto_hide = screen().doToolbarAutoHide();
@@ -563,6 +562,8 @@ void Toolbar::reconfigure() {
563 frame.clock.moveResize(next_x + text_x, next_y + text_y, 562 frame.clock.moveResize(next_x + text_x, next_y + text_y,
564 clock_w, clock_h); 563 clock_w, clock_h);
565 564
565 FbTk::ImageControl &image_ctrl = *screen().getImageControl();
566
566 Pixmap tmp = frame.base; 567 Pixmap tmp = frame.base;
567 const FbTk::Texture *texture = &(m_theme.toolbar()); 568 const FbTk::Texture *texture = &(m_theme.toolbar());
568 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { 569 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {
@@ -972,11 +973,11 @@ void Toolbar::enterNotifyEvent(XCrossingEvent &not_used) {
972 return; 973 return;
973 974
974 if (hidden) { 975 if (hidden) {
975 if (! hide_timer.isTiming()) 976 if (! m_hide_timer.isTiming())
976 hide_timer.start(); 977 m_hide_timer.start();
977 } else { 978 } else {
978 if (hide_timer.isTiming()) 979 if (m_hide_timer.isTiming())
979 hide_timer.stop(); 980 m_hide_timer.stop();
980 } 981 }
981} 982}
982 983
@@ -985,10 +986,10 @@ void Toolbar::leaveNotifyEvent(XCrossingEvent &not_used) {
985 return; 986 return;
986 987
987 if (hidden) { 988 if (hidden) {
988 if (hide_timer.isTiming()) 989 if (m_hide_timer.isTiming())
989 hide_timer.stop(); 990 m_hide_timer.stop();
990 } else if (! m_toolbarmenu.isVisible() && ! hide_timer.isTiming()) 991 } else if (! m_toolbarmenu.isVisible() && ! m_hide_timer.isTiming())
991 hide_timer.start(); 992 m_hide_timer.start();
992 993
993} 994}
994 995
@@ -1072,7 +1073,7 @@ void Toolbar::timeout() {
1072 timeval delay; 1073 timeval delay;
1073 delay.tv_sec = 1; 1074 delay.tv_sec = 1;
1074 delay.tv_usec = 0; 1075 delay.tv_usec = 0;
1075 clock_timer.setTimeout(delay); 1076 m_clock_timer.setTimeout(delay);
1076} 1077}
1077 1078
1078 1079
@@ -1209,12 +1210,12 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
1209 1210
1210void Toolbar::HideHandler::timeout() { 1211void Toolbar::HideHandler::timeout() {
1211 if (toolbar->isEditing()) { // don't hide if we're editing workspace label 1212 if (toolbar->isEditing()) { // don't hide if we're editing workspace label
1212 toolbar->hide_timer.fireOnce(false); 1213 toolbar->m_hide_timer.fireOnce(false);
1213 toolbar->hide_timer.start(); // restart timer and try next timeout 1214 toolbar->m_hide_timer.start(); // restart timer and try next timeout
1214 return; 1215 return;
1215 } 1216 }
1216 1217
1217 toolbar->hide_timer.fireOnce(true); 1218 toolbar->m_hide_timer.fireOnce(true);
1218 1219
1219 toolbar->hidden = ! toolbar->hidden; 1220 toolbar->hidden = ! toolbar->hidden;
1220 if (toolbar->hidden) { 1221 if (toolbar->hidden) {