Skip to content

Commit

Permalink
Initialize palette field in icon manager
Browse files Browse the repository at this point in the history
This doesn't make a difference right now but in generall it is better to
have the field initialized from the beginning (in accordance to the palette
that is determined anyway for making ForkAwesome icons).
  • Loading branch information
Martchus committed Jan 17, 2025
1 parent 3b632e7 commit 2e38fd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions syncthingmodel/syncthingicons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ ForkAwesomeIcons::ForkAwesomeIcons(QtForkAwesome::Renderer &renderer, const QCol
}

IconManager::IconManager(const QPalette *palette)
: m_statusIcons()
: m_palette(palette ? *palette : QGuiApplication::palette())
, m_statusIcons()
, m_trayIcons(m_statusIcons)
, m_commonForkAwesomeIcons(
m_forkAwesomeRenderer, (palette ? *palette : QGuiApplication::palette()).color(QPalette::Normal, QPalette::Text), QSize(64, 64))
, m_commonForkAwesomeIcons(m_forkAwesomeRenderer, m_palette.color(QPalette::Normal, QPalette::Text), QSize(64, 64))
, m_distinguishTrayIcons(false)
{
m_forkAwesomeRenderer.warnIfInvalid();
Expand Down
2 changes: 1 addition & 1 deletion syncthingmodel/syncthingicons.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ public Q_SLOTS:
private:
explicit IconManager(const QPalette *palette = nullptr);

QPalette m_palette;
StatusIcons m_statusIcons;
StatusIcons m_trayIcons;
QtForkAwesome::Renderer m_forkAwesomeRenderer;
ForkAwesomeIcons m_commonForkAwesomeIcons;
QPalette m_palette;
std::optional<StatusIconSettings> m_paletteBasedSettingsForStatus;
std::optional<StatusIconSettings> m_paletteBasedSettingsForTray;
bool m_distinguishTrayIcons;
Expand Down

0 comments on commit 2e38fd0

Please sign in to comment.