mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
VerticalTabs: Make it possible to change height of pinned tab view
Same as TabTreeView, TabListView uses font metrics to calculate height. Themes can change it with "font-size" property.
This commit is contained in:
parent
6c94d40187
commit
43fa19121a
@ -45,7 +45,7 @@ TabListView::TabListView(BrowserWindow *window, QWidget *parent)
|
||||
m_delegate = new TabListDelegate(this);
|
||||
setItemDelegate(m_delegate);
|
||||
|
||||
setFixedHeight(m_delegate->sizeHint(viewOptions(), QModelIndex()).height());
|
||||
updateHeight();
|
||||
}
|
||||
|
||||
bool TabListView::isHidingWhenEmpty() const
|
||||
@ -212,6 +212,11 @@ bool TabListView::viewportEvent(QEvent *event)
|
||||
menu.exec(ce->globalPos());
|
||||
break;
|
||||
}
|
||||
|
||||
case QEvent::StyleChange:
|
||||
updateHeight();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -231,3 +236,7 @@ void TabListView::updateVisibility()
|
||||
setVisible(!m_hideWhenEmpty || model()->rowCount() > 0);
|
||||
}
|
||||
|
||||
void TabListView::updateHeight()
|
||||
{
|
||||
setFixedHeight(m_delegate->sizeHint(viewOptions(), QModelIndex()).height());
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ private:
|
||||
|
||||
DelegateButton buttonAt(const QPoint &pos, const QModelIndex &index) const;
|
||||
void updateVisibility();
|
||||
void updateHeight();
|
||||
|
||||
BrowserWindow *m_window;
|
||||
TabListDelegate *m_delegate;
|
||||
|
Loading…
Reference in New Issue
Block a user