1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor: rename palette colors

This commit is contained in:
TriKriSta 2019-02-22 18:01:43 +02:00
parent e146c11f0f
commit c6142e4287
33 changed files with 118 additions and 123 deletions

View File

@ -66,7 +66,7 @@ ChatLog::ChatLog(QWidget* parent)
setDragMode(QGraphicsView::NoDrag);
setViewportUpdateMode(MinimalViewportUpdate);
setContextMenuPolicy(Qt::CustomContextMenu);
setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern));
setBackgroundBrush(QBrush(Style::getColor(Style::GroundBase), Qt::SolidPattern));
// The selection rect for multi-line selection
selGraphItem = scene->addRect(0, 0, 0, 0, selectionRectColor.darker(120), selectionRectColor);
@ -662,7 +662,7 @@ void ChatLog::fontChanged(const QFont& font)
void ChatLog::reloadTheme()
{
setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern));
setBackgroundBrush(QBrush(Style::getColor(Style::GroundBase), Qt::SolidPattern));
for (ChatLine::Ptr l : lines) {
l->reloadTheme();

View File

@ -87,7 +87,7 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt
if (isMe)
authorFont.setBold(true);
QColor color = Style::getColor(Style::Black);
QColor color = Style::getColor(Style::MainText);
if (colorizeName && Settings::getInstance().getEnableGroupChatsColor()) {
QByteArray hash = QCryptographicHash::hash((sender.toUtf8()), QCryptographicHash::Sha256);
quint8 *data = (quint8*)hash.data();

View File

@ -52,9 +52,9 @@ FileTransferWidget::FileTransferWidget(QWidget* parent, ToxFile file)
: QWidget(parent)
, ui(new Ui::FileTransferWidget)
, fileInfo(file)
, backgroundColor(Style::getColor(Style::LightGrey))
, backgroundColor(Style::getColor(Style::GroundExtra))
, buttonColor(Style::getColor(Style::Yellow))
, buttonBackgroundColor(Style::getColor(Style::White))
, buttonBackgroundColor(Style::getColor(Style::GroundBase))
, active(true)
{
ui->setupUi(this);
@ -329,7 +329,7 @@ void FileTransferWidget::updateWidgetColor(ToxFile const& file)
case ToxFile::INITIALIZING:
case ToxFile::PAUSED:
case ToxFile::TRANSMITTING:
setBackgroundColor(Style::getColor(Style::LightGrey), false);
setBackgroundColor(Style::getColor(Style::GroundExtra), false);
break;
case ToxFile::BROKEN:
case ToxFile::CANCELED:
@ -510,7 +510,7 @@ void FileTransferWidget::setupButtons(ToxFile const& file)
ui->rightButton->setObjectName("cancel");
ui->rightButton->setToolTip(tr("Cancel transfer"));
setButtonColor(Style::getColor(Style::LightGrey));
setButtonColor(Style::getColor(Style::GroundExtra));
break;
case ToxFile::INITIALIZING:

View File

@ -471,7 +471,7 @@ void Text::selectText(QTextCursor& cursor, const std::pair<int, int>& point)
QColor Text::textColor() const
{
QColor c = Style::getColor(Style::Black);
QColor c = Style::getColor(Style::MainText);
if (textType == ACTION) {
c = Style::getColor(Style::Action);
} else if (textType == CUSTOM) {

View File

@ -40,7 +40,7 @@ public:
};
Text(const QString& txt = "", const QFont& font = QFont(), bool enableElide = false,
const QString& rawText = QString(), const TextType& type = NORMAL, const QColor& custom = Style::getColor(Style::Black));
const QString& rawText = QString(), const TextType& type = NORMAL, const QColor& custom = Style::getColor(Style::MainText));
virtual ~Text();
void setText(const QString& txt);

View File

@ -163,19 +163,19 @@ void GenericChatroomWidget::reloadTheme()
QPalette p;
p = statusMessageLabel->palette();
p.setColor(QPalette::WindowText, Style::getColor(Style::LightGrey)); // Base color
p.setColor(QPalette::HighlightedText, Style::getColor(Style::MediumGrey)); // Color when active
p.setColor(QPalette::WindowText, Style::getColor(Style::GroundExtra)); // Base color
p.setColor(QPalette::HighlightedText, Style::getColor(Style::StatusActive)); // Color when active
statusMessageLabel->setPalette(p);
p = nameLabel->palette();
p.setColor(QPalette::WindowText, Style::getColor(Style::White)); // Base color
p.setColor(QPalette::HighlightedText, Style::getColor(Style::DarkGrey)); // Color when active
p.setColor(QPalette::WindowText, Style::getColor(Style::GroundBase)); // Base color
p.setColor(QPalette::HighlightedText, Style::getColor(Style::NameActive)); // Color when active
nameLabel->setPalette(p);
p = palette();
p.setColor(QPalette::Window, Style::getColor(Style::ThemeMedium)); // Base background color
p.setColor(QPalette::Highlight, Style::getColor(Style::ThemeLight)); // On mouse over
p.setColor(QPalette::Light, Style::getColor(Style::White)); // When active
p.setColor(QPalette::Light, Style::getColor(Style::GroundBase)); // When active
setPalette(p);
}

View File

@ -126,12 +126,11 @@ QList<QColor> Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#9
QMap<Style::ColorPalette, QString> Style::aliasColors = {{Green, "green"},
{Yellow, "yellow"},
{Red, "red"},
{Black,"black"},
{DarkGrey, "darkGrey"},
{MediumGrey,"mediumGrey"},
{MediumGreyLight, "mediumGreyLight"},
{LightGrey, "lightGrey"},
{White, "white"},
{MainText,"mainText"},
{NameActive, "nameActive"},
{StatusActive,"statusActive"},
{GroundExtra, "groundExtra"},
{GroundBase, "groundBase"},
{Orange, "orange"},
{ThemeDark, "themeDark"},
{ThemeMediumDark, "themeMediumDark"},
@ -392,12 +391,11 @@ void Style::initDictColor()
{"@green", Style::getColor(Style::Green).name()},
{"@yellow", Style::getColor(Style::Yellow).name()},
{"@red", Style::getColor(Style::Red).name()},
{"@black", Style::getColor(Style::Black).name()}, // NOTE: (Dark) rename to textColor
{"@darkGrey", Style::getColor(Style::DarkGrey).name()},
{"@mediumGrey", Style::getColor(Style::MediumGrey).name()},
{"@mediumGreyLight", Style::getColor(Style::MediumGreyLight).name()},
{"@lightGrey", Style::getColor(Style::LightGrey).name()},
{"@white", Style::getColor(Style::White).name()},
{"@mainText", Style::getColor(Style::MainText).name()},
{"@nameActive", Style::getColor(Style::NameActive).name()},
{"@statusActive", Style::getColor(Style::StatusActive).name()},
{"@groundExtra", Style::getColor(Style::GroundExtra).name()},
{"@groundBase", Style::getColor(Style::GroundBase).name()},
{"@orange", Style::getColor(Style::Orange).name()},
{"@action", Style::getColor(Style::Action).name()}};
}

View File

@ -34,12 +34,11 @@ public:
Green,
Yellow,
Red,
Black,
DarkGrey,
MediumGrey,
MediumGreyLight,
LightGrey,
White,
MainText,
NameActive,
StatusActive,
GroundExtra,
GroundBase,
Orange,
ThemeDark,
ThemeMediumDark,

View File

@ -1,24 +1,24 @@
QLabel
{
color: #c3c3c3;
color: @mainText;
}
QLineEdit
{
color: #c3c3c3;
color: @mainText;
}
QTextEdit
{
color: #c3c3c3;
color: @mainText;
}
QSpinBox
{
color: #c3c3c3;
color: @mainText;
}
QListView
{
color: #c3c3c3;
color: @mainText;
}

View File

@ -11,5 +11,5 @@ QGraphicsView
QWidget
{
background: #201f1f;
background: @groundBase;
}

View File

@ -1,27 +1,27 @@
QLineEdit
{
color: @black;
color: @mainText;
background: white;
border: 0px;
}
#nameLabel
{
color: #c3c3c3;
color: @mainText;
font: @mediumBold;
font-size:12px;
}
#statusLabel
{
color: @mediumGrey;
color: @statusActive;
font: @medium;
font-size:12px;
}
#peersLabel
{
color: @mediumGrey;
color: @statusActive;
font: @medium;
font-size:12px;
}

View File

@ -13,7 +13,7 @@ p {
}
.typing {
color: @mediumGreyLight;
color: #131212;
}
.quote {

View File

@ -35,6 +35,6 @@ QRadioButton::indicator:checked
QMenu
{
background-color: @mediumGrey; /* sets background of the menu */
background-color: @statusActive; /* sets background of the menu */
border: 0px solid;
}

View File

@ -1,27 +1,27 @@
[fontColor="white"] QLabel {
color:white;
font:@big;
color: white;
font: @big;
}
[fontColor="black"] QLabel {
color:@mediumGrey;
font:@big;
color: @statusActive;
font: @big;
}
QPushButton {
margin:0;
margin: 0;
border: none;
}
QProgressBar {
border: 2px solid @mediumGrey;
border: 2px solid @statusActive;
border-radius: 0px;
background-color: @mediumGrey;
background-color: @statusActive;
}
QProgressBar::chunk {
background-color: @lightGrey;
background-color: @groundExtra;
width: 1px;
}
}

View File

@ -70,7 +70,7 @@ QWidget#circleWidgetContainer QLineEdit
QWidget#circleWidgetContainer > QLabel#status
{
font: @small;
color: #c3c3c3;
color: @mainText;
}
QWidget#circleWidgetContainer > QLabel#name

View File

@ -1,4 +1,4 @@
QWidget
{
background: #201f1f;
background: @groundBase;
}

View File

@ -59,7 +59,7 @@ QStackedWidget QPushButton
QLabel
{
color: #c3c3c3;
color: @mainText;
background: #100f0f;
}
@ -70,8 +70,8 @@ QLabel#label_7
QCheckBox, QProgressBar, QComboBox, QLineEdit, QListView
{
color: #c3c3c3;
background: #201f1f;
color: @mainText;
background: @groundBase;
}
QCheckBox:disabled

View File

@ -1,9 +1,9 @@
QTextEdit
{
border-color: @lightGrey;
border-color: @groundExtra;
border-style: solid;
border-width: 1px 0 1px 1px;
background: #201f1f;
background: @groundBase;
}
QTextEdit:hover

View File

@ -2,15 +2,14 @@
green="#6bc260"
yellow="#cebf44"
red="#c84e4e"
black="#c3c3c3"
darkGrey="#c3c3c3"
mediumGrey="#d1d1d1"
mediumGreyLight="#131212"
lightGrey="#d1d1d1"
white="#201f1f"
mainText="#c3c3c3"
nameActive="#c3c3c3"
statusActive="#d1d1d1"
groundExtra="#d1d1d1"
groundBase="#201f1f"
orange="#ff7700"
themeDark="#1c1c1c"
themeMediumDark="#2a2a2a"
themeMedium="#100f0f"
themeLight="#201f1f"
action="#546eff"
action="#546eff"

View File

@ -1,25 +1,25 @@
QTextEdit
{
border-color: @lightGrey;
border-color: @groundExtra;
border-style: solid;
border-width: 1px 0 1px 1px;
background: #201f1f;
background: @groundBase;
border: 1px solid #c4c1bd;
}
QListWidget
{
background-color: #201f1f;
background-color: @groundBase;
}
QMessageBox
{
background-color: #201f1f;
background-color: @groundBase;
}
QCheckBox
{
color: #c3c3c3;
color: @mainText;
}
QCheckBox:disabled
@ -29,7 +29,7 @@ QCheckBox:disabled
QSpinBox
{
background-color: #201f1f;
background-color: @groundBase;
}
QSpinBox:disabled
@ -39,30 +39,30 @@ QSpinBox:disabled
QGroupBox
{
color: #c3c3c3;
background-color: #201f1f;
color: @mainText;
background-color: @groundBase;
font: @bigBold;
}
QComboBox
{
color: #c3c3c3;
background-color: #201f1f;
color: @mainText;
background-color: @groundBase;
}
QComboBox QAbstractItemView {
background-color: #201f1f;
background-color: @groundBase;
}
QLineEdit
{
background-color: #201f1f;
background-color: @groundBase;
}
QLineEdit:disabled
{
background-color: #262424
color: #201f1f;
color: @groundBase;
}
QTabWidget
@ -73,7 +73,7 @@ QTabWidget
QTabBar::tab:selected
{
background: #100f0f;
color: #c3c3c3;
color: @mainText;
}
QTabBar::tab:!selected
@ -84,7 +84,7 @@ QTabBar::tab:!selected
QScrollArea
{
background-color: #201f1f;
background-color: @groundBase;
}
QScrollArea > QWidget > QWidget
@ -94,7 +94,7 @@ QScrollArea > QWidget > QWidget
QScrollArea::corner
{
background-color: #201f1f;
background-color: @groundBase;
border: none;
}
@ -231,12 +231,12 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal
QRadioButton
{
background: #201f1f;
color: #c3c3c3;
background: @groundBase;
color: @mainText;
}
QPushButton
{
background: #323030;
color: #c3c3c3;
color: @mainText;
}

View File

@ -1,5 +1,5 @@
QWidget .QLabel, QWidget .QLineEdit
{
color: #c3c3c3;
background: #201f1f;
color: @mainText;
background: @groundBase;
}

View File

@ -8,6 +8,6 @@ QToolTip
QWidget#contentWidget
{
background: #201f1f;
background: @groundBase;
}

View File

@ -79,14 +79,14 @@ QListView
{
background-color: @themeDark;
font: @extraBig;
color: @white;
color: @groundBase;
}
#statusPanel > #statusHead > #statusLabel
{
background-color: @themeDark;
font: @medium;
color: @lightGrey;
color: @groundExtra;
}
#statusPanel > #statusHead > #statusButton

View File

@ -1,24 +1,24 @@
QLabel
{
color: black;
color: @mainText;
}
QLineEdit
{
color: black;
color: @mainText;
}
QTextEdit
{
color: black;
color: @mainText;
}
QSpinBox
{
color: black;
color: @mainText;
}
QListView
{
color: black;
color: @mainText;
}

View File

@ -1,27 +1,27 @@
QLineEdit
{
color: @black;
color: @mainText;
background: white;
border: 0px;
}
#nameLabel
{
color: @black;
color: @mainText;
font: @mediumBold;
font-size:12px;
}
#statusLabel
{
color: @mediumGrey;
color: @statusActive;
font: @medium;
font-size:12px;
}
#peersLabel
{
color: @mediumGrey;
color: @statusActive;
font: @medium;
font-size:12px;
}

View File

@ -12,7 +12,7 @@ p {
}
.typing {
color: @mediumGreyLight;
color: #4e4e4e;
}
.quote {

View File

@ -35,6 +35,6 @@ QRadioButton::indicator:checked
QMenu
{
background-color: @mediumGrey; /* sets background of the menu */
background-color: @statusActive; /* sets background of the menu */
border: 0px solid;
}

View File

@ -1,11 +1,11 @@
[fontColor="white"] QLabel {
color:white;
font:@big;
color: white;
font: @big;
}
[fontColor="black"] QLabel {
color:@mediumGrey;
font:@big;
color: @statusActive;
font: @big;
}
QPushButton {
@ -16,12 +16,12 @@ QPushButton {
QProgressBar {
border: 2px solid @mediumGrey;
border: 2px solid @statusActive;
border-radius: 0px;
background-color: @mediumGrey;
background-color: @statusActive;
}
QProgressBar::chunk {
background-color: @lightGrey;
background-color: @groundExtra;
width: 1px;
}
}

View File

@ -70,13 +70,13 @@ QWidget#circleWidgetContainer QLineEdit
QWidget#circleWidgetContainer > QLabel#status
{
font: @small;
color: @lightGrey;
color: @groundExtra;
}
QWidget#circleWidgetContainer > QLabel#name
{
font: @big;
color: @white;
color: @groundBase;
}
QLabel {

View File

@ -1,6 +1,6 @@
QTextEdit
{
border-color: @lightGrey;
border-color: @groundExtra;
border-style: solid;
border-width: 1px 0 1px 1px;
background: white;

View File

@ -2,15 +2,14 @@
green="#6bc260"
yellow="#cebf44"
red="#c84e4e"
black="#000000"
darkGrey="#1c1c1c"
mediumGrey="#414141"
mediumGreyLight="#4e4e4e"
lightGrey="#d1d1d1"
white="#ffffff"
mainText="#000000"
nameActive="#1c1c1c"
statusActive="#414141"
groundExtra="#d1d1d1"
groundBase="#ffffff"
orange="#ff7700"
themeDark="#1c1c1c"
themeMediumDark="#2a2a2a"
themeMedium="#414141"
themeLight="#4e4e4e"
action="#1818FF"
action="#1818FF"

View File

@ -1,6 +1,6 @@
QTextEdit
{
border-color: @lightGrey;
border-color: @groundExtra;
border-style: solid;
border-width: 1px 0 1px 1px;
background: white;

View File

@ -79,14 +79,14 @@ QListView
{
background-color: @themeDark;
font: @extraBig;
color: @white;
color: @groundBase;
}
#statusPanel > #statusHead > #statusLabel
{
background-color: @themeDark;
font: @medium;
color: @lightGrey;
color: @groundExtra;
}
#statusPanel > #statusHead > #statusButton