Skip to content

Commit 2878303

Browse files
authored
Fix dark mode titlebar (#1584)
* Install theme LaF before any window is constructed * Fix dark mode title bar
1 parent ca3999a commit 2878303

14 files changed

Lines changed: 20 additions & 13 deletions

File tree

‎app/src/processing/app/Base.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ static private void createAndShowGUI(String[] args) {
221221
// theme.txt file in the user's sketchbook folder is picked up.
222222
Theme.init();
223223

224+
// Set the look and feel before any window is constructed, so that the
225+
// correct theme look and feel preferences are applied to the UI
226+
FlatLaf laf = "dark".equals(Theme.get("laf.mode")) ?
227+
new FlatDarkLaf() : new FlatLightLaf();
228+
laf.setExtraDefaults(Collections.singletonMap("@accentColor", Theme.get("laf.accent.color")));
229+
FlatLaf.setup(laf);
230+
224231
// Create a location for untitled sketches
225232
setupUntitleSketches();
226233

‎build/shared/lib/theme/Alloys/agpalilik.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #8AB2FF
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Alloys/bondoc.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #BFA2FF
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Alloys/brahin.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #86A100
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Alloys/gancedo.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #E46000
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Alloys/morito.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #EA9EFF
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Alloys/omolon.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #999EA6
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Alloys/tagish.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #ABABAB
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Minerals/antimony.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #72777A
55

66
# global color used in dialog boxes that have text links

‎build/shared/lib/theme/Minerals/bauxite.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Look-and-Feel Entries ##
22

3-
laf.mode = light
3+
laf.mode = dark
44
laf.accent.color = #F8954A
55

66
# global color used in dialog boxes that have text links

0 commit comments

Comments
 (0)