@@ -28,36 +28,36 @@ the innerbox has widgets for settings.
2828the actionbar has a donate me and a set back to defaults just like elementaryOS
2929
3030*/
31- namespace jorts {
32- public class PreferenceWindow : Gtk .Window {
31+ namespace Jorts {
32+ public class PreferenceWindow : Gtk .Window {
3333
34- public const string ACTION_PREFIX = " app." ;
35- public const string ACTION_NEW = " action_new" ;
34+ public const string ACTION_PREFIX = " app." ;
35+ public const string ACTION_NEW = " action_new" ;
3636
3737 public static Gee . MultiMap<string, string> action_accelerators;
3838
39- private const GLib . ActionEntry [] action_entries = {
40- { ACTION_NEW , action_new }
39+ private const GLib . ActionEntry [] ACTION_ENTRIES = {
40+ { ACTION_NEW , action_new }
4141 };
4242
4343 public PreferenceWindow (Gtk .Application app ) {
44- debug(" Showing preference window" );
44+ debug (" Showing preference window" );
4545
4646 Object (application: app);
4747 Intl . setlocale ();
4848
4949 var actions = new SimpleActionGroup ();
50- actions. add_action_entries (action_entries , this );
50+ actions. add_action_entries (ACTION_ENTRIES , this );
5151 insert_action_group (" app" , actions);
5252
5353 var gtk_settings = Gtk . Settings . get_default ();
5454
5555 // Since each sticky note adopts a different accent color
5656 // we have to revert to default when this one is focused
57- this . notify[" is-active" ]. connect(() = > {
57+ this . notify[" is-active" ]. connect (() = > {
5858 if (this . is_active) {
5959 // gtk_settings.gtk_theme_name = Application.system_accent;
60- gtk_settings. gtk_theme_name = " io.elementary.stylesheet." + jorts . Constants . DEFAULT_THEME . ascii_down() ;
60+ gtk_settings. gtk_theme_name = " io.elementary.stylesheet.blueberry " ;
6161 }
6262 });
6363
@@ -68,15 +68,15 @@ namespace jorts {
6868 var titlelabel = new Gtk .Label (_(" Preferences for your Jorts" ));
6969 titlelabel. add_css_class (Granite . STYLE_CLASS_TITLE_LABEL );
7070 set_title (titlelabel. get_text ());
71-
71+
7272 var headerbar = new Gtk .HeaderBar () {
7373 title_widget = titlelabel,
7474 show_title_buttons = true
7575 };
7676
7777 set_titlebar (headerbar);
78- set_size_request (jorts . Constants. DEFAULT_PREF_WIDTH , jorts . Constants. DEFAULT_PREF_HEIGHT );
79- set_default_size (jorts . Constants. DEFAULT_PREF_WIDTH , jorts . Constants. DEFAULT_PREF_HEIGHT );
78+ set_size_request (Jorts . Constants . DEFAULT_PREF_WIDTH , Jorts . Constants . DEFAULT_PREF_HEIGHT );
79+ set_default_size (Jorts . Constants . DEFAULT_PREF_WIDTH , Jorts . Constants . DEFAULT_PREF_HEIGHT );
8080
8181 add_css_class (" dialog" );
8282 add_css_class (Granite . STYLE_CLASS_MESSAGE_DIALOG );
@@ -119,7 +119,7 @@ namespace jorts {
119119
120120 scribbly_box.append (scribbly_label );
121121 scribbly_box.append (scribbly_toggle );
122- settingsbox.append (scribbly_box );
122+ settingsbox.append (scribbly_box );
123123
124124 Application.gsettings.bind (
125125 "scribbly -mode -active ",
@@ -149,7 +149,7 @@ namespace jorts {
149149 settingsbox.append (hidebar_box );
150150
151151 Application.gsettings.bind (
152- "hide -bar ",
152+ "hide -bar ",
153153 hidebar_toggle , "active ",
154154 SettingsBindFlags .DEFAULT );
155155
@@ -158,14 +158,14 @@ namespace jorts {
158158 /* ************************************************/
159159
160160 string desktop_environment = Environment.get_variable ("XDG_CURRENT_DESKTOP ");
161- print (desktop_environment + " detected !");
161+ print (desktop_environment + " detected !");
162162
163163 // Show only in Pantheon because others do not have an autostart panel
164164 if (desktop_environment == "Pantheon ") {
165-
165+
166166 var link = Granite . SettingsUri . PERMISSIONS ;
167167 var linkname = _(" Permissions" ) ;
168-
168+
169169 var permissions_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 6 );
170170 var permissions_link = new Gtk .LinkButton .with_label (
171171 link,
@@ -175,17 +175,17 @@ namespace jorts {
175175 // _("Applications → Permissions")
176176 permissions_link. tooltip_text = link;
177177 permissions_link. halign = Gtk . Align . END ;
178-
178+
179179 var permissions_label = new Granite .HeaderLabel (_(" Allow to start at login" )) {
180180 mnemonic_widget = permissions_link,
181181 secondary_text = _ ("You can set the sticky notes to appear when you log in by adding Jorts to autostart ")
182182 };
183183 permissions_label.set_hexpand (true );
184-
184+
185185 permissions_box.append (permissions_label );
186186 permissions_box.append (permissions_link );
187- settingsbox.append (permissions_box );
188-
187+ settingsbox.append (permissions_box );
188+
189189 // Not Pantheon, not the Windows port. Must be a rando DE
190190 } else {
191191
@@ -197,20 +197,20 @@ namespace jorts {
197197 link,
198198 linkname
199199 );
200-
200+
201201 // _("Applications → Permissions")
202202 permissions_link. tooltip_text = link;
203203 permissions_link. halign = Gtk . Align . END ;
204-
204+
205205 var permissions_label = new Granite .HeaderLabel (_(" Allow to start at login" )) {
206206 mnemonic_widget = permissions_link,
207207 secondary_text = _ ("You can set the sticky notes to appear when you log in by adding Jorts to autostart ")
208208 };
209209 permissions_label.set_hexpand (true );
210-
210+
211211 permissions_box.append (permissions_label );
212212 permissions_box.append (permissions_link );
213- settingsbox.append (permissions_box );
213+ settingsbox.append (permissions_box );
214214
215215 }
216216
@@ -222,26 +222,26 @@ namespace jorts {
222222
223223 // Monies?
224224 var support_button = new Gtk .LinkButton .with_label (
225- jorts . Constants. DONATE_LINK ,
225+ Jorts . Constants . DONATE_LINK ,
226226 _(" Support us!" )
227227 );
228228 actionbar. pack_start (support_button);
229229
230230 // Reset
231- var reset_button = new Gtk .Button ();
232- reset_button. set_label( _(" Reset to Default" ));
231+ var reset_button = new Gtk .Button ();
232+ reset_button. set_label ( _(" Reset to Default" ));
233233 reset_button. tooltip_markup = (_(" Reset all settings to defaults" ));
234234 actionbar. pack_end (reset_button);
235235
236- reset_button. clicked. connect(on_reset);
236+ reset_button. clicked. connect (on_reset);
237237
238238 // var close_button = new Gtk.Button();
239239 // close_button.set_label( _("Close"));
240240 // close_button.clicked.connect(() => {this.close();});
241241 // actionbar.pack_end (close_button);
242242
243243 mainbox. append (settingsbox);
244- mainbox. append(actionbar);
244+ mainbox. append (actionbar);
245245
246246 // Make the whole window grabbable
247247 var handle = new Gtk .WindowHandle () {
@@ -254,17 +254,15 @@ namespace jorts {
254254 }
255255
256256 private void action_new () {
257- ((Application )this . application). create_note(null );
257+ ((Application )this . application). create_note (null );
258258 }
259259
260- private void on_reset() {
261- string [] keys = {" scribbly-mode-active" ," hide-bar" };
260+ private void on_reset () {
261+ string [] keys = {" scribbly-mode-active" , " hide-bar" };
262262 foreach (var key in keys) {
263263 Application . gsettings. reset (key);
264264 }
265265 }
266-
267-
268266 }
269267}
270268
0 commit comments