F-Chat
@@ -47,7 +47,8 @@
import l from '../chat/localize';
import {GeneralSettings} from './common';
import { getSafeLanguages, updateSupportedLanguages } from './language';
- import log from 'electron-log'; // tslint:disable-line: match-default-export-name
+ import log from 'electron-log';
+ import core from '../chat/core'; // tslint:disable-line: match-default-export-name
const browserWindow = remote.getCurrentWindow();
@@ -378,6 +379,19 @@
openMenu(): void {
remote.Menu.getApplicationMenu()!.popup({});
}
+
+ getThemeClass() {
+ try {
+ return {
+ ['platform-' + this.platform]: true,
+ disableWindowsHighContrast: core.state.generalSettings.risingDisableWindowsHighContrast
+ };
+ } catch (err) {
+ return {
+ ['platform-' + this.platform]: true
+ };
+ }
+ }
}
@@ -451,4 +465,8 @@
}
}
}
+
+ .disableWindowsHighContrast, .disableWindowsHighContrast * {
+ forced-color-adjust: none;
+ }
diff --git a/electron/common.ts b/electron/common.ts
index 336f507..22e75a2 100644
--- a/electron/common.ts
+++ b/electron/common.ts
@@ -28,6 +28,7 @@ export class GeneralSettings {
hwAcceleration = true;
risingCacheExpiryDays = 30;
risingSystemLogLevel: log.LevelOption = 'info';
+ risingDisableWindowsHighContrast = false;
}
//tslint:disable
diff --git a/electron/main.ts b/electron/main.ts
index a9b564a..8d203f2 100644
--- a/electron/main.ts
+++ b/electron/main.ts
@@ -519,6 +519,16 @@ function onReady(): void {
type: <'radio'>'radio'
}
))
+ },
+ {
+ visible: process.platform === 'win32',
+ label: 'Disable Windows high-contrast mode',
+ type: 'checkbox',
+ checked: settings.risingDisableWindowsHighContrast,
+ click: (item: electron.MenuItem) => {
+ settings.risingDisableWindowsHighContrast = item.checked;
+ setGeneralSettings(settings);
+ }
}
]
},
diff --git a/helpers/dialog.ts b/helpers/dialog.ts
index ea05c3f..b7d4c6b 100644
--- a/helpers/dialog.ts
+++ b/helpers/dialog.ts
@@ -4,6 +4,7 @@ export class Dialog {
static confirmDialog(message: string): boolean {
const result = remote.dialog.showMessageBoxSync({
message,
+ title: 'F-Chat Rising',
type: 'question',
buttons: ['Yes', 'No'],
defaultId: 1,
diff --git a/scss/themes/chat/dark.scss b/scss/themes/chat/dark.scss
index cee27f7..1c4eeee 100644
--- a/scss/themes/chat/dark.scss
+++ b/scss/themes/chat/dark.scss
@@ -40,7 +40,3 @@
--#{$varName}: #{$value};
}
}
-
-.disableWindowsHighContrast {
- forced-colors-adjust: none !important;
-}
diff --git a/scss/themes/chat/default.scss b/scss/themes/chat/default.scss
index 74f6595..0cf5681 100644
--- a/scss/themes/chat/default.scss
+++ b/scss/themes/chat/default.scss
@@ -41,11 +41,6 @@
}
}
-.disableWindowsHighContrast {
- forced-colors-adjust: none !important;
-}
-
-
//@import "../../util/accecss";
//
//@include accecss(
diff --git a/scss/themes/chat/light.scss b/scss/themes/chat/light.scss
index 2935e30..97992e0 100644
--- a/scss/themes/chat/light.scss
+++ b/scss/themes/chat/light.scss
@@ -41,6 +41,3 @@
}
}
-.disableWindowsHighContrast {
- forced-colors-adjust: none !important;
-}