Added reset function

This commit is contained in:
defnax 2025-07-04 21:31:42 +02:00
parent 02f2f4e075
commit 51922db70a
3 changed files with 38 additions and 1 deletions

View file

@ -714,6 +714,16 @@ void ChatPage::on_linkColorButton_clicked()
}
}
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)

View file

@ -57,6 +57,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);
@ -88,6 +89,7 @@ class ChatPage : public ConfigPage
QRgb rgbChatSearchFoundColor;
QRgb rgbLinkColor;
QRgb defaultColor;
/** Qt Designer generated object */
Ui::ChatPage ui;

View file

@ -511,6 +511,18 @@
</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>
@ -519,6 +531,17 @@
</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>
@ -1418,6 +1441,8 @@
<header>gui/common/RSComboBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../icons.qrc"/>
</resources>
<connections/>
</ui>