mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibGUI: Automatically scroll to a new column on adding it in ColumnsView
This commit is contained in:
parent
35e3df7f13
commit
70885a3dee
3 changed files with 10 additions and 0 deletions
|
@ -303,6 +303,11 @@ void AbstractScrollableWidget::scroll_to_bottom()
|
||||||
scroll_into_view({ 0, content_height(), 0, 0 }, Orientation::Vertical);
|
scroll_into_view({ 0, content_height(), 0, 0 }, Orientation::Vertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AbstractScrollableWidget::scroll_to_right()
|
||||||
|
{
|
||||||
|
scroll_into_view({ content_width(), 0, 0, 0 }, Orientation::Horizontal);
|
||||||
|
}
|
||||||
|
|
||||||
void AbstractScrollableWidget::set_automatic_scrolling_timer_active(bool active)
|
void AbstractScrollableWidget::set_automatic_scrolling_timer_active(bool active)
|
||||||
{
|
{
|
||||||
if (active == m_active_scrolling_enabled)
|
if (active == m_active_scrolling_enabled)
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
|
|
||||||
void scroll_to_top();
|
void scroll_to_top();
|
||||||
void scroll_to_bottom();
|
void scroll_to_bottom();
|
||||||
|
void scroll_to_right();
|
||||||
void update_scrollbar_ranges();
|
void update_scrollbar_ranges();
|
||||||
|
|
||||||
void set_automatic_scrolling_timer_active(bool);
|
void set_automatic_scrolling_timer_active(bool);
|
||||||
|
|
|
@ -205,6 +205,10 @@ void ColumnsView::push_column(ModelIndex const& parent_index)
|
||||||
dbgln("Adding a new column");
|
dbgln("Adding a new column");
|
||||||
m_columns.append({ parent_index, 0 });
|
m_columns.append({ parent_index, 0 });
|
||||||
update_column_sizes();
|
update_column_sizes();
|
||||||
|
|
||||||
|
// FIXME: Find a way not to jump the view so much when changing folders within the same directory.
|
||||||
|
scroll_to_right();
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue