From 9bad04751f48547ba210de851fed7dcc802b1a2a Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 23 Jul 2008 23:23:48 +0100 Subject: [PATCH] Fixed scroll layout loop bug. --- src/gui/widgets/timeline-widget.cpp | 10 +++++++--- src/gui/widgets/timeline/track.cpp | 4 ++-- src/gui/widgets/timeline/track.hpp | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index e1956ad93..3146824d7 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -58,7 +58,7 @@ TimelineWidget::TimelineWidget() : this, &TimelineWidget::on_scroll) ); body->signal_motion_notify_event().connect( sigc::mem_fun( this, &TimelineWidget::on_motion_in_body_notify_event) ); - + set_time_scale(GAVL_TIME_SCALE / 200); attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); @@ -212,10 +212,14 @@ TimelineWidget::update_scroll() verticalAdjustment.set_upper(y_scroll_length); // Hide the scrollbar if no scrolling is possible - if(y_scroll_length == 0 && verticalScroll.is_visible()) +#if 0 + // Having this code included seems to cause a layout loop as the + // window is shrunk + if(y_scroll_length <= 0 && verticalScroll.is_visible()) verticalScroll.hide(); - else if(y_scroll_length != 0 && !verticalScroll.is_visible()) + else if(y_scroll_length > 0 && !verticalScroll.is_visible()) verticalScroll.show(); +#endif } int diff --git a/src/gui/widgets/timeline/track.cpp b/src/gui/widgets/timeline/track.cpp index a19541476..59d3c7d21 100644 --- a/src/gui/widgets/timeline/track.cpp +++ b/src/gui/widgets/timeline/track.cpp @@ -28,9 +28,9 @@ namespace widgets { namespace timeline { Track::Track() : - headerWidget("HeaderTest") + label("XHeaderTest") { - + headerWidget.pack_start(label); } Gtk::Widget& diff --git a/src/gui/widgets/timeline/track.hpp b/src/gui/widgets/timeline/track.hpp index 168aab390..3abbf036d 100644 --- a/src/gui/widgets/timeline/track.hpp +++ b/src/gui/widgets/timeline/track.hpp @@ -47,7 +47,8 @@ class Track void draw_track(Cairo::RefPtr cairo); protected: - Gtk::Label headerWidget; + Gtk::VBox headerWidget; + Gtk::Label label; };