diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-03-22 15:23:12 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-03-22 15:23:12 +0100 |
commit | 3c2f0096eafbd6a9274ef31f4b515e643b2a472f (patch) | |
tree | ba7aa933a131c3a025d14e6c95c723709f72a998 /src/libs | |
parent | ed224796f1648efc2560bc675f7174b2a6506dbb (diff) | |
parent | 0d73cfb28d723792b2767d6cdb9c90f5c8a5f919 (diff) | |
download | qt-creator-3c2f0096eafbd6a9274ef31f4b515e643b2a472f.tar.gz |
Merge remote-tracking branch 'origin/4.0'
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/timeline/timelinemodel.cpp | 17 | ||||
-rw-r--r-- | src/libs/timeline/timelinemodel.h | 6 | ||||
-rw-r--r-- | src/libs/timeline/timelinemodel_p.h | 4 | ||||
-rw-r--r-- | src/libs/utils/stylehelper.cpp | 22 | ||||
-rw-r--r-- | src/libs/utils/stylehelper.h | 1 | ||||
-rw-r--r-- | src/libs/utils/theme/theme.h | 39 | ||||
-rw-r--r-- | src/libs/utils/utilsicons.h | 2 |
7 files changed, 51 insertions, 40 deletions
diff --git a/src/libs/timeline/timelinemodel.cpp b/src/libs/timeline/timelinemodel.cpp index e5d16ecb24..c28ca78963 100644 --- a/src/libs/timeline/timelinemodel.cpp +++ b/src/libs/timeline/timelinemodel.cpp @@ -151,8 +151,8 @@ int TimelineModel::row(int index) const return expanded() ? expandedRow(index) : collapsedRow(index); } -TimelineModel::TimelineModelPrivate::TimelineModelPrivate(int modelId, const QString &displayName) : - modelId(modelId), displayName(displayName), expanded(false), hidden(false), +TimelineModel::TimelineModelPrivate::TimelineModelPrivate(int modelId) : + modelId(modelId), expanded(false), hidden(false), expandedRowCount(1), collapsedRowCount(1), q_ptr(0) { } @@ -163,8 +163,8 @@ TimelineModel::TimelineModel(TimelineModelPrivate &dd, QObject *parent) : d_ptr->q_ptr = this; } -TimelineModel::TimelineModel(int modelId, const QString &displayName, QObject *parent) : - QObject(parent), d_ptr(new TimelineModelPrivate(modelId, displayName)) +TimelineModel::TimelineModel(int modelId, QObject *parent) : + QObject(parent), d_ptr(new TimelineModelPrivate(modelId)) { d_ptr->q_ptr = this; } @@ -512,6 +512,15 @@ void TimelineModel::setHidden(bool hidden) } } +void TimelineModel::setDisplayName(const QString &displayName) +{ + Q_D(TimelineModel); + if (d->displayName != displayName) { + d->displayName = displayName; + emit displayNameChanged(); + } +} + QString TimelineModel::displayName() const { Q_D(const TimelineModel); diff --git a/src/libs/timeline/timelinemodel.h b/src/libs/timeline/timelinemodel.h index 48d60add48..83ad4012cc 100644 --- a/src/libs/timeline/timelinemodel.h +++ b/src/libs/timeline/timelinemodel.h @@ -37,7 +37,7 @@ class TIMELINE_EXPORT TimelineModel : public QObject { Q_OBJECT Q_PROPERTY(int modelId READ modelId CONSTANT) - Q_PROPERTY(QString displayName READ displayName CONSTANT) + Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged) Q_PROPERTY(bool empty READ isEmpty NOTIFY emptyChanged) Q_PROPERTY(bool hidden READ hidden WRITE setHidden NOTIFY hiddenChanged) Q_PROPERTY(bool expanded READ expanded WRITE setExpanded NOTIFY expandedChanged) @@ -52,7 +52,7 @@ class TIMELINE_EXPORT TimelineModel : public QObject public: class TimelineModelPrivate; - TimelineModel(int modelId, const QString &displayName, QObject *parent = 0); + TimelineModel(int modelId, QObject *parent = 0); ~TimelineModel(); // Methods implemented by the abstract model itself @@ -82,6 +82,7 @@ public: bool hidden() const; void setExpanded(bool expanded); void setHidden(bool hidden); + void setDisplayName(const QString &displayName); QString displayName() const; int expandedRowCount() const; int collapsedRowCount() const; @@ -123,6 +124,7 @@ signals: void collapsedRowCountChanged(); void rowCountChanged(); void labelsChanged(); + void displayNameChanged(); protected: QColor colorBySelectionId(int index) const; diff --git a/src/libs/timeline/timelinemodel_p.h b/src/libs/timeline/timelinemodel_p.h index 20cc11f2e6..0d775e9eda 100644 --- a/src/libs/timeline/timelinemodel_p.h +++ b/src/libs/timeline/timelinemodel_p.h @@ -64,7 +64,7 @@ public: inline qint64 timestamp() const {return end;} }; - TimelineModelPrivate(int modelId, const QString &displayName); + TimelineModelPrivate(int modelId); void init(TimelineModel *q); int firstIndexNoParents(qint64 startTime) const; @@ -131,7 +131,7 @@ public: QVector<int> rowOffsets; const int modelId; - const QString displayName; + QString displayName; bool expanded; bool hidden; diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index 9431cbe18d..8de43c24bb 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -25,6 +25,7 @@ #include "stylehelper.h" +#include "theme/theme.h" #include "hostosinfo.h" #include <QPixmapCache> @@ -108,11 +109,6 @@ QColor StyleHelper::baseColor(bool lightColored) return m_baseColor.lighter(230); } -bool StyleHelper::isBaseColorDefault() -{ - return m_requestedBaseColor == DEFAULT_BASE_COLOR; -} - QColor StyleHelper::highlightColor(bool lightColored) { QColor result = baseColor(lightColored); @@ -152,10 +148,20 @@ void StyleHelper::setBaseColor(const QColor &newcolor) { m_requestedBaseColor = newcolor; + const QColor themeBaseColor = creatorTheme()->color(Theme::PanelStatusBarBackgroundColor); + const QColor defaultBaseColor = QColor(DEFAULT_BASE_COLOR); QColor color; - color.setHsv(newcolor.hue(), - newcolor.saturation() * 0.7, - 64 + newcolor.value() / 3); + + if (defaultBaseColor == newcolor) { + color = themeBaseColor; + } else { + const int valueDelta = (newcolor.value() - defaultBaseColor.value()) / 3; + const int value = qBound(0, themeBaseColor.value() + valueDelta, 255); + + color.setHsv(newcolor.hue(), + newcolor.saturation() * 0.7, + value); + } if (color.isValid() && color != m_baseColor) { m_baseColor = color; diff --git a/src/libs/utils/stylehelper.h b/src/libs/utils/stylehelper.h index 5ac91df433..7e483c43f1 100644 --- a/src/libs/utils/stylehelper.h +++ b/src/libs/utils/stylehelper.h @@ -56,7 +56,6 @@ public: // This is our color table, all colors derive from baseColor static QColor requestedBaseColor() { return m_requestedBaseColor; } static QColor baseColor(bool lightColored = false); - static bool isBaseColorDefault(); static QColor panelTextColor(bool lightColored = false); static QColor highlightColor(bool lightColored = false); static QColor shadowColor(bool lightColored = false); diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h index d5a006dc2c..884b76104f 100644 --- a/src/libs/utils/theme/theme.h +++ b/src/libs/utils/theme/theme.h @@ -103,7 +103,6 @@ public: OutputPaneButtonFlashColor, OutputPaneToggleButtonTextColorChecked, OutputPaneToggleButtonTextColorUnchecked, - PanelButtonToolBackgroundColorHover, PanelStatusBarBackgroundColor, PanelsWidgetSeparatorLineColor, PanelTextColorDark, @@ -113,6 +112,7 @@ public: ProgressBarColorFinished, ProgressBarColorNormal, ProgressBarTitleColor, + ProgressBarBackgroundColor, SplitterColor, TextColorDisabled, TextColorError, @@ -160,6 +160,14 @@ public: OutputPanes_StdErrTextColor, OutputPanes_StdOutTextColor, OutputPanes_WarningMessageTextColor, + OutputPanes_TestPassTextColor, + OutputPanes_TestFailTextColor, + OutputPanes_TestXFailTextColor, + OutputPanes_TestXPassTextColor, + OutputPanes_TestSkipTextColor, + OutputPanes_TestWarnTextColor, + OutputPanes_TestFatalTextColor, + OutputPanes_TestDebugTextColor, /* Debugger Log Window */ @@ -175,27 +183,14 @@ public: /* Welcome Plugin */ - Welcome_TextColorNormal, - Welcome_TextColorHeading, // #535353 // Sessions, Recent Projects - Welcome_BackgroundColorNormal, // #ffffff - Welcome_DividerColor, // #737373 - Welcome_Button_BorderColorNormal, - Welcome_Button_BorderColorPressed, - Welcome_Button_TextColorNormal, - Welcome_Button_TextColorPressed, - Welcome_Link_TextColorNormal, - Welcome_Link_TextColorActive, - Welcome_Link_BackgroundColor, - Welcome_Caption_TextColorNormal, - Welcome_SideBar_BackgroundColor, - - Welcome_ProjectItem_TextColorFilepath, - Welcome_ProjectItem_BackgroundColorHover, - - Welcome_SessionItem_BackgroundColorNormal, - Welcome_SessionItem_BackgroundColorHover, - Welcome_SessionItemExpanded_BackgroundColorNormal, - Welcome_SessionItemExpanded_BackgroundColorHover, + Welcome_TextColor, + Welcome_ForegroundPrimaryColor, + Welcome_ForegroundSecondaryColor, + Welcome_BackgroundColor, + Welcome_ButtonBackgroundColor, + Welcome_DividerColor, + Welcome_LinkColor, + Welcome_HoverColor, /* VcsBase Plugin */ VcsBase_FileStatusUnknown_TextColor, diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 0f2d8a49b8..51da2999c4 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -32,7 +32,7 @@ namespace Utils { namespace Icons { const Utils::Icon EDIT_CLEAR({ - {QLatin1String(":/core/images/editclear.png"), Utils::Theme::BackgroundColorHover}}, Utils::Icon::Tint); + {QLatin1String(":/core/images/editclear.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint); } // namespace Icons } // namespace Utils |