Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
appearance_settings_widget.h
Go to the documentation of this file.
1#ifndef APPEARANCE_SETTINGS_WIDGET_H
2#define APPEARANCE_SETTINGS_WIDGET_H
3
4#include <QWidget>
5
6class QPushButton;
7class QHBoxLayout;
8class QSpinBox;
11
22class AppearanceSettingsWidget final : public QWidget {
23 Q_OBJECT
24
25public:
32 explicit AppearanceSettingsWidget(QWidget *parent = nullptr);
33
37 ~AppearanceSettingsWidget() override = default;
38
42 void LoadSettings();
43
49 void SaveSettings() const;
50
51private slots:
57
62 void ChooseBlobColor();
63
68 void ChooseStreamColor();
69
76
82 void SelectRecentColor(const QColor &color) const;
83
88 void ChooseGridColor();
89
95 void GridSpacingChanged(int value);
96
102
108
114
115private:
119 void SetupUi();
120
126 static void UpdateColorPreview(QWidget *preview_widget, const QColor &color);
127
130
150 QList<QPushButton *> recent_color_buttons_;
151
170};
171
172#endif // APPEARANCE_SETTINGS_WIDGET_H
QColor selected_stream_color_
Currently selected stream color.
Definition appearance_settings_widget.h:157
QColor selected_blob_color_
Currently selected blob color.
Definition appearance_settings_widget.h:155
QWidget * title_text_color_preview_
Clickable preview widget for the title text color.
Definition appearance_settings_widget.h:142
AppearanceSettingsWidget(QWidget *parent=nullptr)
Constructs the AppearanceSettingsWidget. Initializes the UI, loads current settings from WavelengthCo...
Definition appearance_settings_widget.cpp:14
void ChooseTitleGlowColor()
Opens a QColorDialog to allow the user to select the title glow color. Updates the local preview and ...
Definition appearance_settings_widget.cpp:308
void ChooseTitleTextColor()
Opens a QColorDialog to allow the user to select the title text color. Updates the local preview and ...
Definition appearance_settings_widget.cpp:288
QHBoxLayout * recent_colors_layout_
Horizontal layout containing the recent color preview buttons.
Definition appearance_settings_widget.h:148
WavelengthConfig * m_config
Pointer to the WavelengthConfig singleton instance.
Definition appearance_settings_widget.h:129
QColor selected_title_glow_color_
Currently selected title glow color.
Definition appearance_settings_widget.h:167
void ChooseBackgroundColor()
Opens a QColorDialog to allow the user to select the background color. Updates the local preview and ...
Definition appearance_settings_widget.cpp:234
QColor selected_title_border_color_
Currently selected title border color.
Definition appearance_settings_widget.h:165
QList< QPushButton * > recent_color_buttons_
List storing pointers to the dynamically created recent color buttons.
Definition appearance_settings_widget.h:150
void UpdateRecentColorsUI()
Updates the UI section displaying recently used colors. Clears the existing recent color buttons and ...
Definition appearance_settings_widget.cpp:322
QWidget * title_border_color_preview_
Clickable preview widget for the title border color.
Definition appearance_settings_widget.h:144
QColor selected_background_color_
Currently selected background color.
Definition appearance_settings_widget.h:153
void ChooseBlobColor()
Opens a QColorDialog to allow the user to select the blob color. Updates the local preview and immedi...
Definition appearance_settings_widget.cpp:247
void LoadSettings()
Loads the current appearance settings from WavelengthConfig and updates the UI elements.
Definition appearance_settings_widget.cpp:195
void GridSpacingChanged(int value)
Slot triggered when the grid spacing spin box value changes. Immediately saves the new spacing value ...
Definition appearance_settings_widget.cpp:281
int selected_grid_spacing_
Currently selected grid spacing value.
Definition appearance_settings_widget.h:161
QWidget * bg_color_preview_
Clickable preview widget for the background color.
Definition appearance_settings_widget.h:132
void ChooseStreamColor()
Opens a QColorDialog to allow the user to select the stream color. Updates the local preview and imme...
Definition appearance_settings_widget.cpp:260
void ChooseGridColor()
Opens a QColorDialog to allow the user to select the grid color. Updates the local preview and immedi...
Definition appearance_settings_widget.cpp:270
void SelectRecentColor(const QColor &color) const
Slot triggered when a recent color button is clicked. Adds the selected color back to the top of the ...
Definition appearance_settings_widget.cpp:318
void SaveSettings() const
Saves the currently selected settings back to WavelengthConfig. Note: In the current implementation,...
Definition appearance_settings_widget.cpp:215
QWidget * title_glow_color_preview_
Clickable preview widget for the title glow color.
Definition appearance_settings_widget.h:146
void ChooseTitleBorderColor()
Opens a QColorDialog to allow the user to select the title border color. Updates the local preview an...
Definition appearance_settings_widget.cpp:298
TranslationManager * translator_
Pointer to the translation manager for handling UI translations.
Definition appearance_settings_widget.h:169
QWidget * grid_color_preview_
Clickable preview widget for the grid color.
Definition appearance_settings_widget.h:138
QColor selected_grid_color_
Currently selected grid color.
Definition appearance_settings_widget.h:159
QColor selected_title_text_color_
Currently selected title text color.
Definition appearance_settings_widget.h:163
QWidget * blob_color_preview_
Clickable preview widget for the blob color.
Definition appearance_settings_widget.h:134
static void UpdateColorPreview(QWidget *preview_widget, const QColor &color)
Static utility function to update the background color of a ClickableColorPreview widget.
Definition appearance_settings_widget.cpp:226
QWidget * stream_color_preview_
Clickable preview widget for the stream color.
Definition appearance_settings_widget.h:136
QSpinBox * grid_spacing_spin_box_
Spin box for adjusting the grid spacing.
Definition appearance_settings_widget.h:140
~AppearanceSettingsWidget() override=default
Default destructor.
void SetupUi()
Creates and arranges all the UI elements (labels, previews, spin boxes, layouts) for the widget.
Definition appearance_settings_widget.cpp:27
Manages the loading and delivery of translations for applications.
Definition translation_manager.h:15
Manages application configuration settings using a singleton pattern.
Definition wavelength_config.h:36