From a7219d1232e5b808c249da82bbf7151570e67c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 11 Oct 2023 15:36:49 -0700 Subject: [PATCH 1/3] Meson: use gnome.post_install to compile schemas (#734) * Meson: use gnome.post_install to compile schemas * Delete meson directory --- meson.build | 2 +- meson/post_install.py | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 meson/post_install.py diff --git a/meson.build b/meson.build index 5af57fe672..cf703340ee 100644 --- a/meson.build +++ b/meson.build @@ -59,4 +59,4 @@ subdir('po/extra') subdir('data') subdir('src') -meson.add_install_script('meson/post_install.py') +gnome.post_install(glib_compile_schemas: true) diff --git a/meson/post_install.py b/meson/post_install.py deleted file mode 100644 index 76ed255bc5..0000000000 --- a/meson/post_install.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 - -import os -import subprocess - -schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') - -if not os.environ.get('DESTDIR'): - print('Compiling gsettings schemas...') - subprocess.call(['glib-compile-schemas', schemadir]) From c9a60a385831a0ffad18e9f1492735fdc193f313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sat, 21 Oct 2023 09:37:29 -0700 Subject: [PATCH 2/3] MainWindow: Put search toolbar in a title stack (#668) * MainWindow: Put search toolbar in a title stack * Set title stack visible child before showing window --------- Co-authored-by: Jeremy Wootten Co-authored-by: Jeremy Paul Wootten --- src/MainWindow.vala | 35 ++++++++++++++++++++++------------ src/Widgets/SearchToolbar.vala | 16 ++++++---------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 786029afac..34622dc090 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -23,7 +23,8 @@ namespace Terminal { private Gtk.Clipboard clipboard; private Gtk.Clipboard primary_selection; private Terminal.Widgets.SearchToolbar search_toolbar; - private Gtk.Revealer search_revealer; + private Gtk.Label title_label; + private Gtk.Stack title_stack; private Gtk.ToggleButton search_button; private Dialogs.ColorPreferences? color_preferences_dialog; private Granite.AccelLabel open_in_browser_menuitem_label; @@ -237,8 +238,6 @@ namespace Terminal { setup_ui (); show_all (); - search_revealer.set_reveal_child (false); - update_font (); Application.settings_sys.changed["monospace-font-name"].connect (update_font); Application.settings.changed["font"].connect (update_font); @@ -334,22 +333,32 @@ namespace Terminal { valign = Gtk.Align.CENTER }; + search_toolbar = new Terminal.Widgets.SearchToolbar (this); + + title_label = new Gtk.Label (title); + title_label.get_style_context ().add_class (Gtk.STYLE_CLASS_TITLE); + + title_stack = new Gtk.Stack () { + transition_type = Gtk.StackTransitionType.SLIDE_UP_DOWN + }; + title_stack.add (title_label); + title_stack.add (search_toolbar); + // Must show children before visible_child can be set + title_stack.show_all (); + // We set visible child here to avoid transition being visible on startup. + title_stack.visible_child = title_label; + var header = new Hdy.HeaderBar () { show_close_button = true, has_subtitle = false }; header.pack_end (menu_button); header.pack_end (search_button); + header.set_custom_title (title_stack); unowned Gtk.StyleContext header_context = header.get_style_context (); header_context.add_class ("default-decoration"); - search_toolbar = new Terminal.Widgets.SearchToolbar (this); - - search_revealer = new Gtk.Revealer (); - search_revealer.set_transition_type (Gtk.RevealerTransitionType.SLIDE_DOWN); - search_revealer.add (search_toolbar); - get_simple_action (ACTION_COPY).set_enabled (false); get_simple_action (ACTION_COPY_LAST_OUTPUT).set_enabled (false); get_simple_action (ACTION_SCROLL_TO_LAST_COMMAND).set_enabled (false); @@ -382,12 +391,13 @@ namespace Terminal { var grid = new Gtk.Grid (); grid.attach (header, 0, 0); - grid.attach (search_revealer, 0, 1); - grid.attach (notebook, 0, 2); + grid.attach (notebook, 0, 1); get_style_context ().add_class ("terminal-window"); add (grid); + bind_property ("title", title_label, "label"); + unowned var menu_popover = (SettingsPopover) menu_button.popover; menu_popover.show_theme_editor.connect (() => { @@ -1226,9 +1236,9 @@ namespace Terminal { var search_state = search_action.get_state ().get_boolean (); search_action.set_state (!search_state); - search_revealer.set_reveal_child (search_button.active); if (search_button.active) { + title_stack.visible_child = search_toolbar; action_accelerators[ACTION_SEARCH_NEXT] = "g"; action_accelerators[ACTION_SEARCH_NEXT] = "Down"; action_accelerators[ACTION_SEARCH_PREVIOUS] = "g"; @@ -1239,6 +1249,7 @@ namespace Terminal { ); search_toolbar.grab_focus (); } else { + title_stack.visible_child = title_label; action_accelerators.remove_all (ACTION_SEARCH_NEXT); action_accelerators.remove_all (ACTION_SEARCH_PREVIOUS); search_button.tooltip_markup = Granite.markup_accel_tooltip ( diff --git a/src/Widgets/SearchToolbar.vala b/src/Widgets/SearchToolbar.vala index 5c98ba4422..06f0f2861e 100644 --- a/src/Widgets/SearchToolbar.vala +++ b/src/Widgets/SearchToolbar.vala @@ -19,7 +19,7 @@ namespace Terminal.Widgets { - public class SearchToolbar : Gtk.Grid { + public class SearchToolbar : Gtk.Box { private Gtk.ToggleButton cycle_button; private uint last_search_term_length = 0; @@ -57,16 +57,12 @@ namespace Terminal.Widgets { cycle_button.set_can_focus (false); cycle_button.tooltip_text = _("Cyclic search"); - var search_grid = new Gtk.Grid (); - search_grid.margin = 3; - search_grid.get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED); - search_grid.add (search_entry); - search_grid.add (next_button); - search_grid.add (previous_button); - search_grid.add (cycle_button); + get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED); + add (search_entry); + add (next_button); + add (previous_button); + add (cycle_button); - add (search_grid); - get_style_context ().add_class ("search-bar"); show_all (); grab_focus.connect (() => { From 94321c058ad4ebf60850874e8d0f6b594cfecb7b Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 26 Oct 2023 19:17:47 +0100 Subject: [PATCH 3/3] Expose audible-bell setting in Settings Menu (#740) --- src/Widgets/SettingsPopover.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Widgets/SettingsPopover.vala b/src/Widgets/SettingsPopover.vala index 032db183e5..be73ab82cb 100644 --- a/src/Widgets/SettingsPopover.vala +++ b/src/Widgets/SettingsPopover.vala @@ -113,6 +113,11 @@ public sealed class Terminal.SettingsPopover : Gtk.Popover { active = Application.settings.get_boolean ("natural-copy-paste") }; + var audible_bell_button = new Granite.SwitchModelButton (_("Event Alerts")) { + description = _("Notify for invalid input or multiple possible completions (subject to System Settings → Sound)"), + active = Application.settings.get_boolean ("audible-bell") + }; + var box = new Gtk.Box (VERTICAL, 6) { margin_bottom = 6, margin_top = 12, @@ -123,6 +128,7 @@ public sealed class Terminal.SettingsPopover : Gtk.Popover { box.add (theme_box); box.add (new Gtk.Separator (HORIZONTAL)); box.add (natural_copy_paste_button); + box.add (audible_bell_button); child = box; custom_button.clicked.connect (() => { @@ -139,6 +145,7 @@ public sealed class Terminal.SettingsPopover : Gtk.Popover { Application.settings.bind ("follow-system-style", follow_system_button, "active", DEFAULT); Application.settings.bind ("natural-copy-paste", natural_copy_paste_button, "active", DEFAULT); + Application.settings.bind ("audible-bell", audible_bell_button, "active", DEFAULT); Application.settings.changed.connect ((s, n) => { if (n == "background" || n == "foreground") {