-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
titlebar changes #1080
base: main
Are you sure you want to change the base?
titlebar changes #1080
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,40 @@ | |
|
||
import { applyTheme } from '../renderer/themes.js'; | ||
import { translatePage } from '../renderer/i18n-translator.js'; | ||
|
||
import { nativeTheme } from 'electron'; // Import nativeTheme from Electron | ||
// Global values for preferences page | ||
let usersStyles; | ||
let preferences; | ||
|
||
function applySystemTheme() { | ||
// Check system preference for dark mode and set the theme accordingly | ||
const systemTheme = nativeTheme.shouldUseDarkColors ? 'dark' : 'light'; | ||
preferences['theme'] = systemTheme; | ||
applyTheme(systemTheme); | ||
} | ||
|
||
function renderPreferencesWindow() { | ||
const theme = 'theme'; | ||
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's already a |
||
|
||
// Apply system theme initially | ||
applySystemTheme(); | ||
|
||
// Set theme dropdown to selected theme from usersStyles or system preferences | ||
if (theme in usersStyles) { | ||
$('#' + theme).val(usersStyles[theme]); | ||
} | ||
|
||
$('#theme').on('change', function() { | ||
changeValue('theme', this.value); | ||
applyTheme(this.value); | ||
}); | ||
|
||
// Continue with other preference setups... | ||
Comment on lines
+32
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
} | ||
|
||
// Listen for theme changes in real-time | ||
nativeTheme.on('updated', applySystemTheme); | ||
|
||
Comment on lines
+35
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be within the end of this file, on |
||
function populateLanguages() | ||
{ | ||
const languageOpts = $('#language'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment.