Fixed scroll layout loop bug.

This commit is contained in:
Joel Holdsworth 2008-07-23 23:23:48 +01:00
parent 4907b19cce
commit 9bad04751f
3 changed files with 11 additions and 6 deletions

View file

@ -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

View file

@ -28,9 +28,9 @@ namespace widgets {
namespace timeline {
Track::Track() :
headerWidget("HeaderTest")
label("XHeaderTest")
{
headerWidget.pack_start(label);
}
Gtk::Widget&

View file

@ -47,7 +47,8 @@ class Track
void draw_track(Cairo::RefPtr<Cairo::Context> cairo);
protected:
Gtk::Label headerWidget;
Gtk::VBox headerWidget;
Gtk::Label label;
};