From c76300c983a9f1a6ee59519989db2d3d2d0f25ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 1 Feb 2023 11:57:12 -0800 Subject: [PATCH] MultiInfoBar: use add_button (#170) --- src/Widgets/MultiInfoBar.vala | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Widgets/MultiInfoBar.vala b/src/Widgets/MultiInfoBar.vala index 899e33e..e64be17 100644 --- a/src/Widgets/MultiInfoBar.vala +++ b/src/Widgets/MultiInfoBar.vala @@ -20,23 +20,20 @@ */ public class Torrential.Widgets.MultiInfoBar : Gtk.InfoBar { - private Gtk.Label infobar_label = new Gtk.Label (""); private Gee.ArrayQueue infobar_errors = new Gee.ArrayQueue (); private Gtk.Button next_button; construct { - var content = get_content_area (); - content.add (infobar_label); + get_content_area ().add (infobar_label); - var action = get_action_area () as Gtk.ButtonBox; - next_button = new Gtk.Button.with_label (_("Next Warning")); + next_button = (Gtk.Button) add_button (_("Next Warning"), 0); next_button.clicked.connect (() => next_error ()); - var close_button = new Gtk.Button.with_label (_("Close")); + + var close_button = (Gtk.Button) add_button (_("Close"), Gtk.ResponseType.CLOSE); close_button.clicked.connect (() => close_bar ()); - action.add (next_button); - action.add (close_button); - action.show_all (); + + show_all (); } public void add_errors (Gee.ArrayList errors) {