aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index b49dcc9..c6ab79c 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.143 2004/06/10 17:07:58 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.144 2004/06/16 15:38:19 rathnor Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -267,7 +267,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
267 // setup to listen to child events 267 // setup to listen to child events
268 FbTk::EventManager::instance()->addParent(*this, window()); 268 FbTk::EventManager::instance()->addParent(*this, window());
269 // get everything together 269 // get everything together
270 reconfigure(); 270 //reconfigure();
271 // this gets done by the screen later as it loads
271 272
272} 273}
273 274
@@ -423,7 +424,7 @@ void Toolbar::reconfigure() {
423 m_shape.reset(new Shape(frame.window, 0)); 424 m_shape.reset(new Shape(frame.window, 0));
424 } 425 }
425 426
426 // recallibrate size 427 // recalibrate size
427 setPlacement(placement()); 428 setPlacement(placement());
428 429
429 if (isHidden()) { 430 if (isHidden()) {
@@ -552,9 +553,13 @@ void Toolbar::exposeEvent(XExposeEvent &ee) {
552 553
553 554
554void Toolbar::handleEvent(XEvent &event) { 555void Toolbar::handleEvent(XEvent &event) {
556 /* Commented out by Simon 16jun04, since it causes LOTS of rearrangeItems
557 particularly on startup. Can't figure out why this is needed.
555 if (event.type == ConfigureNotify && 558 if (event.type == ConfigureNotify &&
556 event.xconfigure.window != window().window()) 559 event.xconfigure.window != window().window()) {
557 rearrangeItems(); 560 rearrangeItems();
561 }
562 */
558} 563}
559 564
560void Toolbar::update(FbTk::Subject *subj) { 565void Toolbar::update(FbTk::Subject *subj) {
@@ -911,7 +916,7 @@ void Toolbar::rearrangeItems() {
911 } 916 }
912 // now move and resize the items 917 // now move and resize the items
913 // borderWidth added back on straight away 918 // borderWidth added back on straight away
914 int next_x = -2*m_item_list.front()->borderWidth(); // list isn't empty 919 int next_x = -m_item_list.front()->borderWidth(); // list isn't empty
915 last_bw = 0; 920 last_bw = 0;
916 for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) { 921 for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) {
917 if (!(*item_it)->active()) { 922 if (!(*item_it)->active()) {
@@ -934,9 +939,9 @@ void Toolbar::rearrangeItems() {
934 --rounding_error; 939 --rounding_error;
935 } 940 }
936 941
937 (*item_it)->moveResize(next_x, -borderW, extra + relative_width, height()); 942 (*item_it)->moveResize(next_x - borderW, -borderW, extra + relative_width, height());
938 } else { // fixed size 943 } else { // fixed size
939 (*item_it)->moveResize(next_x, -borderW, 944 (*item_it)->moveResize(next_x - borderW, -borderW,
940 (*item_it)->width(), height()); 945 (*item_it)->width(), height());
941 } 946 }
942 next_x += (*item_it)->width(); 947 next_x += (*item_it)->width();