From 79ff22deef93b38e81b04d1a7bdd529b98a38142 Mon Sep 17 00:00:00 2001 From: Lains <4886639+lainsce@users.noreply.github.com> Date: Sat, 21 Jan 2023 10:54:49 -0300 Subject: [PATCH] fix dialog --- lib/Widgets/Dialog.vala | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/Widgets/Dialog.vala b/lib/Widgets/Dialog.vala index d0b4a426..1575c204 100644 --- a/lib/Widgets/Dialog.vala +++ b/lib/Widgets/Dialog.vala @@ -45,7 +45,12 @@ public class He.Dialog : He.Window { return title_label.get_text (); } set { - title_label.set_markup (value); + if (value != null) { + title_label.set_markup (value); + title_label.visible = true; + } else { + title_label.visible = false; + } } } @@ -57,7 +62,12 @@ public class He.Dialog : He.Window { return subtitle_label.get_text (); } set { - subtitle_label.set_markup (value); + if (value != null) { + subtitle_label.set_markup (value); + subtitle_label.visible = true; + } else { + subtitle_label.visible = false; + } } } @@ -69,7 +79,12 @@ public class He.Dialog : He.Window { return info_label.get_text (); } set { - info_label.set_markup (value); + if (value != null) { + info_label.set_markup (value); + info_label.visible = true; + } else { + info_label.visible = false; + } } } @@ -172,18 +187,21 @@ public class He.Dialog : He.Window { title_label.add_css_class ("view-title"); title_label.wrap = true; title_label.wrap_mode = Pango.WrapMode.WORD; + title_label.visible = false; subtitle_label.xalign = 0; subtitle_label.add_css_class ("view-subtitle"); subtitle_label.ellipsize = Pango.EllipsizeMode.END; subtitle_label.wrap = true; subtitle_label.wrap_mode = Pango.WrapMode.WORD; subtitle_label.lines = 2; + subtitle_label.visible = false; info_label.add_css_class ("body"); info_label.xalign = 0; info_label.vexpand = true; info_label.valign = Gtk.Align.START; info_label.wrap = true; info_label.wrap_mode = Pango.WrapMode.WORD; + info_label.visible = false; info_box.append(image); info_box.append(title_label); @@ -210,8 +228,8 @@ public class He.Dialog : He.Window { this.set_child (dialog_handle); this.resizable = false; - this.set_size_request (360, 400); - this.set_default_size (360, 400); + this.set_size_request (360, 360); + this.set_default_size (360, 360); this.has_title = false; } }