add system light/dark mode override
This commit is contained in:
parent
684b34ea8c
commit
0a51a3a7f0
3 changed files with 28 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { app, BrowserWindow as bw, ipcMain, ShareMenu, shell, screen, dialog } from "electron";
|
import { app, BrowserWindow as bw, ipcMain, ShareMenu, shell, screen, dialog, nativeTheme } from "electron";
|
||||||
import * as windowStateKeeper from "electron-window-state";
|
import * as windowStateKeeper from "electron-window-state";
|
||||||
import * as express from "express";
|
import * as express from "express";
|
||||||
import * as getPort from "get-port";
|
import * as getPort from "get-port";
|
||||||
|
@ -441,6 +441,8 @@ export class BrowserWindow {
|
||||||
this.options.hasShadow = true;
|
this.options.hasShadow = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nativeTheme.themeSource = utils.getStoreValue("visual.overrideDisplayTheme")
|
||||||
|
|
||||||
// Start the webserver for the browser window to load
|
// Start the webserver for the browser window to load
|
||||||
// LocalFiles.DB.init()
|
// LocalFiles.DB.init()
|
||||||
|
@ -1138,6 +1140,11 @@ export class BrowserWindow {
|
||||||
BrowserWindow.win.setBounds({ x, y });
|
BrowserWindow.win.setBounds({ x, y });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Override light, dark
|
||||||
|
ipcMain.on("changeDisplayTheme", (event, theme) => {
|
||||||
|
nativeTheme.themeSource = theme
|
||||||
|
});
|
||||||
|
|
||||||
//Fullscreen
|
//Fullscreen
|
||||||
ipcMain.on("setFullScreen", (_event, flag) => {
|
ipcMain.on("setFullScreen", (_event, flag) => {
|
||||||
BrowserWindow.win.setFullScreen(flag);
|
BrowserWindow.win.setFullScreen(flag);
|
||||||
|
|
|
@ -200,6 +200,7 @@ export class Store {
|
||||||
accentColor: "#fc3c44",
|
accentColor: "#fc3c44",
|
||||||
purplePodcastPlaybackBar: false,
|
purplePodcastPlaybackBar: false,
|
||||||
maxElementScale: -1, // -1 default, anything else is a custom scale
|
maxElementScale: -1, // -1 default, anything else is a custom scale
|
||||||
|
overrideDisplayTheme : "system" // system , dark, light
|
||||||
},
|
},
|
||||||
lyrics: {
|
lyrics: {
|
||||||
enable_mxm: true,
|
enable_mxm: true,
|
||||||
|
|
|
@ -471,6 +471,22 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="md-option-line">
|
||||||
|
<div class="md-option-segment">
|
||||||
|
{{'Display Style'}}
|
||||||
|
</div>
|
||||||
|
<div class="md-option-segment md-option-segment_auto">
|
||||||
|
<label>
|
||||||
|
<select class="md-select"
|
||||||
|
v-model="$root.cfg.visual.overrideDisplayTheme"
|
||||||
|
@change="changeDisplayTheme">
|
||||||
|
<option value="system">System</option>
|
||||||
|
<option value="dark">Dark</option>
|
||||||
|
<option value="light">Light</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="md-option-line">
|
<div class="md-option-line">
|
||||||
<div class="md-option-segment">
|
<div class="md-option-segment">
|
||||||
{{$root.getLz('settings.option.visual.windowBackgroundStyle')}}
|
{{$root.getLz('settings.option.visual.windowBackgroundStyle')}}
|
||||||
|
@ -1442,6 +1458,9 @@
|
||||||
openAppData() {
|
openAppData() {
|
||||||
ipcRenderer.send('open-appdata')
|
ipcRenderer.send('open-appdata')
|
||||||
},
|
},
|
||||||
|
changeDisplayTheme(){
|
||||||
|
ipcRenderer.send('changeDisplayTheme',app.cfg.visual.overrideDisplayTheme)
|
||||||
|
},
|
||||||
getLanguages: function() {
|
getLanguages: function() {
|
||||||
let langs = this.$root.lzListing
|
let langs = this.$root.lzListing
|
||||||
let categories = {
|
let categories = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue