Add light/dark mode switch
This commit is contained in:
@@ -166,6 +166,33 @@ void BCMainWindow::initMainWindow()
|
||||
// die Daten des eBikes laden
|
||||
_dataManager.loadXmlBikeData(":/bikeinfo.xml"_L1);
|
||||
_consoleAction->trigger();
|
||||
|
||||
|
||||
// --- STATUSBAR SETUP ---
|
||||
QStatusBar *statBar = statusBar();
|
||||
|
||||
// Optional: Normale Nachricht links
|
||||
statBar->showMessage("Ready");
|
||||
|
||||
// 1. Unseren Switcher erstellen
|
||||
ThemeSwitchButton *themeBtn = new ThemeSwitchButton(this);
|
||||
|
||||
// 2. WICHTIG: Rechts hinzufügen
|
||||
statBar->addPermanentWidget(themeBtn);
|
||||
|
||||
// 3. Signal verbinden: Button klick -> Theme ändern
|
||||
connect(themeBtn, &ThemeSwitchButton::themeChanged, this, [this](bool isDark){
|
||||
if (isDark)
|
||||
{
|
||||
//applyFluentDarkTheme(*qApp); // Funktion von vorhin
|
||||
statusBar()->showMessage("Dark Mode Activated", 3000);
|
||||
}
|
||||
else
|
||||
{
|
||||
//applyFluentLightTheme(*qApp); // Funktion von vorhin
|
||||
statusBar()->showMessage("Light Mode Activated", 3000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user