Link color themeable

This commit is contained in:
LFriede 2020-11-16 22:11:58 +01:00 committed by Duncan Ogilvie
parent 47313dee8a
commit 8b024cb171
7 changed files with 19 additions and 1 deletions

View File

@ -235,3 +235,4 @@ ThreadCurrentBackgroundColor=#C24000
ThreadCurrentColor=#FFFFFF
WatchTriggeredBackgroundColor=#XXXXXX
WatchTriggeredColor=#EF5350
LinkColor=#89A2F6

View File

@ -231,7 +231,7 @@
<set>Qt::ImhUrlCharactersOnly</set>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://p.yusukekamiyamane.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Yusuke Kamiyamane&lt;/span&gt;&lt;/a&gt;&lt;br/&gt;&lt;a href=&quot;https://github.com/mrfearless&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;mrfearless&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://p.yusukekamiyamane.com&quot;&gt;&lt;span style=&quot; text-decoration: underline;&quot;&gt;Yusuke Kamiyamane&lt;/span&gt;&lt;/a&gt;&lt;br/&gt;&lt;a href=&quot;https://github.com/mrfearless&quot;&gt;&lt;span style=&quot; text-decoration: underline;&quot;&gt;mrfearless&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>

View File

@ -602,6 +602,7 @@ void AppearanceDialog::colorInfoListInit()
colorInfoListAppend(tr("Symbol Unloaded Text"), "SymbolUnloadedTextColor", "");
colorInfoListAppend(tr("Symbol Loading Text"), "SymbolLoadingTextColor", "");
colorInfoListAppend(tr("Symbol Loaded Text"), "SymbolLoadedTextColor", "");
colorInfoListAppend(tr("Link color"), "LinkColor", "");
//dev helper

View File

@ -360,6 +360,7 @@ MainWindow::MainWindow(QWidget* parent)
connect(mTabWidget, SIGNAL(tabMovedTabWidget(int, int)), this, SLOT(tabMovedSlot(int, int)));
connect(Config(), SIGNAL(shortcutsUpdated()), this, SLOT(refreshShortcuts()));
connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateStyle()));
// Menu stuff
actionManageFavourites = nullptr;
@ -2322,3 +2323,11 @@ void MainWindow::on_actionDefaultTheme_triggered()
// Remove custom colors
BridgeSettingSet("Colors", "CustomColorCount", nullptr);
}
void MainWindow::updateStyle()
{
// Set configured link color
QPalette appPalette = QApplication::palette();
appPalette.setColor(QPalette::Link, ConfigColor("LinkColor"));
QApplication::setPalette(appPalette);
}

View File

@ -275,6 +275,7 @@ protected:
private slots:
void setupLanguagesMenu2();
void updateStyle();
void on_actionFaq_triggered();
void on_actionReloadStylesheet_triggered();

View File

@ -245,6 +245,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
defaultColors.insert("SymbolLoadingTextColor", QColor("#8B671F"));
defaultColors.insert("SymbolLoadedTextColor", QColor("#008000"));
defaultColors.insert("BackgroundFlickerColor", QColor("#ff6961"));
defaultColors.insert("LinkColor", QColor("#0000ff"));
//bool settings
QMap<QString, bool> disassemblyBool;

View File

@ -107,6 +107,11 @@ int main(int argc, char* argv[])
mConfiguration = new Configuration;
application.setFont(ConfigFont("Application"));
// Set configured link color
QPalette appPalette = application.palette();
appPalette.setColor(QPalette::Link, ConfigColor("LinkColor"));
application.setPalette(appPalette);
// Register custom data types
qRegisterMetaType<dsint>("dsint");
qRegisterMetaType<duint>("duint");