forked from qt-creator/qt-creator
Utils: Add toolbarStyle to StyleHelper
Task-number: QTCREATORBUG-29054 Change-Id: I01572eb7bdd267ea6aadb9530afc52b3c7834382 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -58,6 +58,21 @@ QColor StyleHelper::alphaBlendedColors(const QColor &colorA, const QColor &color
|
||||
);
|
||||
}
|
||||
|
||||
int StyleHelper::navigationWidgetHeight()
|
||||
{
|
||||
return m_toolbarStyle == ToolbarStyleCompact ? 24 : 30;
|
||||
}
|
||||
|
||||
void StyleHelper::setToolbarStyle(ToolbarStyle style)
|
||||
{
|
||||
m_toolbarStyle = style;
|
||||
}
|
||||
|
||||
StyleHelper::ToolbarStyle StyleHelper::toolbarStyle()
|
||||
{
|
||||
return m_toolbarStyle;
|
||||
}
|
||||
|
||||
qreal StyleHelper::sidebarFontSize()
|
||||
{
|
||||
return HostOsInfo::isMacHost() ? 10 : 7.5;
|
||||
@@ -89,6 +104,7 @@ QColor StyleHelper::panelTextColor(bool lightColored)
|
||||
return Qt::black;
|
||||
}
|
||||
|
||||
StyleHelper::ToolbarStyle StyleHelper::m_toolbarStyle = StyleHelper::defaultToolbarStyle;
|
||||
// Invalid by default, setBaseColor needs to be called at least once
|
||||
QColor StyleHelper::m_baseColor;
|
||||
QColor StyleHelper::m_requestedBaseColor;
|
||||
|
||||
@@ -25,8 +25,16 @@ public:
|
||||
static const unsigned int DEFAULT_BASE_COLOR = 0x666666;
|
||||
static const int progressFadeAnimationDuration = 600;
|
||||
|
||||
enum ToolbarStyle {
|
||||
ToolbarStyleCompact,
|
||||
ToolbarStyleRelaxed,
|
||||
};
|
||||
|
||||
// Height of the project explorer navigation bar
|
||||
static int navigationWidgetHeight() { return 24; }
|
||||
static int navigationWidgetHeight();
|
||||
static void setToolbarStyle(ToolbarStyle style);
|
||||
static ToolbarStyle toolbarStyle();
|
||||
static constexpr ToolbarStyle defaultToolbarStyle = ToolbarStyleCompact;
|
||||
static qreal sidebarFontSize();
|
||||
static QPalette sidebarFontPalette(const QPalette &original);
|
||||
|
||||
@@ -122,6 +130,7 @@ public:
|
||||
static QColor ensureReadableOn(const QColor &background, const QColor &desiredForeground);
|
||||
|
||||
private:
|
||||
static ToolbarStyle m_toolbarStyle;
|
||||
static QColor m_baseColor;
|
||||
static QColor m_requestedBaseColor;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user