@@ -33,17 +33,16 @@ public class Dialogs.Settings : Gtk.Dialog {
3333 general_label. margin_start = 6 ;
3434
3535 /*
36- Dark Mode
37- */
38-
36+ Dark Mode
37+
3938 var settings_01_icon = new Gtk.Image ();
4039 settings_01_icon.gicon = new ThemedIcon ("weather-clear-night-symbolic");
4140 settings_01_icon.pixel_size = 16;
4241 settings_01_icon.get_style_context ().add_class ("settings-icon");
4342 settings_01_icon.valign = Gtk.Align.CENTER;
4443
4544 var settings_01_label = new Gtk.Label (_("Dark mode"));
46- // settings_01_label.get_style_context ().add_class ("h3");
45+ settings_01_label.get_style_context ().add_class ("h3");
4746
4847 var settings_01_switch = new Gtk.Switch ();
4948 settings_01_switch.get_style_context ().add_class ("active-switch");
@@ -52,14 +51,70 @@ public class Dialogs.Settings : Gtk.Dialog {
5251 var gtk_settings = Gtk.Settings.get_default ();
5352 settings_01_switch.bind_property ("active", gtk_settings, "gtk_application_prefer_dark_theme");
5453 Byte.settings.bind ("dark-mode", settings_01_switch, "active", GLib.SettingsBindFlags.DEFAULT);
55-
54+
5655 var settings_01_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
5756 settings_01_box.hexpand = true;
5857 settings_01_box.margin = 6;
5958 settings_01_box.pack_start (settings_01_icon, false, false, 0);
6059 settings_01_box.pack_start (settings_01_label, false, false, 6);
6160 settings_01_box.pack_end (settings_01_switch, false, false, 0);
6261
62+ /*
63+ Theme
64+ */
65+
66+ var settings_01_icon = new Gtk .Image ();
67+ settings_01_icon. gicon = new ThemedIcon (" applications-graphics-symbolic" );
68+ settings_01_icon. pixel_size = 16 ;
69+ settings_01_icon. get_style_context (). add_class (" settings-icon" );
70+ settings_01_icon. valign = Gtk . Align . CENTER ;
71+
72+ var settings_01_label = new Gtk .Label (_(" Theme" ));
73+
74+ var theme_01 = new Gtk .RadioButton (null );
75+ theme_01. valign = Gtk . Align . START ;
76+ theme_01. halign = Gtk . Align . START ;
77+ theme_01. tooltip_text = _(" Byte" );
78+ apply_styles (" 01" , " #fe2851" , theme_01);
79+
80+ var theme_02 = new Gtk .RadioButton .from_widget (theme_01);
81+ theme_02. valign = Gtk . Align . START ;
82+ theme_02. halign = Gtk . Align . START ;
83+ theme_02. tooltip_text = _(" Black" );
84+ apply_styles (" 02" , " #333333" , theme_02);
85+
86+ var theme_03 = new Gtk .RadioButton .from_widget (theme_01);
87+ theme_03. valign = Gtk . Align . START ;
88+ theme_03. halign = Gtk . Align . START ;
89+ theme_03. tooltip_text = _(" Turquoise" );
90+ apply_styles (" 04" , " #36E683" , theme_03);
91+
92+ var theme_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 0 );
93+ theme_box. pack_start (theme_01, false , false , 6 );
94+ theme_box. pack_start (theme_02, false , false , 6 );
95+ theme_box. pack_start (theme_03, false , false , 6 );
96+
97+ // I think switch most better here (redian23)
98+ switch (Byte . settings. get_enum (" theme" )) {
99+ case 1 :
100+ theme_01. active = true ;
101+ break ;
102+ case 2 :
103+ theme_02. active = true ;
104+ break ;
105+ case 3 :
106+ theme_03. active = true ;
107+ break ;
108+ }
109+
110+ var settings_01_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 0 );
111+ settings_01_box. hexpand = true ;
112+ settings_01_box. margin = 6 ;
113+ settings_01_box. margin_end = 0 ;
114+ settings_01_box. pack_start (settings_01_icon, false , false , 0 );
115+ settings_01_box. pack_start (settings_01_label, false , false , 6 );
116+ settings_01_box. pack_end (theme_box, false , false , 0 );
117+
63118 /*
64119 Notifications
65120 */
@@ -108,72 +163,6 @@ public class Dialogs.Settings : Gtk.Dialog {
108163 settings_03_box. pack_start (settings_03_label, false , false , 6 );
109164 settings_03_box. pack_end (settings_03_switch, false , false , 0 );
110165
111- /*
112- Theme
113- */
114-
115- var settings_09_icon = new Gtk .Image ();
116- settings_09_icon. gicon = new ThemedIcon (" applications-graphics-symbolic" );
117- settings_09_icon. pixel_size = 16 ;
118- settings_09_icon. get_style_context (). add_class (" settings-icon" );
119- settings_09_icon. valign = Gtk . Align . CENTER ;
120-
121- var settings_09_label = new Gtk .Label (_(" Theme" ));
122-
123- var theme_01 = new Gtk .RadioButton (null );
124- theme_01. valign = Gtk . Align . START ;
125- theme_01. halign = Gtk . Align . START ;
126- theme_01. tooltip_text = _(" Byte" );
127- apply_styles (" 01" , " #fe2851" , theme_01);
128-
129- var theme_02 = new Gtk .RadioButton .from_widget (theme_01);
130- theme_02. valign = Gtk . Align . START ;
131- theme_02. halign = Gtk . Align . START ;
132- theme_02. tooltip_text = _(" Black" );
133- apply_styles (" 02" , " #333333" , theme_02);
134-
135- var theme_03 = new Gtk .RadioButton .from_widget (theme_01);
136- theme_03. valign = Gtk . Align . START ;
137- theme_03. halign = Gtk . Align . START ;
138- theme_03. tooltip_text = _(" Blueberry" );
139- apply_styles (" 03" , " #3689e6" , theme_03);
140-
141- var theme_04 = new Gtk .RadioButton .from_widget (theme_01);
142- theme_04. valign = Gtk . Align . START ;
143- theme_04. halign = Gtk . Align . START ;
144- theme_04. tooltip_text = _(" Turquoise" );
145- apply_styles (" 04" , " #36E683" , theme_04);
146-
147- var theme_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 0 );
148- theme_box. pack_start (theme_01, false , false , 6 );
149- theme_box. pack_start (theme_02, false , false , 6 );
150- theme_box. pack_start (theme_03, false , false , 6 );
151- theme_box. pack_start (theme_04, false , false , 6 );
152-
153- // I think switch most better here (redian23)
154- switch (Byte . settings. get_enum (" theme" )) {
155- case 1 :
156- theme_01. active = true ;
157- break ;
158- case 2 :
159- theme_02. active = true ;
160- break ;
161- case 3 :
162- theme_03. active = true ;
163- break ;
164- case 4 :
165- theme_04. active = true ;
166- break ;
167- }
168-
169- var settings_09_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 0 );
170- settings_09_box. hexpand = true ;
171- settings_09_box. margin = 6 ;
172- settings_09_box. margin_end = 0 ;
173- settings_09_box. pack_start (settings_09_icon, false , false , 0 );
174- settings_09_box. pack_start (settings_09_label, false , false , 6 );
175- settings_09_box. pack_end (theme_box, false , false , 0 );
176-
177166 var general_grid = new Gtk .Grid ();
178167 general_grid. get_style_context (). add_class (" view" );
179168 general_grid. orientation = Gtk . Orientation . VERTICAL ;
@@ -185,8 +174,8 @@ public class Dialogs.Settings : Gtk.Dialog {
185174 general_grid. add (new Gtk .Separator (Gtk . Orientation . HORIZONTAL ));
186175 general_grid. add (settings_03_box);
187176 general_grid. add (new Gtk .Separator (Gtk . Orientation . HORIZONTAL ));
188- general_grid. add (settings_09_box);
189- general_grid. add (new Gtk .Separator (Gtk . Orientation . HORIZONTAL ));
177+ // general_grid.add (settings_09_box);
178+ // general_grid.add (new Gtk.Separator (Gtk.Orientation.HORIZONTAL));
190179
191180 var library_label = new Gtk .Label (_(" Library" ));
192181 library_label. halign = Gtk . Align . START ;
@@ -351,40 +340,6 @@ public class Dialogs.Settings : Gtk.Dialog {
351340 get_action_area (). visible = false ;
352341 get_action_area (). no_show_all = true ;
353342
354- // add_button (_("Close"), Gtk.ResponseType.CLOSE);
355- /*
356- response.connect ((response_id) => {
357- destroy ();
358- });
359- */
360-
361- settings_01_switch. notify[" active" ]. connect (() = > {
362- theme_box. sensitive = ! settings_01_switch. active;
363-
364- var provider = new Gtk .CssProvider ();
365- var colored_css = " " "
366- @define-color colorPrimary %s ;
367- @define-color textColorPrimary %s ;
368- " " " ;
369-
370- if (settings_01_switch. active) {
371- colored_css = colored_css. printf (
372- " @base_color" ,
373- " @text_color"
374- );
375- } else {
376- Byte . utils. apply_theme (Byte . settings. get_enum (" theme" ));
377- }
378-
379- try {
380- provider. load_from_data (colored_css, colored_css. length);
381-
382- Gtk . StyleContext . add_provider_for_screen (Gdk . Screen . get_default (), provider, Gtk . STYLE_PROVIDER_PRIORITY_APPLICATION );
383- } catch (GLib . Error e) {
384- return ;
385- }
386- });
387-
388343 settings_02_switch. notify[" active" ]. connect (() = > {
389344 Byte . settings. set_boolean (" notifications-enabled" , settings_02_switch. active);
390345 });
@@ -463,11 +418,6 @@ public class Dialogs.Settings : Gtk.Dialog {
463418 Byte . settings. set_enum (" theme" , 3 );
464419 Byte . utils. apply_theme (3 );
465420 });
466-
467- theme_04. toggled. connect (() = > {
468- Byte . settings. set_enum (" theme" , 4 );
469- Byte . utils. apply_theme (4 );
470- });
471421 }
472422
473423 private void apply_styles (string id , string color , Gtk .RadioButton radio ) {
0 commit comments