rename variable to themeUseSystem from darkModeUseSystem.
This commit is contained in:
@@ -73,7 +73,7 @@ export class TreoConfigService
|
|||||||
* Checks if theme should be set to dark based on config & system settings
|
* Checks if theme should be set to dark based on config & system settings
|
||||||
*/
|
*/
|
||||||
private determineTheme(config:AppConfig): string {
|
private determineTheme(config:AppConfig): string {
|
||||||
return (config.darkModeUseSystem && this.systemPrefersDark) ? "dark" : config.theme;
|
return (config.themeUseSystem && this.systemPrefersDark) ? "dark" : config.theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export interface AppConfig
|
|||||||
|
|
||||||
temperatureUnit: string;
|
temperatureUnit: string;
|
||||||
|
|
||||||
darkModeUseSystem: boolean;
|
themeUseSystem: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +38,6 @@ export const appConfig: AppConfig = {
|
|||||||
|
|
||||||
temperatureUnit: "celsius",
|
temperatureUnit: "celsius",
|
||||||
|
|
||||||
darkModeUseSystem: true,
|
themeUseSystem: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
<div class="flex flex-col p-8 pb-0 overflow-hidden">
|
<div class="flex flex-col p-8 pb-0 overflow-hidden">
|
||||||
<div class="flex flex-col gt-md:flex-row">
|
<div class="flex flex-col gt-md:flex-row">
|
||||||
<mat-slide-toggle class="mb-2" [(ngModel)]="darkModeUseSystem">Use system settings for dark mode</mat-slide-toggle>
|
<mat-slide-toggle class="mb-2" [(ngModel)]="themeUseSystem">Use system settings for dark mode</mat-slide-toggle>
|
||||||
<p [class.text-hint]="darkModeUseSystem">
|
<p [class.text-hint]="themeUseSystem">
|
||||||
Theme:
|
Theme:
|
||||||
<mat-button-toggle-group class="ml-2" #group="matButtonToggleGroup" [(ngModel)]="theme" [disabled]="darkModeUseSystem">
|
<mat-button-toggle-group class="ml-2" #group="matButtonToggleGroup" [(ngModel)]="theme" [disabled]="themeUseSystem">
|
||||||
<mat-button-toggle value="light" aria-label="Light mode">
|
<mat-button-toggle value="light" aria-label="Light mode">
|
||||||
<mat-icon>light_mode</mat-icon>
|
<mat-icon>light_mode</mat-icon>
|
||||||
</mat-button-toggle>
|
</mat-button-toggle>
|
||||||
|
|||||||
+3
-3
@@ -14,7 +14,7 @@ export class DashboardSettingsComponent implements OnInit {
|
|||||||
dashboardDisplay: string;
|
dashboardDisplay: string;
|
||||||
dashboardSort: string;
|
dashboardSort: string;
|
||||||
temperatureUnit: string;
|
temperatureUnit: string;
|
||||||
darkModeUseSystem: boolean;
|
themeUseSystem: boolean;
|
||||||
theme: string;
|
theme: string;
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
@@ -37,7 +37,7 @@ export class DashboardSettingsComponent implements OnInit {
|
|||||||
this.dashboardDisplay = config.dashboardDisplay;
|
this.dashboardDisplay = config.dashboardDisplay;
|
||||||
this.dashboardSort = config.dashboardSort;
|
this.dashboardSort = config.dashboardSort;
|
||||||
this.temperatureUnit = config.temperatureUnit;
|
this.temperatureUnit = config.temperatureUnit;
|
||||||
this.darkModeUseSystem = config.darkModeUseSystem;
|
this.themeUseSystem = config.themeUseSystem;
|
||||||
this.theme = config.theme;
|
this.theme = config.theme;
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -49,7 +49,7 @@ export class DashboardSettingsComponent implements OnInit {
|
|||||||
dashboardDisplay: this.dashboardDisplay,
|
dashboardDisplay: this.dashboardDisplay,
|
||||||
dashboardSort: this.dashboardSort,
|
dashboardSort: this.dashboardSort,
|
||||||
temperatureUnit: this.temperatureUnit,
|
temperatureUnit: this.temperatureUnit,
|
||||||
darkModeUseSystem: this.darkModeUseSystem,
|
themeUseSystem: this.themeUseSystem,
|
||||||
theme: this.theme
|
theme: this.theme
|
||||||
}
|
}
|
||||||
this._configService.config = newSettings
|
this._configService.config = newSettings
|
||||||
|
|||||||
Reference in New Issue
Block a user