Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
2c20a169
Commit
2c20a169
authored
3 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[dome] initialize theme wrt global settings
parent
7d281d73
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivette/src/dome/main/dome.ts
+12
-2
12 additions, 2 deletions
ivette/src/dome/main/dome.ts
ivette/src/renderer/index.js
+0
-4
0 additions, 4 deletions
ivette/src/renderer/index.js
with
12 additions
and
6 deletions
ivette/src/dome/main/dome.ts
+
12
−
2
View file @
2c20a169
...
@@ -199,6 +199,11 @@ function windowSyncSettings(event: IpcMainEvent) {
...
@@ -199,6 +199,11 @@ function windowSyncSettings(event: IpcMainEvent) {
ipcMain
.
on
(
'
dome.ipc.settings.sync
'
,
windowSyncSettings
);
ipcMain
.
on
(
'
dome.ipc.settings.sync
'
,
windowSyncSettings
);
function
applyThemeSettings
(
settings
:
Store
)
{
const
theme
=
settings
[
'
dome-color-theme
'
];
if
(
typeof
(
theme
)
===
'
string
'
)
setNativeTheme
(
theme
);
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// --- Patching Settings
// --- Patching Settings
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
...
@@ -234,8 +239,7 @@ function applyStorageSettings(event: IpcMainEvent, args: Patch[]) {
...
@@ -234,8 +239,7 @@ function applyStorageSettings(event: IpcMainEvent, args: Patch[]) {
function
applyGlobalSettings
(
event
:
IpcMainEvent
,
args
:
Patch
[])
{
function
applyGlobalSettings
(
event
:
IpcMainEvent
,
args
:
Patch
[])
{
const
settings
:
Store
=
obtainGlobalSettings
();
const
settings
:
Store
=
obtainGlobalSettings
();
applyPatches
(
settings
,
args
);
applyPatches
(
settings
,
args
);
const
theme
=
settings
[
'
dome-color-theme
'
];
applyThemeSettings
(
settings
);
if
(
typeof
(
theme
)
===
'
string
'
)
setNativeTheme
(
theme
);
BrowserWindow
.
getAllWindows
().
forEach
((
w
:
BrowserWindow
)
=>
{
BrowserWindow
.
getAllWindows
().
forEach
((
w
:
BrowserWindow
)
=>
{
const
contents
=
w
.
webContents
;
const
contents
=
w
.
webContents
;
if
(
contents
.
id
!==
event
.
sender
.
id
)
{
if
(
contents
.
id
!==
event
.
sender
.
id
)
{
...
@@ -477,6 +481,12 @@ function createPrimaryWindow() {
...
@@ -477,6 +481,12 @@ function createPrimaryWindow() {
const
cwd
=
process
.
cwd
();
const
cwd
=
process
.
cwd
();
const
wdir
=
cwd
===
'
/
'
?
app
.
getPath
(
'
home
'
)
:
cwd
;
const
wdir
=
cwd
===
'
/
'
?
app
.
getPath
(
'
home
'
)
:
cwd
;
const
argv
=
stripElectronArgv
(
process
.
argv
);
const
argv
=
stripElectronArgv
(
process
.
argv
);
// Initialize Theme
const
globals
=
obtainGlobalSettings
();
applyThemeSettings
(
globals
);
// Create Window
createBrowserWindow
({
title
:
appName
},
argv
,
wdir
);
createBrowserWindow
({
title
:
appName
},
argv
,
wdir
);
}
}
...
...
This diff is collapsed.
Click to expand it.
ivette/src/renderer/index.js
+
0
−
4
View file @
2c20a169
...
@@ -40,7 +40,6 @@
...
@@ -40,7 +40,6 @@
// Enable live-editing in React:
// Enable live-editing in React:
import
'
react-hot-loader/patch
'
;
import
'
react-hot-loader/patch
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
ipcRenderer
}
from
'
electron
'
;
import
{
import
{
setApplicationWindow
,
setApplicationWindow
,
setPreferencesWindow
,
setPreferencesWindow
,
...
@@ -59,9 +58,6 @@ import Preferences from './Preferences' ;
...
@@ -59,9 +58,6 @@ import Preferences from './Preferences' ;
// Define the application main components for each window:
// Define the application main components for each window:
setApplicationWindow
(
Application
);
setApplicationWindow
(
Application
);
setPreferencesWindow
(
Preferences
);
setPreferencesWindow
(
Preferences
);
ipcRenderer
.
send
(
'
dome.ipc.settings.window
'
,
[]);
ipcRenderer
.
send
(
'
dome.ipc.settings.global
'
,
[]);
ipcRenderer
.
send
(
'
dome.ipc.settings.storage
'
,
[]);
// Mark the main application reloadable and enable live updates:
// Mark the main application reloadable and enable live updates:
module
.
hot
&&
isApplicationWindow
()
&&
module
.
hot
&&
isApplicationWindow
()
&&
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment