Fix calendar chart color issue (#4739)

This commit is contained in:
Paul Johnson
2025-12-06 10:03:48 +00:00
committed by GitHub
parent 7cdb14ca7a
commit 6b7e7555df
2 changed files with 13 additions and 1 deletions

View File

@@ -161,6 +161,14 @@ CalendarWindow::CalendarWindow(Context *context)
});
}
void
CalendarWindow::showEvent(QShowEvent*)
{
// When the chart is added to the Perspective's QStackedWidget, the Perspective's style sheets
// can conflict with the local calendar palette settings causing the appearance to be lost.
// Therefore re-apply the palette upon showEvent to ensure correct calendar appearance.
PaletteApplier::setPaletteRecursively(this, palette, true);
}
int
CalendarWindow::getDefaultView
@@ -467,7 +475,6 @@ CalendarWindow::configChanged
inactiveText = GCColor::inactiveColor(activeText, 2.5);
}
QPalette palette;
palette.setColor(QPalette::Active, QPalette::Window, activeWindow);
palette.setColor(QPalette::Active, QPalette::WindowText, activeText);
palette.setColor(QPalette::Active, QPalette::Base, activeBase);

View File

@@ -93,10 +93,15 @@ class CalendarWindow : public GcChartWindow
void setSummaryMetrics(const QStringList &summaryMetrics);
void configChanged(qint32);
protected:
void showEvent(QShowEvent*) override;
private:
Context *context;
bool first = true;
QPalette palette;
QComboBox *defaultViewCombo;
QComboBox *firstDayOfWeekCombo;
QSpinBox *startHourSpin;