Skip to content

Commit 8c5ec3b

Browse files
committed
get some redundancies out
1 parent 7778602 commit 8c5ec3b

File tree

4 files changed

+29
-31
lines changed

4 files changed

+29
-31
lines changed

src/Application.vala

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,7 @@ namespace jorts {
5151
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
5252
);
5353

54-
string[] themes = {
55-
"STRAWBERRY",
56-
"ORANGE",
57-
"BANANA",
58-
"LIME",
59-
"BLUEBERRY",
60-
"BUBBLEGUM",
61-
"GRAPE",
62-
"COCOA",
63-
"SILVER",
64-
"SLATE"
65-
};
54+
string[] themes = jorts.Utils.themearray ();
6655

6756
foreach (unowned var theme in themes) {
6857
// Palette color

src/MainWindow.vala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ namespace jorts {
7575
// First sticky is always blue - signature look!
7676
// After that, it is random
7777
//if (uid_counter == 0) {
78-
this.theme = jorts.Utils.random_theme();
78+
var allthemes = jorts.Utils.themearray();
79+
this.theme = allthemes[Random.int_range (0,(allthemes.length - 1))];
7980
//} else {
8081
// this.theme = "BLUEBERRY";
8182
//}

src/Services/Themer.vala

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 Stella
2+
* Copyright (c) 2025 Stella and the Ellie_Commons community
33
*
44
* This program is free software; you can redistribute it and/or
55
* modify it under the terms of the GNU General Public
@@ -54,16 +54,7 @@ namespace jorts.Themer {
5454
}
5555
5656
window.%s .titlebar image,
57-
window.%s .editablelabel {
58-
color: @%s_900;
59-
}
60-
61-
window.%s:backdrop .editablelabel,
62-
window.%s:backdrop .actionbar,
63-
window.%s:backdrop .actionbar image {
64-
color: @%s_500;
65-
}
66-
57+
window.%s .editablelabel,
6758
window.%s .actionbar,
6859
window.%s .actionbar image {
6960
color: @%s_900;
@@ -76,6 +67,16 @@ namespace jorts.Themer {
7667
border-bottom-color: @%s_100;
7768
color: shade(@%s_900, 0.77);
7869
}
70+
71+
72+
window.%s:backdrop .sourceview text,
73+
window.%s:backdrop .editablelabel,
74+
window.%s:backdrop .actionbar,
75+
window.%s:backdrop .actionbar image {
76+
color: @%s_700;
77+
}
78+
79+
7980
"""));
8081

8182
style = style.replace ("%s",theme);

src/Services/Utils.vala

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
namespace jorts.Utils {
2222

23-
/* Get a name, spit an array with colours from standard granite stylesheet */
24-
/* EX: STRAWBERRY --> { "@STRAWBERRY_100" "@STRAWBERRY_900" }*/
23+
// Spits out a cute or funny random title for a new sticky note
2524
public string random_title () {
2625
string[] alltitles = {
2726
_("All my very best friends"),
@@ -37,19 +36,27 @@ namespace jorts.Utils {
3736
_("Hello world!"),
3837
_("New sticky, new me"),
3938
_("Hidden pirate treasure"),
40-
_("To not forget"),
39+
_("To not forget, ever"),
4140
_("Deep deep thoughts"),
4241
_("Dear Diary,"),
4342
_("Hi im a square"),
4443
_("Have a nice day! :)"),
4544
_("My meds schedule"),
46-
_("Household chores"),};
45+
_("Household chores"),
46+
_("Ode to my cat"),
47+
_("My dogs favourite toys"),
48+
_("How cool my birds are"),
49+
_("Suspects in the Last Cookie affair"),
50+
_("Words my parrots know"),
51+
_("Cool and funny compliments to give out"),
52+
_("Ok, listen here,"),
53+
_("My dream Pokemon team")};
4754

4855
return alltitles[Random.int_range (0,(alltitles.length - 1))];
4956
}
5057

51-
52-
public string random_theme () {
58+
// Spits out a random theme for a new note
59+
public string[] themearray () {
5360
string[] allthemes = {
5461
"STRAWBERRY",
5562
"ORANGE",
@@ -61,7 +68,7 @@ namespace jorts.Utils {
6168
"COCOA",
6269
"SILVER",
6370
"SLATE"};
64-
return allthemes[Random.int_range (0,(allthemes.length - 1))];
71+
return allthemes;
6572
}
6673

6774
}

0 commit comments

Comments
 (0)