mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-20 05:11:02 -04:00
Moved Color settings to Apearancepage
This commit is contained in:
parent
51922db70a
commit
b8195cafcf
6 changed files with 190 additions and 196 deletions
|
@ -39,6 +39,7 @@
|
|||
#include "util/misc.h"
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QColorDialog>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QDir>
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -71,7 +71,92 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Choose RetroShare's interface style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style Sheet</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleSheetGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleSheetHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="grpToolBar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
@ -289,8 +374,8 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>188</width>
|
||||
<height>96</height>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
@ -298,7 +383,62 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item row="4" column="1">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Link Color</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color of the links</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="linkColorButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set link color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="resetButton">
|
||||
<property name="toolTip">
|
||||
<string>Reset to default color</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/textedit/undo.png</normaloff>:/icons/textedit/undo.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStatus">
|
||||
<property name="title">
|
||||
<string>Status Bar</string>
|
||||
|
@ -407,7 +547,7 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item row="6" column="0" colspan="2">
|
||||
<spacer name="AppearancePageVSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -420,91 +560,6 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Choose RetroShare's interface style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style Sheet</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleSheetGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleSheetHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
@ -514,6 +569,8 @@
|
|||
<header>gui/common/RSComboBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -266,19 +266,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -405,6 +392,11 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="minimumFontSize">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
|
@ -490,61 +482,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Link Color</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color of the links</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="linkColorButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set link color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="resetButton">
|
||||
<property name="toolTip">
|
||||
<string>Reset to default color</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/textedit/undo.png</normaloff>:/icons/textedit/undo.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="rightVSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -1441,8 +1378,6 @@
|
|||
<header>gui/common/RSComboBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue