Skip to content

Commit 93b6e6d

Browse files
committed
theme half repaired
1 parent 0a7c15f commit 93b6e6d

File tree

6 files changed

+135
-104
lines changed

6 files changed

+135
-104
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build/
55
app-dir/
66
obj-x86_64-linux-gnu/
77
repo/
8+
src/Services/no

data/Application.css

Lines changed: 94 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,80 @@
1-
/*
2-
* SPDX-License-Identifier: GPL-3.0
3-
* SPDX-FileCopyrightText: 2025 Stella, whose hairs are shiny and soft. (https://teamcons.carrd.co)
4-
*/
51

62
@define-color textColorPrimary #323232;
3+
@define-color accent_color %s;
4+
@define-color accent_color_strong %s;
75

8-
@define-color MainColor @BLUEBERRY_100;
9-
@define-color SecondaryColor @BLUEBERRY_900;
106

11-
/* TODO : These only exist to colour the "pills" to select theme. This needs a fixing */
12-
.color-strawberry {
13-
background-color: @STRAWBERRY_100;
7+
.mainwindow-%d {
8+
background-color: @accent_color;
9+
transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1);
1410
}
1511

16-
.color-orange {
17-
background-color: @ORANGE_100;
12+
.mainwindow-%d undershoot.top {
13+
background:
14+
linear-gradient(
15+
@accent_color 0%,
16+
alpha(@accent_color, 0) 50%;
17+
);
1818
}
1919

20-
.color-banana {
21-
background-color: @BANANA_100;
20+
.mainwindow-%d undershoot.bottom {
21+
background:
22+
linear-gradient(
23+
alpha(@accent_color, 0) 50%,
24+
@accent_color 100%;
25+
);
2226
}
2327

24-
.color-lime {
25-
background-color: @LIME_100;
26-
}
2728

28-
.color-blueberry {
29-
background-color: @BLUEBERRY_100;
30-
}
3129

32-
.color-grape {
33-
background-color: @GRAPE_100;
30+
.jorts-view text selection {
31+
color: shade(@accent_color, 1.88);
32+
transition: color 800ms cubic-bezier(0.4, 0, 0.2, 1);
33+
background-color: @accent_color_strong;
34+
transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1);
3435
}
3536

36-
.color-cocoa {
37-
background-color: @COCOA_100;
37+
entry.flat {
38+
background: transparent;
3839
}
3940

40-
.color-slate {
41-
background-color: @SLATE_100;
41+
.window-%d .jorts-title image,
42+
.window-%d .jorts-label {
43+
color: @accent_color_strong;
44+
box-shadow: none;
4245
}
4346

44-
.color-silver {
45-
background-color: @SILVER_100;
47+
.window-%d .jorts-bar {
48+
color: @accent_color_strong;
49+
background-color: @accent_color;
50+
border-top-color: @accent_color;
51+
box-shadow: none;
52+
background-image: none;
53+
padding: 3px;
54+
transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1);
4655
}
4756

57+
.window-%d .jorts-bar image {
58+
color: @accent_color_strong;
59+
padding: 3px;
60+
box-shadow: none;
61+
background-image: none;
62+
}
4863

64+
.window-%d .jorts-view,
65+
.window-%d .jorts-view text,
66+
.window-%d .jorts-title {
67+
background-color: @accent_color;
68+
transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1);
69+
background-image: none;
70+
border-bottom-color: @accent_color;
71+
font-weight: 500;
72+
font-size: 1.2em;
73+
color: shade(@accent_color_strong, 0.77);
74+
box-shadow: none;
75+
}
4976

5077

51-
52-
/* These are the colored pills to select theme */
5378
.color-button {
5479
border-radius: 50%;
5580
background-image: none;
@@ -65,77 +90,45 @@
6590
border: 1px solid @inset_dark_color;
6691
}
6792

68-
69-
.window {
70-
background-color: @MainColor;
71-
transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1);
93+
.color-slate {
94+
background-color: @SLATE_100;
7295
}
7396

74-
.window undershoot.top {
75-
background:
76-
linear-gradient(
77-
@MainColor 0%,
78-
alpha(@MainColor, 0) 50%
79-
);
97+
.color-silver {
98+
background-color: @SILVER_100;
8099
}
81100

82-
.window undershoot.bottom {
83-
background:
84-
linear-gradient(
85-
alpha(@MainColor, 0) 50%,
86-
@MainColor 100%
87-
);
101+
.color-strawberry {
102+
background-color: @STRAWBERRY_100;
88103
}
89104

90-
.jorts-view text selection {
91-
color: shade(@MainColor, 1.88);
92-
background-color: @SecondaryColor;
93-
transition: color 800ms cubic-bezier(0.4, 0, 0.2, 1);
94-
transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1);
105+
.color-orange {
106+
background-color: @ORANGE_100;
95107
}
96108

97-
entry.flat {
98-
background: transparent;
109+
.color-banana {
110+
background-color: @BANANA_100;
99111
}
100112

101-
.window .jorts-title image,
102-
.window .jorts-label {
103-
color: @SecondaryColor;
104-
box-shadow: none;
113+
.color-lime {
114+
background-color: @LIME_100;
105115
}
106116

107-
.window .jorts-bar {
108-
color: @SecondaryColor;
109-
background-color: @MainColor;
110-
border-top-color: @SecondaryColor;
111-
box-shadow: none;
112-
background-image: none;
113-
padding: 3px;
114-
transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1);
115-
transition: color 800ms cubic-bezier(0.4, 0, 0.2, 1);
117+
.color-blueberry {
118+
background-color: @BLUEBERRY_100;
116119
}
117120

118-
.window .jorts-bar image {
119-
color: @SecondaryColor;
120-
padding: 3px;
121-
box-shadow: none;
122-
background-image: none;
121+
.color-grape {
122+
background-color: @GRAPE_100;
123123
}
124124

125-
.window .jorts-view,
126-
.window .jorts-view text,
127-
.window .jorts-title {
128-
background-color: @MainColor;
129-
background-image: none;
130-
border-bottom-color: @SecondaryColor;
131-
font-weight: 500;
132-
font-size: 1.2em;
133-
color: shade(@SecondaryColor, 0.77);
134-
box-shadow: none;
125+
.color-cocoa {
126+
background-color: @COCOA_100;
135127
}
136128

137-
138-
129+
.jorts-bar box {
130+
border: none;
131+
}
139132

140133
.image-button,
141134
.titlebutton {
@@ -157,17 +150,27 @@ entry.flat {
157150
}
158151

159152

160-
/* This is the EditableLabel */
161153
.jorts-label {
162-
font-weight: 700;
163-
font-size: 0.88em;
154+
font-weight: 700;
155+
font-size: 0.88em;
164156
}
165-
166157
.jorts-label:backdrop {
167-
color: mix (@textColorPrimary, @SecondaryColor, 0.3);
168-
transition: color 800ms cubic-bezier(0.4, 0, 0.2, 1);
158+
color: mix (@textColorPrimary, @accent_color_strong, 0.3);
169159
}
170160

171-
.jorts-bar box {
172-
border: none;
173-
}
161+
.mainwindow-%d overshoot.bottom {
162+
background: linear-gradient(to bottom, alpha(@accent_color, 0) 80%, alpha(@accent_color, 0.25) 100%); }
163+
164+
.mainwindow-%d overshoot.top {
165+
background: linear-gradient(to top, alpha(@accent_color, 0) 80%, alpha(@accent_color, 0.25) 100%); }
166+
167+
.mainwindow-%d overshoot.right {
168+
background: linear-gradient(to right, alpha(@accent_color, 0) 80%, alpha(@accent_color, 0.25) 100%); }
169+
170+
.mainwindow-%d overshoot.bottom {
171+
background: linear-gradient(to bottom, alpha(@accent_color, 0) 80%, alpha(@accent_color, 0.25) 100%); }
172+
173+
.mainwindow-%d overshoot.left {
174+
background: linear-gradient(to left, alpha(@accent_color, 0) 80%, alpha(@accent_color, 0.25) 100%); }
175+
176+

src/MainWindow.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ namespace jorts {
5757
public MainWindow (Gtk.Application app, Storage? storage) {
5858
Object (application: app);
5959

60-
print(this.uid.to_string());
61-
6260
var actions = new SimpleActionGroup ();
6361
actions.add_action_entries (action_entries, this);
6462
insert_action_group ("win", actions);
@@ -528,6 +526,8 @@ namespace jorts {
528526
// And then this reconstructs a whole ass theme out of these two
529527
// Either it can be a service, or just all defined in CSS and add/remove css
530528
private void update_theme(string theme) {
529+
print(uid.to_string ());
530+
531531
this.get_style_context().add_class("mainwindow-%d".printf(uid));
532532
this.get_style_context().add_class("window-%d".printf(uid));
533533

src/Services/Stash.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace jorts {
7474
string data_path = "saved_sticky_" + uid + ".json";
7575
debug ("%s".printf(data_path));
7676

77-
var file = File.new_for_path (data_path);
77+
var file = File.new_for_path (data_path);
7878
try {
7979
if (file.query_exists ()) {
8080
file.delete

src/Services/Themer.vala

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ namespace jorts.Themer {
6262
);
6363
}
6464
65-
.jorts-view text selection {
65+
66+
67+
.mainwindow-%d .jorts-view text selection {
6668
color: shade(%s, 1.88);
6769
transition: color 800ms cubic-bezier(0.4, 0, 0.2, 1);
6870
background-color: %s;
@@ -109,9 +111,6 @@ namespace jorts.Themer {
109111
box-shadow: none;
110112
}
111113
112-
.window-%d .rotated > widget > box > image {
113-
-gtk-icon-transform: rotate(90deg);
114-
}
115114
116115
.color-button {
117116
border-radius: 50%;
@@ -186,7 +185,35 @@ namespace jorts.Themer {
186185
border: 1px solid transparent;
187186
box-shadow: none;
188187
}
189-
""")).printf(uid, palette[0], uid, palette[0], palette[0], uid, palette[0], palette[0], palette[0], palette[1], uid, uid, palette[1], uid, palette[1], palette[0], palette[0], uid, palette[1], uid, uid, uid, palette[0], palette[0], palette[1], uid);
188+
189+
190+
.jorts-label {
191+
font-weight: 700;
192+
font-size: 0.88em;
193+
}
194+
.jorts-label:backdrop {
195+
color: mix (@textColorPrimary, %s, 0.3);
196+
}
197+
198+
.window-%d overshoot.top {
199+
background: linear-gradient(to top, alpha(%s, 0) 80%, alpha(%s, 0.25) 100%); }
200+
201+
.window-%d overshoot.bottom {
202+
background: linear-gradient(to bottom, alpha(%s, 0) 80%, alpha(%s, 0.25) 100%); }
203+
204+
""")).printf(uid, palette[0],
205+
uid, palette[0], palette[0],
206+
uid, palette[0], palette[0],
207+
uid, palette[0], palette[1],
208+
uid, uid,
209+
palette[1],
210+
uid, palette[1], palette[0], palette[0],
211+
uid, palette[1],
212+
uid, uid, uid,
213+
palette[0], palette[0], palette[1],
214+
palette[1],
215+
uid,palette[0],palette[0],
216+
uid,palette[0],palette[0]);
190217

191218
return style;
192219
}

src/Widgets/EditableLabel.vala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public class jorts.EditableLabel : Gtk.EventBox {
6363

6464
this.get_style_context().add_class("jorts-label");
6565

66-
string style = null;
67-
var css_provider = new Gtk.CssProvider();
66+
//string style = null;
67+
/* var css_provider = new Gtk.CssProvider();
6868
style = """
6969
.jorts-label {
7070
font-weight: 700;
@@ -78,13 +78,13 @@ public class jorts.EditableLabel : Gtk.EventBox {
7878
css_provider.load_from_data(style, -1);
7979
} catch (GLib.Error e) {
8080
warning ("Failed to parse css style : %s", e.message);
81-
}
81+
} */
8282

83-
Gtk.StyleContext.add_provider_for_screen(
83+
/* Gtk.StyleContext.add_provider_for_screen(
8484
Gdk.Screen.get_default(),
8585
css_provider,
8686
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
87-
);
87+
); */
8888

8989
title = new Gtk.Label (title_name);
9090
title.ellipsize = Pango.EllipsizeMode.END;

0 commit comments

Comments
 (0)