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

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