Browse Source

feat: add color for links in palette

reviewable/pr5558/r3
TriKriSta 7 years ago
parent
commit
d35dbcc870
  1. 5
      src/widget/form/settings/aboutform.cpp
  2. 6
      src/widget/style.cpp
  3. 3
      src/widget/style.h
  4. 2
      themes/dark/chatArea/innerStyle.css
  5. 1
      themes/dark/palette.ini
  6. 2
      themes/default/chatArea/innerStyle.css
  7. 1
      themes/default/palette.ini

5
src/widget/form/settings/aboutform.cpp

@ -22,6 +22,7 @@ @@ -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"
@ -192,8 +193,8 @@ void AboutForm::onUpdateCheckFailed() @@ -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()

6
src/widget/style.cpp

@ -136,7 +136,8 @@ QMap<Style::ColorPalette, QString> Style::aliasColors = {{Green, "green"}, @@ -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
@ -397,7 +398,8 @@ void Style::initDictColor() @@ -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()

3
src/widget/style.h

@ -44,7 +44,8 @@ public: @@ -44,7 +44,8 @@ public:
ThemeMediumDark,
ThemeMedium,
ThemeLight,
Action
Action,
Link
};
enum Font

2
themes/dark/chatArea/innerStyle.css

@ -32,6 +32,6 @@ p { @@ -32,6 +32,6 @@ p {
}
a {
color: #d292ff;
color: @link;
font-weight: bold
}

1
themes/dark/palette.ini

@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a" @@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a"
themeMedium="#100f0f"
themeLight="#201f1f"
action="#546eff"
link="#d292ff"

2
themes/default/chatArea/innerStyle.css

@ -31,5 +31,5 @@ p { @@ -31,5 +31,5 @@ p {
}
a {
color: blue;
color: @link;
}

1
themes/default/palette.ini

@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a" @@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a"
themeMedium="#414141"
themeLight="#4e4e4e"
action="#1818FF"
link="#0000ff"

Loading…
Cancel
Save