@@ -22,20 +22,6 @@ public class PantheonShell.Appearance : Gtk.Grid {
2222 private const string INTERFACE_SCHEMA = " org.gnome.desktop.interface" ;
2323 private const string STYLESHEET_KEY = " gtk-theme" ;
2424 private const string STYLESHEET_PREFIX = " io.elementary.stylesheet." ;
25- private const string TEXT_SIZE_KEY = " text-scaling-factor" ;
26-
27- private const string DYSLEXIA_KEY = " dyslexia-friendly-support" ;
28- private const string FONT_KEY = " font-name" ;
29- private const string DOCUMENT_FONT_KEY = " document-font-name" ;
30- private const string MONOSPACE_FONT_KEY = " monospace-font-name" ;
31-
32- private const string OD_REG_FONT = " OpenDyslexic Regular 9" ;
33- private const string OD_DOC_FONT = " OpenDyslexic Regular 10" ;
34- private const string OD_MON_FONT = " OpenDyslexicMono Regular 10" ;
35-
36- private const double [] TEXT_SCALE = {0.75 , 1 , 1.25 , 1.5 };
37-
38- private Granite . Widgets . ModeButton text_size_modebutton;
3925
4026 private enum AccentColor {
4127 NO_PREFERENCE ,
@@ -178,48 +164,6 @@ public class PantheonShell.Appearance : Gtk.Grid {
178164 schedule_grid. add (to_label);
179165 schedule_grid. add (to_time);
180166
181- var text_size_label = new Gtk .Label (_(" Text size:" )) {
182- halign = Gtk . Align . END ,
183- margin_top = 24
184- };
185-
186- text_size_modebutton = new Granite .Widgets .ModeButton () {
187- margin_top = 24
188- };
189- text_size_modebutton. append_text (_(" Small" ));
190- text_size_modebutton. append_text (_(" Default" ));
191- text_size_modebutton. append_text (_(" Large" ));
192- text_size_modebutton. append_text (_(" Larger" ));
193-
194- var dyslexia_font_label = new Gtk .Label (_(" Dyslexia-friendly text:" )) {
195- halign = Gtk . Align . END
196- };
197-
198- var dyslexia_font_switch = new Gtk .Switch () {
199- halign = Gtk . Align . START
200- };
201-
202- var dyslexia_font_description_label = new Gtk .Label (
203- _(" Bottom-heavy shapes and increased character spacing can help improve legibility and reading speed." )
204- ) {
205- max_width_chars = 60 ,
206- wrap = true ,
207- xalign = 0
208- };
209- dyslexia_font_description_label. get_style_context (). add_class (Gtk . STYLE_CLASS_DIM_LABEL );
210-
211- /* Rows 0 to 3 are for the dark style UI that gets attached only if we
212- * can connect to the DBus API
213- *
214- * Row 4 and 5 are for accent color UI that gets constructed only if the
215- * current stylesheet is supported (begins with the STYLESHEET_PREFIX)
216- */
217- attach (text_size_label, 0 , 8 );
218- attach (text_size_modebutton, 1 , 8 , 2 );
219- attach (dyslexia_font_label, 0 , 9 );
220- attach (dyslexia_font_switch, 1 , 9 );
221- attach (dyslexia_font_description_label, 1 , 10 , 2 );
222-
223167 Pantheon . AccountsService ? pantheon_act = null ;
224168
225169 string ? user_path = null ;
@@ -412,22 +356,6 @@ public class PantheonShell.Appearance : Gtk.Grid {
412356 attach (accent_grid, 1 , 4 , 2 );
413357 attach (accent_info, 1 , 5 , 2 );
414358 }
415-
416- update_text_size_modebutton (interface_settings);
417-
418- interface_settings. changed. connect (() = > {
419- update_text_size_modebutton (interface_settings);
420- });
421-
422- text_size_modebutton. mode_changed. connect (() = > {
423- set_text_scale (interface_settings, text_size_modebutton. selected);
424- });
425-
426- dyslexia_font_switch. set_active (update_dyslexia_font_switch (interface_settings));
427-
428- dyslexia_font_switch. state_set. connect (() = > {
429- toggle_dyslexia_support (interface_settings, dyslexia_font_switch. get_active () );
430- });
431359 }
432360
433361 private class PrefersAccentColorButton : Gtk .RadioButton {
@@ -474,55 +402,6 @@ public class PantheonShell.Appearance : Gtk.Grid {
474402 }
475403 }
476404
477- private void toggle_dyslexia_support (GLib .Settings interface_settings , bool state ) {
478- if (state == true ) {
479- interface_settings. set_string (FONT_KEY , OD_REG_FONT );
480- interface_settings. set_string (DOCUMENT_FONT_KEY , OD_DOC_FONT );
481- interface_settings. set_string (MONOSPACE_FONT_KEY , OD_MON_FONT );
482- }
483- else {
484- interface_settings. reset (FONT_KEY );
485- interface_settings. reset (DOCUMENT_FONT_KEY );
486- interface_settings. reset (MONOSPACE_FONT_KEY );
487- }
488- }
489-
490- private bool update_dyslexia_font_switch (GLib .Settings interface_settings ) {
491- var interface_font = interface_settings. get_string (FONT_KEY );
492- var document_font = interface_settings. get_string (DOCUMENT_FONT_KEY );
493- var monospace_font = interface_settings. get_string (MONOSPACE_FONT_KEY );
494-
495- if (interface_font == OD_REG_FONT || document_font == OD_DOC_FONT || monospace_font == OD_MON_FONT ) {
496- return true ;
497- }
498-
499- else {
500- return false ;
501- }
502- }
503-
504- private int get_text_scale (GLib .Settings interface_settings ) {
505- double text_scaling_factor = interface_settings. get_double (TEXT_SIZE_KEY );
506-
507- if (text_scaling_factor <= TEXT_SCALE [0 ]) {
508- return 0 ;
509- } else if (text_scaling_factor <= TEXT_SCALE [1 ]) {
510- return 1 ;
511- } else if (text_scaling_factor <= TEXT_SCALE [2 ]) {
512- return 2 ;
513- } else {
514- return 3 ;
515- }
516- }
517-
518- private void set_text_scale (GLib .Settings interface_settings , int option ) {
519- interface_settings. set_double (TEXT_SIZE_KEY , TEXT_SCALE [option]);
520- }
521-
522- private void update_text_size_modebutton (GLib .Settings interface_settings ) {
523- text_size_modebutton. set_active (get_text_scale (interface_settings));
524- }
525-
526405 private static DateTime double_date_time (double dbl ) {
527406 var hours = (int ) dbl;
528407 var minutes = (int ) Math . round ((dbl - hours) * 60 );
0 commit comments