ui: replace deprecated .show()/.hide() with .set_visible()

parent cd0aacf0
...@@ -116,7 +116,7 @@ namespace XimperShellNotificationCenter.Widgets { ...@@ -116,7 +116,7 @@ namespace XimperShellNotificationCenter.Widgets {
int idx = i; int idx = i;
ddc_clients[i].brightness_change.connect ((percent) => { ddc_clients[i].brightness_change.connect ((percent) => {
if (percent < 0) { if (percent < 0) {
row.hide (); row.set_visible (false);
} else { } else {
scl.set_value (percent); scl.set_value (percent);
} }
......
...@@ -50,7 +50,7 @@ namespace XimperShellNotificationCenter.Widgets { ...@@ -50,7 +50,7 @@ namespace XimperShellNotificationCenter.Widgets {
title_widget = new Gtk.Label (title); title_widget = new Gtk.Label (title);
title_widget.set_halign (Gtk.Align.START); title_widget.set_halign (Gtk.Align.START);
title_widget.set_hexpand (true); title_widget.set_hexpand (true);
title_widget.show (); title_widget.set_visible (true);
append (title_widget); append (title_widget);
if (has_clear_all_button) { if (has_clear_all_button) {
...@@ -64,7 +64,7 @@ namespace XimperShellNotificationCenter.Widgets { ...@@ -64,7 +64,7 @@ namespace XimperShellNotificationCenter.Widgets {
}); });
clear_all_button.set_can_focus (false); clear_all_button.set_can_focus (false);
clear_all_button.valign = Gtk.Align.CENTER; clear_all_button.valign = Gtk.Align.CENTER;
clear_all_button.show (); clear_all_button.set_visible (true);
append (clear_all_button); append (clear_all_button);
} }
......
...@@ -232,8 +232,8 @@ namespace XimperShellNotificationCenter.Widgets.Mpris { ...@@ -232,8 +232,8 @@ namespace XimperShellNotificationCenter.Widgets.Mpris {
carousel.reorder (player, 0); carousel.reorder (player, 0);
if (carousel.n_pages > 1) { if (carousel.n_pages > 1) {
button_prev.show (); button_prev.set_visible (true);
button_next.show (); button_next.set_visible (true);
carousel_dots.set_visible (true); carousel_dots.set_visible (true);
// Scroll to the new player // Scroll to the new player
carousel.scroll_to (player, false); carousel.scroll_to (player, false);
...@@ -277,8 +277,8 @@ namespace XimperShellNotificationCenter.Widgets.Mpris { ...@@ -277,8 +277,8 @@ namespace XimperShellNotificationCenter.Widgets.Mpris {
hide (); hide ();
} }
if (children_length <= 1) { if (children_length <= 1) {
button_prev.hide (); button_prev.set_visible (false);
button_next.hide (); button_next.set_visible (false);
carousel_dots.set_visible (false); carousel_dots.set_visible (false);
} }
} }
......
...@@ -377,15 +377,15 @@ namespace XimperShellNotificationCenter.Widgets.Mpris { ...@@ -377,15 +377,15 @@ namespace XimperShellNotificationCenter.Widgets.Mpris {
if (shuffle == null || !shuffle.is_of_type (VariantType.BOOLEAN)) { if (shuffle == null || !shuffle.is_of_type (VariantType.BOOLEAN)) {
button_shuffle.sensitive = false; button_shuffle.sensitive = false;
button_shuffle.get_child ().opacity = 1; button_shuffle.get_child ().opacity = 1;
button_shuffle.hide (); button_shuffle.set_visible (false);
} else { } else {
button_shuffle.sensitive = true; button_shuffle.sensitive = true;
button_shuffle.get_child ().opacity = button_shuffle.get_child ().opacity =
source.media_player.shuffle ? 1 : UNSELECTED_OPACITY; source.media_player.shuffle ? 1 : UNSELECTED_OPACITY;
button_shuffle.show (); button_shuffle.set_visible (true);
} }
} else { } else {
button_shuffle.hide (); button_shuffle.set_visible (false);
} }
} }
...@@ -440,7 +440,7 @@ namespace XimperShellNotificationCenter.Widgets.Mpris { ...@@ -440,7 +440,7 @@ namespace XimperShellNotificationCenter.Widgets.Mpris {
Variant ?repeat = source.get_mpris_player_prop ("LoopStatus"); Variant ?repeat = source.get_mpris_player_prop ("LoopStatus");
if (repeat == null || !repeat.is_of_type (VariantType.STRING)) { if (repeat == null || !repeat.is_of_type (VariantType.STRING)) {
button_repeat.sensitive = false; button_repeat.sensitive = false;
button_repeat.hide (); button_repeat.set_visible (false);
} else { } else {
string icon_name; string icon_name;
double opacity = 1.0; double opacity = 1.0;
...@@ -467,10 +467,10 @@ namespace XimperShellNotificationCenter.Widgets.Mpris { ...@@ -467,10 +467,10 @@ namespace XimperShellNotificationCenter.Widgets.Mpris {
button_repeat.get_child ().opacity = opacity; button_repeat.get_child ().opacity = opacity;
button_repeat.sensitive = true; button_repeat.sensitive = true;
button_repeat.set_icon_name (icon_name); button_repeat.set_icon_name (icon_name);
button_repeat.show (); button_repeat.set_visible (true);
} }
} else { } else {
button_repeat.hide (); button_repeat.set_visible (false);
} }
} }
} }
......
...@@ -204,7 +204,7 @@ namespace XimperShellNotificationCenter { ...@@ -204,7 +204,7 @@ namespace XimperShellNotificationCenter {
} }
foreach (unowned BlankWindow win in blank_windows.data) { foreach (unowned BlankWindow win in blank_windows.data) {
if (win.monitor != ref_monitor) { if (win.monitor != ref_monitor) {
win.show (); win.set_visible (true);
} }
} }
} }
...@@ -214,7 +214,7 @@ namespace XimperShellNotificationCenter { ...@@ -214,7 +214,7 @@ namespace XimperShellNotificationCenter {
return; return;
} }
foreach (unowned BlankWindow win in blank_windows.data) { foreach (unowned BlankWindow win in blank_windows.data) {
win.hide (); win.set_visible (false);
} }
} }
......
...@@ -310,7 +310,7 @@ namespace XimperShellNotificationCenter { ...@@ -310,7 +310,7 @@ namespace XimperShellNotificationCenter {
this.body.set_lines (this.number_of_body_lines); this.body.set_lines (this.number_of_body_lines);
// Reset state // Reset state
body_image.hide (); body_image.set_visible (false);
// Removes all image tags and adds them to an array // Removes all image tags and adds them to an array
if (text.length > 0) { if (text.length > 0) {
...@@ -354,7 +354,7 @@ namespace XimperShellNotificationCenter { ...@@ -354,7 +354,7 @@ namespace XimperShellNotificationCenter {
// https://gitlab.gnome.org/GNOME/gtk/-/issues/7092 // https://gitlab.gnome.org/GNOME/gtk/-/issues/7092
Gtk.LayoutManager layout = new Gtk.CenterLayout (); Gtk.LayoutManager layout = new Gtk.CenterLayout ();
body_image.set_layout_manager (layout); body_image.set_layout_manager (layout);
body_image.show (); body_image.set_visible (true);
} }
} }
} catch (Error e) { } catch (Error e) {
...@@ -506,7 +506,7 @@ namespace XimperShellNotificationCenter { ...@@ -506,7 +506,7 @@ namespace XimperShellNotificationCenter {
private void set_inline_reply () { private void set_inline_reply () {
// Reset state // Reset state
inline_reply_box.hide (); inline_reply_box.set_visible (false);
// Only show inline replies in popup notifications if the compositor // Only show inline replies in popup notifications if the compositor
// supports ON_DEMAND layer shell keyboard interactivity // supports ON_DEMAND layer shell keyboard interactivity
if (!ConfigModel.instance.notification_inline_replies if (!ConfigModel.instance.notification_inline_replies
...@@ -521,7 +521,7 @@ namespace XimperShellNotificationCenter { ...@@ -521,7 +521,7 @@ namespace XimperShellNotificationCenter {
has_inline_reply = true; has_inline_reply = true;
inline_reply_box.show (); inline_reply_box.set_visible (true);
inline_reply_entry.set_placeholder_text ( inline_reply_entry.set_placeholder_text (
param.inline_reply_placeholder ?? "Enter Text"); param.inline_reply_placeholder ?? "Enter Text");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment