1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

VerticalTabs: Corectly recognize tree collapse / expand button

Summary:
In treeview when the tab has no children the collapse / expand button
is not visible but the control logic still thought that is is.
By clicking on place where this button normaly is nothing happens
and user has to click again somewhere else to change the selected tab.

Test Plan:
In treeview mode check the function of collapse / expand button when visible and invisible.

  - Visible: Expand / collapse the tree
  - Not visible: Select tab

Reviewers: #falkon, drosca

Reviewed By: #falkon, drosca

Subscribers: falkon

Tags: #falkon

Differential Revision: https://phabricator.kde.org/D21304
This commit is contained in:
David Rosca 2019-05-20 15:03:21 +02:00
parent bb8a3a799f
commit fb09c266a7
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -358,7 +358,9 @@ void TabTreeView::initView()
TabTreeView::DelegateButton TabTreeView::buttonAt(const QPoint &pos, const QModelIndex &index) const
{
if (m_delegate->expandButtonRect(index).contains(pos)) {
return ExpandButton;
if (model()->rowCount(index) > 0) {
return ExpandButton;
}
} else if (m_delegate->audioButtonRect(index).contains(pos)) {
return AudioButton;
} else if (m_delegate->closeButtonRect(index).contains(pos)) {