Fixed scroll layout loop bug.
This commit is contained in:
parent
4907b19cce
commit
9bad04751f
3 changed files with 11 additions and 6 deletions
|
|
@ -58,7 +58,7 @@ TimelineWidget::TimelineWidget() :
|
||||||
this, &TimelineWidget::on_scroll) );
|
this, &TimelineWidget::on_scroll) );
|
||||||
body->signal_motion_notify_event().connect( sigc::mem_fun(
|
body->signal_motion_notify_event().connect( sigc::mem_fun(
|
||||||
this, &TimelineWidget::on_motion_in_body_notify_event) );
|
this, &TimelineWidget::on_motion_in_body_notify_event) );
|
||||||
|
|
||||||
set_time_scale(GAVL_TIME_SCALE / 200);
|
set_time_scale(GAVL_TIME_SCALE / 200);
|
||||||
|
|
||||||
attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND);
|
attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND);
|
||||||
|
|
@ -212,10 +212,14 @@ TimelineWidget::update_scroll()
|
||||||
verticalAdjustment.set_upper(y_scroll_length);
|
verticalAdjustment.set_upper(y_scroll_length);
|
||||||
|
|
||||||
// Hide the scrollbar if no scrolling is possible
|
// 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();
|
verticalScroll.hide();
|
||||||
else if(y_scroll_length != 0 && !verticalScroll.is_visible())
|
else if(y_scroll_length > 0 && !verticalScroll.is_visible())
|
||||||
verticalScroll.show();
|
verticalScroll.show();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ namespace widgets {
|
||||||
namespace timeline {
|
namespace timeline {
|
||||||
|
|
||||||
Track::Track() :
|
Track::Track() :
|
||||||
headerWidget("HeaderTest")
|
label("XHeaderTest")
|
||||||
{
|
{
|
||||||
|
headerWidget.pack_start(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::Widget&
|
Gtk::Widget&
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,8 @@ class Track
|
||||||
void draw_track(Cairo::RefPtr<Cairo::Context> cairo);
|
void draw_track(Cairo::RefPtr<Cairo::Context> cairo);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Gtk::Label headerWidget;
|
Gtk::VBox headerWidget;
|
||||||
|
Gtk::Label label;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue