Skip to content

Commit 957842a

Browse files
committed
initial squiggly with ctrl+h
1 parent 56e4629 commit 957842a

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

data/Application.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ popover button image {
120120
color: @fg_color;
121121
}
122122

123-
123+
/* Obfuscate note */
124+
window.squiggly textview,
125+
window.squiggly editablelabel {
126+
font-family: "Redacted Script";
127+
}
124128

125129
/* Font zooms */
126130
window.antsized textview {font-size: 0.4em;}

data/io.github.ellie_commons.jorts.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
<summary>Default zoom</summary>
66
<description>Default text zoom for new notes (NOT IMPLEMENTED YET)</description>
77
</key>
8+
<key name="squiggly_mode_active" type="b">
9+
<default>false</default>
10+
<summary>Change font to an illegible one</summary>
11+
<description>Whether to hide text (NOT IMPLEMENTED YET)</description>
12+
</key>
813
</schema>
914
</schemalist>

src/Application.vala

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace jorts {
2929
}
3030

3131
public int64 latest_zoom;
32+
private bool squiggly_mode_active = false;
3233

3334
public override void startup () {
3435
base.startup ();
@@ -63,10 +64,12 @@ namespace jorts {
6364
}
6465

6566
static construct {
66-
gsettings = new GLib.Settings (jorts.Constants.app_rdnn);
67+
//gsettings = new GLib.Settings (jorts.Constants.app_rdnn);
6768
}
6869

6970
construct {
71+
//this.squiggly_mode_active = gsettings.get_boolean ("squiggly_mode_active");
72+
7073
var quit_action = new SimpleAction ("quit", null);
7174
set_accels_for_action ("app.quit", {"<Control>q"});
7275
add_action (quit_action);
@@ -116,6 +119,25 @@ namespace jorts {
116119
MainWindow note = (MainWindow)get_active_window ();
117120
note.zoom_in ();
118121
});
122+
var toggle_squiggly = new SimpleAction ("toggle_squiggly", null);
123+
set_accels_for_action ("app.toggle_squiggly", { "<Control>H", null });
124+
add_action (toggle_squiggly);
125+
toggle_squiggly.activate.connect (() => {
126+
if (this.squiggly_mode_active) {
127+
foreach (var window in open_notes) {
128+
window.remove_css_class ("squiggly");
129+
}
130+
this.squiggly_mode_active = false;
131+
}
132+
else {
133+
foreach (var window in open_notes) {
134+
window.add_css_class ("squiggly");
135+
}
136+
this.squiggly_mode_active = true;
137+
}
138+
//this.squiggly_mode_active = gsettings.set_boolean ("squiggly_mode_active", this.squiggly_mode_active);
139+
});
140+
119141

120142
}
121143

@@ -170,6 +192,9 @@ namespace jorts {
170192
}
171193

172194

195+
196+
197+
173198
// the thing that
174199
public void init_all_notes() {
175200
Gee.ArrayList<noteData> loaded_data = jorts.Stash.load_from_stash();

0 commit comments

Comments
 (0)