From b8195cafcf1bc2eb188c5709a31a7591409030eb Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 4 Jul 2025 23:49:55 +0200 Subject: [PATCH] Moved Color settings to Apearancepage --- .../src/gui/settings/AppearancePage.cpp | 29 +++ .../src/gui/settings/AppearancePage.h | 6 + .../src/gui/settings/AppearancePage.ui | 239 +++++++++++------- retroshare-gui/src/gui/settings/ChatPage.cpp | 29 --- retroshare-gui/src/gui/settings/ChatPage.h | 6 +- retroshare-gui/src/gui/settings/ChatPage.ui | 77 +----- 6 files changed, 190 insertions(+), 196 deletions(-) diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp index 2aecd6024..481c0850d 100755 --- a/retroshare-gui/src/gui/settings/AppearancePage.cpp +++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp @@ -39,6 +39,7 @@ #include "util/misc.h" #include +#include #include #include #include @@ -363,6 +364,11 @@ void AppearancePage::load() whileBlocking(ui.checkBoxShowSystrayOnStatus)->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool()); whileBlocking(ui.minimumFontSize_SB)->setValue(Settings->getFontSize()); + + rgbLinkColor=Settings->getLinkColor(); + QPixmap colorpix(24, 24); + colorpix.fill(rgbLinkColor); + ui.linkColorButton->setIcon(colorpix); } void AppearancePage::updateFontSize() @@ -371,3 +377,26 @@ void AppearancePage::updateFontSize() NotifyQt::getInstance()->notifySettingsChanged(); } + +void AppearancePage::on_linkColorButton_clicked() +{ + bool ok; + QRgb color = QColorDialog::getRgba(rgbLinkColor, &ok, window()); + if (ok) { + rgbLinkColor=color; + QPixmap pix(24, 24); + pix.fill(color); + ui.linkColorButton->setIcon(pix); + Settings->setLinkColor(rgbLinkColor); + } +} + +void AppearancePage::on_resetButton_clicked() +{ + QRgb color = QString::number(QColor(3, 155, 198).rgba()).toUInt(); + defaultColor = color; + QPixmap pix(24, 24); + pix.fill(color); + ui.linkColorButton->setIcon(pix); + Settings->setLinkColor(defaultColor); +} diff --git a/retroshare-gui/src/gui/settings/AppearancePage.h b/retroshare-gui/src/gui/settings/AppearancePage.h index 741bd752e..9e8e7e2fc 100755 --- a/retroshare-gui/src/gui/settings/AppearancePage.h +++ b/retroshare-gui/src/gui/settings/AppearancePage.h @@ -73,9 +73,15 @@ private slots: void updateStyle() ; void updateFontSize(); + void on_linkColorButton_clicked(); + void on_resetButton_clicked(); + private: void switch_status(MainWindow::StatusElement s,const QString& key,bool b); + QRgb rgbLinkColor; + QRgb defaultColor; + /** Qt Designer generated object */ Ui::AppearancePage ui; }; diff --git a/retroshare-gui/src/gui/settings/AppearancePage.ui b/retroshare-gui/src/gui/settings/AppearancePage.ui index 13dc7a48e..902329637 100755 --- a/retroshare-gui/src/gui/settings/AppearancePage.ui +++ b/retroshare-gui/src/gui/settings/AppearancePage.ui @@ -71,7 +71,92 @@ - + + + + + 0 + 64 + + + + Qt::NoContextMenu + + + + + + Style + + + + + + + 150 + 0 + + + + Choose RetroShare's interface style + + + + + + + Qt::Horizontal + + + + 215 + 20 + + + + + + + + + + + + 0 + 64 + + + + Style Sheet + + + + + + + 150 + 0 + + + + + + + + Qt::Horizontal + + + + 215 + 20 + + + + + + + + @@ -289,8 +374,8 @@ - 188 - 96 + 20 + 40 @@ -298,7 +383,62 @@ - + + + + Link Color + + + + + + + 0 + 0 + + + + Color of the links + + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + Set link color + + + + + + + + + + Reset to default color + + + + :/icons/textedit/undo.png:/icons/textedit/undo.png + + + + + + + Status Bar @@ -407,7 +547,7 @@ - + Qt::Vertical @@ -420,91 +560,6 @@ - - - - - 0 - 64 - - - - Qt::NoContextMenu - - - - - - Style - - - - - - - 150 - 0 - - - - Choose RetroShare's interface style - - - - - - - Qt::Horizontal - - - - 215 - 20 - - - - - - - - - - - - 0 - 64 - - - - Style Sheet - - - - - - - 150 - 0 - - - - - - - - Qt::Horizontal - - - - 215 - 20 - - - - - - - @@ -514,6 +569,8 @@
gui/common/RSComboBox.h
- + + + diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 2d3810e03..1f35fe62c 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -144,7 +144,6 @@ void ChatPage::updateChatSearchParams() Settings->setChatSearchSearchWithoutLimit(ui.cbSearch_WithoutLimit->isChecked()); Settings->setChatSearchMaxSearchLimitColor(ui.sbSearch_MaxLimitColor->value()); Settings->setChatSearchFoundColor(rgbChatSearchFoundColor); - Settings->setLinkColor(rgbLinkColor); } void ChatPage::updateDefaultLobbyIdentity() @@ -436,11 +435,6 @@ ChatPage::load() pix.fill(rgbChatSearchFoundColor); ui.btSearch_FoundColor->setIcon(pix); - rgbLinkColor=Settings->getLinkColor(); - QPixmap colorpix(24, 24); - colorpix.fill(rgbLinkColor); - ui.linkColorButton->setIcon(colorpix); - whileBlocking(ui.publicChatLoadCount)->setValue(Settings->getPublicChatHistoryCount()); whileBlocking(ui.privateChatLoadCount)->setValue(Settings->getPrivateChatHistoryCount()); whileBlocking(ui.lobbyChatLoadCount)->setValue(Settings->getLobbyChatHistoryCount()); @@ -701,29 +695,6 @@ void ChatPage::on_btSearch_FoundColor_clicked() } } -void ChatPage::on_linkColorButton_clicked() -{ - bool ok; - QRgb color = QColorDialog::getRgba(rgbLinkColor, &ok, window()); - if (ok) { - rgbLinkColor=color; - QPixmap pix(24, 24); - pix.fill(color); - ui.linkColorButton->setIcon(pix); - Settings->setLinkColor(rgbLinkColor); - } -} - -void ChatPage::on_resetButton_clicked() -{ - QRgb color = QString::number(QColor(3, 155, 198).rgba()).toUInt(); - defaultColor = color; - QPixmap pix(24, 24); - pix.fill(color); - ui.linkColorButton->setIcon(pix); - Settings->setLinkColor(defaultColor); -} - void ChatPage::distantChatComboBoxChanged(int i) { switch(i) diff --git a/retroshare-gui/src/gui/settings/ChatPage.h b/retroshare-gui/src/gui/settings/ChatPage.h index 7a9ab4824..4edb66747 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.h +++ b/retroshare-gui/src/gui/settings/ChatPage.h @@ -56,9 +56,7 @@ class ChatPage : public ConfigPage void on_cbSearch_WithoutLimit_toggled(bool); void on_btSearch_FoundColor_clicked(); - void on_linkColorButton_clicked(); - void on_resetButton_clicked(); - + void distantChatComboBoxChanged(int); void updateFontsAndEmotes(); @@ -88,8 +86,6 @@ class ChatPage : public ConfigPage QString historyStyleVariant; QRgb rgbChatSearchFoundColor; - QRgb rgbLinkColor; - QRgb defaultColor; /** Qt Designer generated object */ Ui::ChatPage ui; diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui index 1ab406019..560961cd5 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.ui +++ b/retroshare-gui/src/gui/settings/ChatPage.ui @@ -266,19 +266,6 @@
- - - - Qt::Vertical - - - - 20 - 40 - - - -
@@ -405,6 +392,11 @@ + + + 8 + + 1 @@ -490,61 +482,6 @@ - - - - Link Color - - - - - - - 0 - 0 - - - - Color of the links - - - - - - - - 24 - 24 - - - - - 24 - 24 - - - - Set link color - - - - - - - - - - Reset to default color - - - - :/icons/textedit/undo.png:/icons/textedit/undo.png - - - - - - @@ -1441,8 +1378,6 @@
gui/common/RSComboBox.h
- - - +