diff options
author | rathnor <rathnor> | 2004-06-20 10:29:51 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-06-20 10:29:51 (GMT) |
commit | abc86f0028402a54ef74c378cf5b6805f01e0347 (patch) | |
tree | 2539f1f974e142a0424473f484c90a1b7b32b393 /src/Toolbar.cc | |
parent | 9b7775751decd095f091d122c1ce057c6a04b64d (diff) | |
download | fluxbox_pavel-abc86f0028402a54ef74c378cf5b6805f01e0347.zip fluxbox_pavel-abc86f0028402a54ef74c378cf5b6805f01e0347.tar.bz2 |
fix systemtray related things
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r-- | src/Toolbar.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index c6ab79c..c72e54c 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.144 2004/06/16 15:38:19 rathnor Exp $ | 25 | // $Id: Toolbar.cc,v 1.145 2004/06/20 10:29:51 rathnor Exp $ |
26 | 26 | ||
27 | #include "Toolbar.hh" | 27 | #include "Toolbar.hh" |
28 | 28 | ||
@@ -405,6 +405,7 @@ void Toolbar::reconfigure() { | |||
405 | if (item == 0) | 405 | if (item == 0) |
406 | continue; | 406 | continue; |
407 | m_item_list.push_back(item); | 407 | m_item_list.push_back(item); |
408 | item->resizeSig().attach(this); | ||
408 | 409 | ||
409 | } | 410 | } |
410 | // show all items | 411 | // show all items |
@@ -564,9 +565,14 @@ void Toolbar::handleEvent(XEvent &event) { | |||
564 | 565 | ||
565 | void Toolbar::update(FbTk::Subject *subj) { | 566 | void Toolbar::update(FbTk::Subject *subj) { |
566 | 567 | ||
567 | // either screen reconfigured or theme was reloaded | 568 | // either screen reconfigured, theme was reloaded |
568 | 569 | // or a tool resized itself | |
569 | reconfigure(); | 570 | |
571 | if (typeid(*subj) == typeid(ToolbarItem::ToolbarItemSubject)) { | ||
572 | rearrangeItems(); | ||
573 | } else { | ||
574 | reconfigure(); | ||
575 | } | ||
570 | } | 576 | } |
571 | 577 | ||
572 | void Toolbar::setPlacement(Toolbar::Placement where) { | 578 | void Toolbar::setPlacement(Toolbar::Placement where) { |
@@ -921,6 +927,8 @@ void Toolbar::rearrangeItems() { | |||
921 | for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) { | 927 | for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) { |
922 | if (!(*item_it)->active()) { | 928 | if (!(*item_it)->active()) { |
923 | (*item_it)->hide(); | 929 | (*item_it)->hide(); |
930 | // make sure it still gets told the toolbar height | ||
931 | (*item_it)->resize(1, height()); // width of 0 changes to 1 anyway | ||
924 | continue; | 932 | continue; |
925 | } | 933 | } |
926 | int borderW = (*item_it)->borderWidth(); | 934 | int borderW = (*item_it)->borderWidth(); |
@@ -931,7 +939,6 @@ void Toolbar::rearrangeItems() { | |||
931 | next_x += last_bw; | 939 | next_x += last_bw; |
932 | last_bw = borderW; | 940 | last_bw = borderW; |
933 | 941 | ||
934 | (*item_it)->show(); | ||
935 | if ((*item_it)->type() == ToolbarItem::RELATIVE) { | 942 | if ((*item_it)->type() == ToolbarItem::RELATIVE) { |
936 | int extra = 0; | 943 | int extra = 0; |
937 | if (rounding_error != 0) { // distribute rounding error over all relatives | 944 | if (rounding_error != 0) { // distribute rounding error over all relatives |
@@ -944,6 +951,7 @@ void Toolbar::rearrangeItems() { | |||
944 | (*item_it)->moveResize(next_x - borderW, -borderW, | 951 | (*item_it)->moveResize(next_x - borderW, -borderW, |
945 | (*item_it)->width(), height()); | 952 | (*item_it)->width(), height()); |
946 | } | 953 | } |
954 | (*item_it)->show(); | ||
947 | next_x += (*item_it)->width(); | 955 | next_x += (*item_it)->width(); |
948 | } | 956 | } |
949 | // unlock | 957 | // unlock |