Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat: add color for links in palette
Browse files Browse the repository at this point in the history
  • Loading branch information
TriKriSta committed Feb 23, 2019
1 parent 9a82d81 commit d35dbcc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/widget/form/settings/aboutform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "src/widget/tool/recursivesignalblocker.h"
#include "src/net/updatecheck.h"
#include "src/widget/style.h"
#include "src/widget/translator.h"
#include "src/persistence/profile.h"
#include "src/persistence/settings.h"
Expand Down Expand Up @@ -192,8 +193,8 @@ void AboutForm::onUpdateCheckFailed()
QString AboutForm::createLink(QString path, QString text) const
{
return QString::fromUtf8(
"<a href=\"%1\" style=\"text-decoration: underline; color:#0000ff;\">%2</a>")
.arg(path, text);
"<a href=\"%1\" style=\"text-decoration: underline; color:%2;\">%3</a>")
.arg(path, Style::getColor(Style::Link).name(), text);
}

AboutForm::~AboutForm()
Expand Down
6 changes: 4 additions & 2 deletions src/widget/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ QMap<Style::ColorPalette, QString> Style::aliasColors = {{Green, "green"},
{ThemeMediumDark, "themeMediumDark"},
{ThemeMedium, "themeMedium"},
{ThemeLight, "themeLight"},
{Action, "action"}};
{Action, "action"},
{Link, "link"}};

// stylesheet filename, font -> stylesheet
// QString implicit sharing deduplicates stylesheets rather than constructing a new one each time
Expand Down Expand Up @@ -397,7 +398,8 @@ void Style::initDictColor()
{"@groundExtra", Style::getColor(Style::GroundExtra).name()},
{"@groundBase", Style::getColor(Style::GroundBase).name()},
{"@orange", Style::getColor(Style::Orange).name()},
{"@action", Style::getColor(Style::Action).name()}};
{"@action", Style::getColor(Style::Action).name()},
{"@link", Style::getColor(Style::Link).name()}};
}

QString Style::getThemePath()
Expand Down
3 changes: 2 additions & 1 deletion src/widget/style.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class Style
ThemeMediumDark,
ThemeMedium,
ThemeLight,
Action
Action,
Link
};

enum Font
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/chatArea/innerStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ p {
}

a {
color: #d292ff;
color: @link;
font-weight: bold
}
1 change: 1 addition & 0 deletions themes/dark/palette.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a"
themeMedium="#100f0f"
themeLight="#201f1f"
action="#546eff"
link="#d292ff"
2 changes: 1 addition & 1 deletion themes/default/chatArea/innerStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ p {
}

a {
color: blue;
color: @link;
}
1 change: 1 addition & 0 deletions themes/default/palette.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a"
themeMedium="#414141"
themeLight="#4e4e4e"
action="#1818FF"
link="#0000ff"

0 comments on commit d35dbcc

Please sign in to comment.