mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
Don't scroll to message log bottom with no messages (GTK client) (#3959)
Fixes: #3956
This commit is contained in:
parent
a2817faab1
commit
02cbfa917a
1 changed files with 7 additions and 6 deletions
|
@ -123,14 +123,15 @@ bool MessageLogWindow::Impl::is_pinned_to_new() const
|
|||
|
||||
void MessageLogWindow::Impl::scroll_to_bottom()
|
||||
{
|
||||
if (sort_ != nullptr)
|
||||
auto const row_count = sort_->children().size();
|
||||
if (row_count == 0)
|
||||
{
|
||||
auto const row_count = sort_->children().size();
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto const iter = sort_->children()[row_count - 1]; iter)
|
||||
{
|
||||
view_->scroll_to_row(sort_->get_path(TR_GTK_TREE_MODEL_CHILD_ITER(iter)), 1);
|
||||
}
|
||||
if (auto const iter = sort_->children()[row_count - 1]; iter)
|
||||
{
|
||||
view_->scroll_to_row(sort_->get_path(TR_GTK_TREE_MODEL_CHILD_ITER(iter)), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue