From 59ae4e0f7d775da63f8e4276bcf161fa75db8c1f Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Sun, 15 Sep 2024 15:57:18 +0100 Subject: [PATCH 1/6] TerminalWidget: Use construct clause --- src/Widgets/TerminalWidget.vala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Widgets/TerminalWidget.vala b/src/Widgets/TerminalWidget.vala index f2f26e6893..2c89eeb232 100644 --- a/src/Widgets/TerminalWidget.vala +++ b/src/Widgets/TerminalWidget.vala @@ -154,13 +154,15 @@ namespace Terminal { public signal void cwd_changed (string cwd); public TerminalWidget (MainWindow parent_window) { - pointer_autohide = true; + Object ( + main_window: parent_window + ); + } + construct { + pointer_autohide = true; terminal_id = "%i".printf (terminal_id_counter++); - init_complete = false; - - main_window = parent_window; child_has_exited = false; killed = false; From 5372d01e152a57798f6a21e01e11969bd25504a6 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Sun, 15 Sep 2024 16:01:34 +0100 Subject: [PATCH 2/6] TerminalView: Only use parameter in creation function --- src/Widgets/TerminalView.vala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Widgets/TerminalView.vala b/src/Widgets/TerminalView.vala index b529a2ed89..a51bb23148 100644 --- a/src/Widgets/TerminalView.vala +++ b/src/Widgets/TerminalView.vala @@ -39,19 +39,20 @@ public class Terminal.TerminalView : Gtk.Box { public TerminalView (MainWindow window) { Object ( main_window: window, - orientation: Gtk.Orientation.VERTICAL, - hexpand: true, - vexpand: true ); } construct { + orientation = Gtk.Orientation.VERTICAL; + hexpand = true; + vexpand = true; + var app_instance = (Gtk.Application) GLib.Application.get_default (); + tab_view = new Hdy.TabView () { hexpand = true, vexpand = true }; - tab_view.menu_model = create_menu_model (); tab_view.setup_menu.connect (tab_view_setup_menu); From cc843dba4924d4295ccfd1d3a7880f1701a45c5a Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Sun, 15 Sep 2024 16:05:01 +0100 Subject: [PATCH 3/6] ColorPreferenceDialog: Only use parameter in creation function --- src/Dialogs/ColorPreferencesDialog.vala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Dialogs/ColorPreferencesDialog.vala b/src/Dialogs/ColorPreferencesDialog.vala index b537200693..a7b5858c8c 100644 --- a/src/Dialogs/ColorPreferencesDialog.vala +++ b/src/Dialogs/ColorPreferencesDialog.vala @@ -39,13 +39,14 @@ public class Terminal.Dialogs.ColorPreferences : Granite.Dialog { public ColorPreferences (Gtk.Window? parent) { Object ( - resizable: false, - title: _("Color Preferences"), transient_for: parent ); } construct { + resizable = false; + title = _("Color Preferences"); + var window_theme_label = settings_label (_("Window style:")); window_theme_label.margin_bottom = 12; From c4cd7d707d38bf89747126c633de17e42c27d146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sun, 15 Sep 2024 08:31:29 -0700 Subject: [PATCH 4/6] Update TerminalView.vala --- src/Widgets/TerminalView.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/TerminalView.vala b/src/Widgets/TerminalView.vala index a51bb23148..16d129e8f4 100644 --- a/src/Widgets/TerminalView.vala +++ b/src/Widgets/TerminalView.vala @@ -38,7 +38,7 @@ public class Terminal.TerminalView : Gtk.Box { public TerminalView (MainWindow window) { Object ( - main_window: window, + main_window: window ); } From 953c1b0c65a571723cea90eaa4cca3bf45da98c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sun, 15 Sep 2024 08:56:04 -0700 Subject: [PATCH 5/6] Update TerminalWidget.vala --- src/Widgets/TerminalWidget.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Widgets/TerminalWidget.vala b/src/Widgets/TerminalWidget.vala index 2c89eeb232..66216f516f 100644 --- a/src/Widgets/TerminalWidget.vala +++ b/src/Widgets/TerminalWidget.vala @@ -35,7 +35,8 @@ namespace Terminal { GLib.Pid child_pid; - public unowned MainWindow main_window; + public unowned MainWindow main_window { get; construct; } + private Terminal.Application app { get { return main_window.app; From 2243f4a9aeeb9c3dffa079476c387dd2f13b5b87 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Mon, 16 Sep 2024 19:16:31 +0100 Subject: [PATCH 6/6] Allow TerminalWidget to change MainWindow --- src/Widgets/TerminalWidget.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/TerminalWidget.vala b/src/Widgets/TerminalWidget.vala index 66216f516f..d101bc30cd 100644 --- a/src/Widgets/TerminalWidget.vala +++ b/src/Widgets/TerminalWidget.vala @@ -35,7 +35,7 @@ namespace Terminal { GLib.Pid child_pid; - public unowned MainWindow main_window { get; construct; } + public unowned MainWindow main_window { get; construct set; } private Terminal.Application app { get {