mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
VerticalTabs: Remove custom properties for colors
This commit is contained in:
parent
06621a6f8a
commit
4db34d4645
@ -9,8 +9,5 @@ TabTreeCloseButton
|
||||
|
||||
TabTreeView
|
||||
{
|
||||
color: 0;
|
||||
qproperty-hoverColor: 0;
|
||||
qproperty-selectedColor: 0;
|
||||
qproperty-backgroundIndentation: 0;
|
||||
}
|
||||
|
@ -240,11 +240,6 @@ void TabTreeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
|
||||
QRect titleRect(leftPosition, center - opt.fontMetrics.height() / 2, opt.rect.width(), opt.fontMetrics.height());
|
||||
titleRect.setRight(rightPosition - m_padding);
|
||||
QString title = opt.fontMetrics.elidedText(index.data().toString(), Qt::ElideRight, titleRect.width());
|
||||
if (selected && m_view->selectedColor().isValid()) {
|
||||
textPalette.setColor(cg, colorRole, m_view->selectedColor());
|
||||
} else if (hovered && m_view->hoverColor().isValid()) {
|
||||
textPalette.setColor(cg, colorRole, m_view->hoverColor());
|
||||
}
|
||||
style->drawItemText(painter, titleRect, Qt::AlignLeft, textPalette, true, title, colorRole);
|
||||
}
|
||||
|
||||
|
@ -52,21 +52,6 @@ TabTreeView::TabTreeView(QWidget *parent)
|
||||
viewport()->setAttribute(Qt::WA_Hover);
|
||||
}
|
||||
|
||||
QColor TabTreeView::hoverColor() const
|
||||
{
|
||||
return m_hoverColor;
|
||||
}
|
||||
|
||||
void TabTreeView::setHoverColor(const QColor &color)
|
||||
{
|
||||
m_hoverColor = color;
|
||||
}
|
||||
|
||||
QColor TabTreeView::selectedColor() const
|
||||
{
|
||||
return m_selectedColor;
|
||||
}
|
||||
|
||||
int TabTreeView::backgroundIndentation() const
|
||||
{
|
||||
return m_backgroundIndentation;
|
||||
@ -77,11 +62,6 @@ void TabTreeView::setBackgroundIndentation(int indentation)
|
||||
m_backgroundIndentation = indentation;
|
||||
}
|
||||
|
||||
void TabTreeView::setSelectedColor(const QColor &color)
|
||||
{
|
||||
m_selectedColor = color;
|
||||
}
|
||||
|
||||
bool TabTreeView::areTabsInOrder() const
|
||||
{
|
||||
return m_tabsInOrder;
|
||||
|
@ -24,19 +24,11 @@ class TabTreeDelegate;
|
||||
class TabTreeView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QColor hoverColor READ hoverColor WRITE setHoverColor)
|
||||
Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
|
||||
Q_PROPERTY(int backgroundIndentation READ backgroundIndentation WRITE setBackgroundIndentation)
|
||||
|
||||
public:
|
||||
explicit TabTreeView(QWidget *parent = nullptr);
|
||||
|
||||
QColor hoverColor() const;
|
||||
void setHoverColor(const QColor &color);
|
||||
|
||||
QColor selectedColor() const;
|
||||
void setSelectedColor(const QColor &color);
|
||||
|
||||
int backgroundIndentation() const;
|
||||
void setBackgroundIndentation(int indentation);
|
||||
|
||||
@ -63,9 +55,6 @@ private:
|
||||
|
||||
DelegateButton buttonAt(const QPoint &pos, const QModelIndex &index) const;
|
||||
|
||||
QColor m_hoverColor;
|
||||
QColor m_selectedColor;
|
||||
|
||||
TabTreeDelegate *m_delegate;
|
||||
DelegateButton m_pressedButton = NoButton;
|
||||
QPersistentModelIndex m_pressedIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user