aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-06-29 15:27:28 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-08-26 06:18:48 (GMT)
commitfbb2d16639491fdb0c49e388278fabcc4b0800f3 (patch)
treeb216515b1265dd6164722ebd77ff580738dfc9a0 /src/Toolbar.cc
parent393ba45f91480bb10f510248837c6051b7ff6a03 (diff)
downloadfluxbox-fbb2d16639491fdb0c49e388278fabcc4b0800f3.zip
fluxbox-fbb2d16639491fdb0c49e388278fabcc4b0800f3.tar.bz2
allow to alter button labels via fluxbox-remote
Command is "RelabelButton button.foo $LABEL" This is useful to eg. hint the amount of unread mails in a button to start your MUA, reflect the $USER in a session menu button etc.
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 2920925..3ceb880 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -364,6 +364,12 @@ void Toolbar::screenChanged(BScreen &screen) {
364 reconfigure(); 364 reconfigure();
365} 365}
366 366
367void Toolbar::relayout() {
368 forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing));
369 rearrangeItems();
370 forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
371}
372
367void Toolbar::reconfigure() { 373void Toolbar::reconfigure() {
368 374
369 updateVisibleState(); 375 updateVisibleState();
@@ -404,6 +410,7 @@ void Toolbar::reconfigure() {
404 410
405 // destroy tools and rebuild them 411 // destroy tools and rebuild them
406 deleteItems(); 412 deleteItems();
413 screen().clearToolButtonMap();
407 // they will be readded later 414 // they will be readded later
408 menu().removeAll(); 415 menu().removeAll();
409 setupMenus(true); // rebuild menu but skip rebuild of placement menu 416 setupMenus(true); // rebuild menu but skip rebuild of placement menu
@@ -489,11 +496,7 @@ void Toolbar::reconfigure() {
489 if (theme()->shape() && m_shape.get()) 496 if (theme()->shape() && m_shape.get())
490 m_shape->update(); 497 m_shape->update();
491 498
492 forAll(m_item_list, std::mem_fun(&ToolbarItem::updateSizing)); 499 relayout();
493
494 rearrangeItems();
495
496 forAll(m_item_list, std::bind2nd(std::mem_fun(&ToolbarItem::renderTheme), alpha()));
497 500
498 // we're done with all resizing and stuff now we can request a new 501 // we're done with all resizing and stuff now we can request a new
499 // area to be reserved on screen 502 // area to be reserved on screen