From 34f75844c1e907211005740116a648d98eb2e7cf Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Wed, 10 Jun 2026 00:22:53 +0200 Subject: [PATCH] feat: Save buttons in header bar, remove Close button, center section icons (v2.03.13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HeaderBar replaces bottom button row — Save and Save & Restart appear in the title bar on the right, X button closes. Section header icons vertically centered using SMALL_TOOLBAR size and valign=CENTER. Co-Authored-By: Claude Sonnet 4.6 --- linux/CHANGELOG.md | 9 +++++++++ linux/blitztext/__init__.py | 2 +- linux/blitztext/gtksettings.py | 24 +++++++++++++++++++----- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/linux/CHANGELOG.md b/linux/CHANGELOG.md index d18e04d..edf0af5 100644 --- a/linux/CHANGELOG.md +++ b/linux/CHANGELOG.md @@ -9,6 +9,15 @@ The version is defined in [`blitztext/__init__.py`](blitztext/__init__.py). ## [Unreleased] +## [2.03.13] - 2026-06-10 + +### Changed +- **Settings header bar.** Save and Save & Restart moved from the bottom button + bar into the title bar (GTK HeaderBar). The X button closes without saving. + Bottom button row removed. +- **Section icon alignment.** Icons in section headers are now vertically + centred with the label text (`SMALL_TOOLBAR` size, `valign=CENTER`). + ## [2.03.12] - 2026-06-10 ### Added diff --git a/linux/blitztext/__init__.py b/linux/blitztext/__init__.py index e62f831..216971a 100644 --- a/linux/blitztext/__init__.py +++ b/linux/blitztext/__init__.py @@ -6,4 +6,4 @@ counterpart to the macOS Blitztext menu bar app: it runs natively on the host (not in a container) so it can type into any application via xdotool. """ -__version__ = "2.03.12" +__version__ = "2.03.13" diff --git a/linux/blitztext/gtksettings.py b/linux/blitztext/gtksettings.py index b011cbd..61dbd7d 100644 --- a/linux/blitztext/gtksettings.py +++ b/linux/blitztext/gtksettings.py @@ -307,12 +307,15 @@ def _section_title(parent: Gtk.Box, text: str, margin_top: int = 16, """A small bold uppercase section header, with optional symbolic icon.""" row = Gtk.Box(spacing=5) row.set_margin_top(margin_top); row.set_margin_bottom(3) + row.set_valign(Gtk.Align.CENTER) row.get_style_context().add_class("bt-section") if icon: - img = Gtk.Image.new_from_icon_name(icon, Gtk.IconSize.MENU) + img = Gtk.Image.new_from_icon_name(icon, Gtk.IconSize.SMALL_TOOLBAR) + img.set_valign(Gtk.Align.CENTER) img.get_style_context().add_class("bt-section") row.pack_start(img, False, False, 0) lbl = Gtk.Label(xalign=0.0) + lbl.set_valign(Gtk.Align.CENTER) lbl.set_markup(f"{GLib.markup_escape_text(text.upper())}") row.pack_start(lbl, False, False, 0) parent.pack_start(row, False, False, 0) @@ -735,11 +738,21 @@ class SettingsDialog: self._tr_cache: dict = {} self._wf_idx = self._stt_idx = self._llm_idx = 0 - self.dlg = Gtk.Dialog(title="Blitztext — Settings", transient_for=parent, modal=True) + self.dlg = Gtk.Dialog(transient_for=parent, modal=True) self.dlg.set_default_size(740, 700) - self.dlg.add_button("Close", Gtk.ResponseType.CLOSE) - self.dlg.add_button("Save", RESP_SAVE) - self.dlg.add_button("Save & Restart", RESP_SAVE_RESTART) + + _header = Gtk.HeaderBar() + _header.set_show_close_button(True) + _header.set_title("Blitztext — Settings") + _save_restart = Gtk.Button(label="Save & Restart") + _save_restart.get_style_context().add_class("suggested-action") + _save_restart.connect("clicked", lambda _b: self.dlg.response(RESP_SAVE_RESTART)) + _header.pack_end(_save_restart) + _save = Gtk.Button(label="Save") + _save.connect("clicked", lambda _b: self.dlg.response(RESP_SAVE)) + _header.pack_end(_save) + _header.show_all() + self.dlg.set_titlebar(_header) _prov = Gtk.CssProvider() _prov.load_from_data(b""" @@ -2672,6 +2685,7 @@ notebook.bt-nb tab:checked label { self._cleanup() os.execv(sys.executable, [sys.executable, "-m", "blitztext", "tray"]) return + # X button / window close self._cleanup() dlg.destroy()