mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Fix calendar chart color issue (#4739)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user