Refactoring. Code style.
This commit is contained in:
parent
1261708b06
commit
f8562b63ea
|
@ -29,16 +29,14 @@
|
||||||
|
|
||||||
#include "stylehelper.h"
|
#include "stylehelper.h"
|
||||||
|
|
||||||
#include <QPixmapCache>
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QRect>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPalette>
|
|
||||||
#include <QStyleOption>
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QPainter>
|
||||||
#include "../vmisc/vmath.h"
|
#include <QPalette>
|
||||||
|
#include <QPixmapCache>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QStyleOption>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto StyleHelper::sidebarFontSize() -> qreal
|
auto StyleHelper::sidebarFontSize() -> qreal
|
||||||
|
@ -82,9 +80,7 @@ auto StyleHelper::baseColor(bool lightColored) -> QColor
|
||||||
auto StyleHelper::borderColor(bool lightColored) -> QColor
|
auto StyleHelper::borderColor(bool lightColored) -> QColor
|
||||||
{
|
{
|
||||||
QColor result = baseColor(lightColored);
|
QColor result = baseColor(lightColored);
|
||||||
result.setHsv(result.hue(),
|
result.setHsv(result.hue(), result.saturation(), result.value() / 2);
|
||||||
result.saturation(),
|
|
||||||
result.value() / 2);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,9 +99,7 @@ void StyleHelper::setBaseColor(const QColor &newcolor)
|
||||||
m_requestedBaseColor = newcolor;
|
m_requestedBaseColor = newcolor;
|
||||||
|
|
||||||
QColor color;
|
QColor color;
|
||||||
color.setHsv(newcolor.hue(),
|
color.setHsv(newcolor.hue(), static_cast<int>(newcolor.saturation() * 0.7), 64 + newcolor.value() / 3);
|
||||||
static_cast<int>(newcolor.saturation() * 0.7),
|
|
||||||
64 + newcolor.value() / 3);
|
|
||||||
|
|
||||||
if (color.isValid() && color != m_baseColor)
|
if (color.isValid() && color != m_baseColor)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user