Cleaner no high-contrast mode implementation
This commit is contained in:
parent
1d4ad49faf
commit
0b2aca9cca
|
@ -4,7 +4,7 @@
|
|||
* Fixed ad fields becoming uneditable after an ad is removed
|
||||
* Fixed ads attempting to send after leaving a channel
|
||||
* Linux users now get automatic updates
|
||||
* Added configuration option to opt out from Windows High Contrast setting
|
||||
* Added configuration option to opt out from Windows high-contrast setting (Menu > F-Chat > Rising > Disable high-contrast mode)
|
||||
|
||||
## 1.16.0
|
||||
* Upgraded to Electron 14.x
|
||||
|
|
|
@ -199,13 +199,6 @@
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="risingDisableWindowsHighContrast">
|
||||
<input type="checkbox" id="risingDisableWindowsHighContrast" v-model="risingDisableWindowsHighContrast"/>
|
||||
Disable high-contrast mode (Windows)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-show="selectedTab === '3'">
|
||||
<template v-if="hidden.length">
|
||||
|
@ -275,7 +268,6 @@
|
|||
|
||||
risingShowUnreadOfflineCount!: boolean;
|
||||
risingColorblindMode!: boolean;
|
||||
risingDisableWindowsHighContrast!: boolean;
|
||||
|
||||
|
||||
async load(): Promise<void> {
|
||||
|
@ -313,7 +305,6 @@
|
|||
this.risingShowUnreadOfflineCount = settings.risingShowUnreadOfflineCount;
|
||||
|
||||
this.risingColorblindMode = settings.risingColorblindMode;
|
||||
this.risingDisableWindowsHighContrast = settings.risingDisableWindowsHighContrast;
|
||||
}
|
||||
|
||||
async doImport(): Promise<void> {
|
||||
|
@ -369,7 +360,6 @@
|
|||
risingShowUnreadOfflineCount: this.risingShowUnreadOfflineCount,
|
||||
|
||||
risingColorblindMode: this.risingColorblindMode,
|
||||
risingDisableWindowsHighContrast: this.risingDisableWindowsHighContrast
|
||||
};
|
||||
if(this.notifications) await core.notifications.requestPermission();
|
||||
}
|
||||
|
|
|
@ -54,7 +54,6 @@ export class Settings implements ISettings {
|
|||
|
||||
risingShowUnreadOfflineCount = true;
|
||||
risingColorblindMode = false;
|
||||
risingDisableWindowsHighContrast = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -221,7 +221,6 @@ export namespace Settings {
|
|||
|
||||
readonly risingShowUnreadOfflineCount: boolean;
|
||||
readonly risingColorblindMode: boolean;
|
||||
readonly risingDisableWindowsHighContrast: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -490,7 +490,7 @@
|
|||
return {
|
||||
[`theme-${this.settings.theme}`]: true,
|
||||
colorblindMode: core.state.settings.risingColorblindMode,
|
||||
disableWindowsHighContrast: core.state.settings.risingDisableWindowsHighContrast
|
||||
disableWindowsHighContrast: core.state.generalSettings.risingDisableWindowsHighContrast
|
||||
};
|
||||
} catch(err) {
|
||||
return { [`theme-${this.settings.theme}`]: true };
|
||||
|
@ -729,4 +729,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.disableWindowsHighContrast, .disableWindowsHighContrast * {
|
||||
forced-color-adjust: none;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div style="display: flex;flex-direction:column;height:100%" :class="'platform-' + platform" @auxclick.prevent>
|
||||
<div style="display: flex;flex-direction:column;height:100%" :class="getThemeClass()" @auxclick.prevent>
|
||||
<div v-html="styling"></div>
|
||||
<div style="display:flex;align-items:stretch;border-bottom-width:1px" class="border-bottom" id="window-tabs">
|
||||
<h4 style="padding:2px 0">F-Chat</h4>
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -451,4 +465,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.disableWindowsHighContrast, .disableWindowsHighContrast * {
|
||||
forced-color-adjust: none;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -28,6 +28,7 @@ export class GeneralSettings {
|
|||
hwAcceleration = true;
|
||||
risingCacheExpiryDays = 30;
|
||||
risingSystemLogLevel: log.LevelOption = 'info';
|
||||
risingDisableWindowsHighContrast = false;
|
||||
}
|
||||
|
||||
//tslint:disable
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -40,7 +40,3 @@
|
|||
--#{$varName}: #{$value};
|
||||
}
|
||||
}
|
||||
|
||||
.disableWindowsHighContrast {
|
||||
forced-colors-adjust: none !important;
|
||||
}
|
||||
|
|
|
@ -41,11 +41,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.disableWindowsHighContrast {
|
||||
forced-colors-adjust: none !important;
|
||||
}
|
||||
|
||||
|
||||
//@import "../../util/accecss";
|
||||
//
|
||||
//@include accecss(
|
||||
|
|
|
@ -41,6 +41,3 @@
|
|||
}
|
||||
}
|
||||
|
||||
.disableWindowsHighContrast {
|
||||
forced-colors-adjust: none !important;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue