statistics: switch themes on the mobile version

When changing the theme to a dark theme, also change the
statistics theme. The code is a mess, because it crashes
when setting the theme right at the beginning. Therefore,
there is a "theme has been set" flag. Also, this directly
accesses the ThemeInterface singleton object. I have no
time to fight QML, sorry.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-01-07 17:28:09 +01:00 committed by Dirk Hohndel
parent 1cff14fa7f
commit ba95edc2d2
3 changed files with 22 additions and 2 deletions

View file

@ -49,6 +49,8 @@ signals:
void binner2IndexChanged();
void operation2IndexChanged();
void sortMode1IndexChanged();
private slots:
void themeChanged();
private:
StatsView *view;
ChartListModel *charts;
@ -66,8 +68,8 @@ private:
int operation2Index;
int sortMode1Index;
StatsState::UIState uiState; // Remember UI state so that we can interpret indexes
bool themeInitialized; // setTheme() crashes if called in init()
void updateUi();
};
#endif