From 4db34d464505ed64b47fc0e4f95f5613bcfa8339 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 3 Feb 2018 19:39:35 +0100 Subject: [PATCH] VerticalTabs: Remove custom properties for colors --- .../VerticalTabs/data/themes/default.css | 3 --- src/plugins/VerticalTabs/tabtreedelegate.cpp | 5 ----- src/plugins/VerticalTabs/tabtreeview.cpp | 20 ------------------- src/plugins/VerticalTabs/tabtreeview.h | 11 ---------- 4 files changed, 39 deletions(-) diff --git a/src/plugins/VerticalTabs/data/themes/default.css b/src/plugins/VerticalTabs/data/themes/default.css index aafa233e1..5080ea0df 100644 --- a/src/plugins/VerticalTabs/data/themes/default.css +++ b/src/plugins/VerticalTabs/data/themes/default.css @@ -9,8 +9,5 @@ TabTreeCloseButton TabTreeView { - color: 0; - qproperty-hoverColor: 0; - qproperty-selectedColor: 0; qproperty-backgroundIndentation: 0; } diff --git a/src/plugins/VerticalTabs/tabtreedelegate.cpp b/src/plugins/VerticalTabs/tabtreedelegate.cpp index 83be30d6c..6242193ec 100644 --- a/src/plugins/VerticalTabs/tabtreedelegate.cpp +++ b/src/plugins/VerticalTabs/tabtreedelegate.cpp @@ -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); } diff --git a/src/plugins/VerticalTabs/tabtreeview.cpp b/src/plugins/VerticalTabs/tabtreeview.cpp index 358450daf..073599ab1 100644 --- a/src/plugins/VerticalTabs/tabtreeview.cpp +++ b/src/plugins/VerticalTabs/tabtreeview.cpp @@ -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; diff --git a/src/plugins/VerticalTabs/tabtreeview.h b/src/plugins/VerticalTabs/tabtreeview.h index 81c3ec984..a8e56aede 100644 --- a/src/plugins/VerticalTabs/tabtreeview.h +++ b/src/plugins/VerticalTabs/tabtreeview.h @@ -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;