diff options
| author | Felix Ernst <[email protected]> | 2022-04-25 12:52:05 +0200 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2022-08-14 14:42:40 +0000 |
| commit | 78cffd2979a6ed87e044fcb024cf4fdfc5c7cb3d (patch) | |
| tree | 7e5b66a5b4fc8c3328949d80898be2d1d57da5b7 /src/selectionmode/backgroundcolorhelper.h | |
| parent | 8e55f2c2409fd6ca9ebc66a6568f4d3bcbef7576 (diff) | |
Improve code quality
Diffstat (limited to 'src/selectionmode/backgroundcolorhelper.h')
| -rw-r--r-- | src/selectionmode/backgroundcolorhelper.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/selectionmode/backgroundcolorhelper.h b/src/selectionmode/backgroundcolorhelper.h index 8d2730fcf..251c5eddf 100644 --- a/src/selectionmode/backgroundcolorhelper.h +++ b/src/selectionmode/backgroundcolorhelper.h @@ -28,20 +28,30 @@ public: /** * Changes the background color of @p widget to a distinct color scheme matching color which makes it clear that the widget belongs to the selection mode. + * The background color of @p widget will from now on be updated automatically when the palette of the application changes. */ void controlBackgroundColor(QWidget *widget); private: BackgroundColorHelper(); + /** + * Called when the palette of the application changes. + * Triggers updateBackgroundColor() and the updates the background color of m_colorControlledWidgets. + * @see updateBackgroundColor + */ void slotPaletteChanged(); + /** Calculates a new m_colorControlledWidgets based on the current colour scheme of the application. */ void updateBackgroundColor(); private: + /// The widgets who have given up control over the background color to BackgroundColorHelper. std::vector<QPointer<QWidget>> m_colorControlledWidgets; + /// The color to be used for the widgets' backgrounds. QColor m_backgroundColor; + /// Singleton object static BackgroundColorHelper *s_instance; }; |
