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
remotes/thinkspoon/wilder
David Rosca 7 years ago
parent bb8a3a799f
commit fb09c266a7
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
  1. 4
      src/plugins/VerticalTabs/tabtreeview.cpp

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

Loading…
Cancel
Save