@@ -4,6 +4,7 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
44 GLib . SimpleAction progressscale_style_action;
55 GLib . SimpleAction component_progressbin_action;
66 GLib . SimpleAction component_extract_colors_action;
7+ GLib . SimpleAction hide_client_icon_collapsed_action;
78 GLib . SimpleAction window_style_action;
89 GLib . SimpleAction client_icon_style_action;
910 GLib . SimpleAction component_cover_fit_action;
@@ -29,10 +30,15 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
2930 } else {
3031 controls_overlay. remove_css_class (" collapsed" );
3132 }
33+ update_client_icon_revealed ();
3234 }
3335 }
3436 }
3537
38+ private void update_client_icon_revealed () {
39+ this . prog. client_icon_revealed = ! settings. hide_client_icon_collapsed || ! this . collapsed;
40+ }
41+
3642 ~Window () {
3743 update_player (null );
3844 debug (" Destroying: %s " , uuid);
@@ -419,6 +425,12 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
419425 this . icon_name = Build . DOMAIN ;
420426 this . title = Build . NAME ;
421427
428+ #if GTK_4_20
429+ // Somehow this worked for a bit but then
430+ // vala realized this is not in the vapi?
431+ // this.gravity = Gtk.WindowGravity.CENTER;
432+ this . set_property (" gravity" , 4 );
433+ #endif
422434 setup_window_size ();
423435 this . height_request = - 1 ;
424436 this . width_request = - 1 ;
@@ -524,6 +536,10 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
524536 component_extract_colors_action. change_state. connect (on_change_component_extract_colors);
525537 this . add_action (component_extract_colors_action);
526538
539+ hide_client_icon_collapsed_action = new GLib .SimpleAction .stateful (" hide-client-icon-collapsed" , null , settings. hide_client_icon_collapsed);
540+ hide_client_icon_collapsed_action. change_state. connect (on_change_hide_client_icon_collapsed);
541+ this . add_action (hide_client_icon_collapsed_action);
542+
527543 meta_dim_action = new GLib .SimpleAction .stateful (" meta-dim" , null , settings. meta_dim);
528544 meta_dim_action. change_state. connect (on_change_meta_dim);
529545 this . add_action (meta_dim_action);
@@ -571,6 +587,7 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
571587 settings. notify[" orientation-horizontal" ]. connect (update_orientation_from_settings);
572588 settings. notify[" component-progressbin" ]. connect (update_progressbin_from_settings);
573589 settings. notify[" component-extract-colors" ]. connect (update_extract_colors_from_settings);
590+ settings. notify[" hide-client-icon-collapsed" ]. connect (update_hide_client_icon_collapsed_from_settings);
574591 settings. notify[" window-style" ]. connect (update_window_from_settings);
575592 settings. notify[" client-icon-style" ]. connect (update_client_icon_style_from_settings);
576593 settings. notify[" component-tonearm" ]. connect (update_component_tonearm_from_settings);
@@ -671,6 +688,7 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
671688 update_progressscale_from_settings ();
672689 update_progressbin_from_settings ();
673690 update_extract_colors_from_settings ();
691+ update_hide_client_icon_collapsed_from_settings ();
674692 update_window_from_settings ();
675693 update_client_icon_style_from_settings ();
676694 update_component_tonearm_from_settings ();
@@ -737,6 +755,11 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
737755 component_extract_colors_action. set_state (this . prog. extract_colors_enabled);
738756 }
739757
758+ private void update_hide_client_icon_collapsed_from_settings () {
759+ update_client_icon_revealed ();
760+ hide_client_icon_collapsed_action. set_state (settings. hide_client_icon_collapsed);
761+ }
762+
740763 private void update_orientation_from_settings () {
741764 this . orientation = settings. orientation_horizontal ? Gtk . Orientation . HORIZONTAL : Gtk . Orientation . VERTICAL ;
742765 toggle_orientation_action. set_state (settings. orientation_horizontal);
@@ -926,6 +949,11 @@ public class Turntable.Views.Window : Adw.ApplicationWindow {
926949 settings. component_extract_colors = value . get_boolean ();
927950 }
928951
952+ private void on_change_hide_client_icon_collapsed (GLib .SimpleAction action , GLib .Variant ? value ) {
953+ if (value == null ) return ;
954+ settings. hide_client_icon_collapsed = value . get_boolean ();
955+ }
956+
929957 private void on_change_window_style (GLib .SimpleAction action , GLib .Variant ? value ) {
930958 if (value == null ) return ;
931959 settings. window_style = value . get_string ();
0 commit comments