forked from qt-creator/qt-creator
MiniSplitter: Make it actually themable via SplitterColor
The CE_Splitter drawControl code in ManhattanStyle wasn't used. This patch removes it, changes MiniPliter::onPaint to use the theme color, and adjusts dark.creatortheme's SplitterColor so that actually nothing changes visually. Change-Id: I0b94bd2125fd037c2c21dad195f31d092332db43 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
@@ -92,7 +92,7 @@ ProgressBarColorError=error
|
||||
ProgressBarColorFinished=ff5aaa3c
|
||||
ProgressBarColorNormal=hoverBackground
|
||||
ProgressBarTitleColor=text
|
||||
SplitterColor=ffb0b0b0
|
||||
SplitterColor=ff313131
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
|
||||
@@ -622,13 +622,6 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
return QProxyStyle::drawControl(element, option, painter, widget);
|
||||
|
||||
switch (element) {
|
||||
case CE_Splitter:
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleFlat)
|
||||
painter->fillRect(option->rect, creatorTheme()->color(Theme::SplitterColor));
|
||||
else
|
||||
painter->fillRect(option->rect, StyleHelper::borderColor());
|
||||
break;
|
||||
|
||||
case CE_TabBarTabShape:
|
||||
// Most styles draw a single dark outline. This looks rather ugly when combined with our
|
||||
// single pixel dark separator so we adjust the first tab to compensate for this
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "minisplitter.h"
|
||||
|
||||
#include <utils/stylehelper.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
@@ -76,7 +77,10 @@ void MiniSplitterHandle::resizeEvent(QResizeEvent *event)
|
||||
void MiniSplitterHandle::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.fillRect(event->rect(), Utils::StyleHelper::borderColor(m_lightColored));
|
||||
const QColor color = m_lightColored
|
||||
? Utils::StyleHelper::borderColor(m_lightColored)
|
||||
: Utils::creatorTheme()->color(Utils::Theme::SplitterColor);
|
||||
painter.fillRect(event->rect(), color);
|
||||
}
|
||||
|
||||
QSplitterHandle *MiniSplitter::createHandle()
|
||||
|
||||
Reference in New Issue
Block a user