diff --git a/.github/workflows/build-lint.yml b/.github/workflows/build-lint.yml index 457a348..49c7cbf 100644 --- a/.github/workflows/build-lint.yml +++ b/.github/workflows/build-lint.yml @@ -24,7 +24,7 @@ jobs: flatpak remote-add --user --if-not-exists gnome-nightly \ https://nightly.gnome.org/gnome-nightly.flatpakrepo - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build the flatpak package run: | diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index b3dbc1c..638529a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,7 +13,7 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install required packages run: pip install -Iv flake8 yamllint black diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f1ee537..809dd9e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,13 +6,13 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint.git - rev: v1.37.1 + rev: v1.38.0 hooks: - id: yamllint types: - yaml - repo: https://github.com/psf/black - rev: 25.11.0 + rev: 26.3.1 hooks: - id: black name: black diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4091a8b..a32a47c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,16 @@ Length Release Notes .. contents:: Topics +v0.10.2 +====== + +Bugfixes +-------- + +- Add the vertical or horizontal CSS class to the application window [`#59`_]. + +.. _#59: https://github.com/herve4m/length/issues/59 + v0.10.1 ====== diff --git a/build-aux/flatpak/io.github.herve4m.Length.yaml b/build-aux/flatpak/io.github.herve4m.Length.yaml index 768d7a0..b9ba5a2 100644 --- a/build-aux/flatpak/io.github.herve4m.Length.yaml +++ b/build-aux/flatpak/io.github.herve4m.Length.yaml @@ -1,7 +1,7 @@ --- id: io.github.herve4m.Length runtime: org.gnome.Platform -runtime-version: "49" +runtime-version: "50" sdk: org.gnome.Sdk command: length finish-args: @@ -9,16 +9,6 @@ finish-args: - --socket=fallback-x11 - --share=ipc - --device=dri -cleanup: - - /include - - /lib/pkgconfig - - /man - - /share/doc - - /share/gtk-doc - - /share/man - - /share/pkgconfig - - "*.la" - - "*.a" modules: - name: length builddir: true diff --git a/data/io.github.herve4m.Length.metainfo.xml.in.in b/data/io.github.herve4m.Length.metainfo.xml.in.in index 30fac33..704c72f 100644 --- a/data/io.github.herve4m.Length.metainfo.xml.in.in +++ b/data/io.github.herve4m.Length.metainfo.xml.in.in @@ -67,6 +67,12 @@ + + https://github.com/herve4m/length/blob/main/CHANGELOG.rst#v0102 + +

Add the vertical or horizontal CSS class to the application window

+
+
https://github.com/herve4m/length/blob/main/CHANGELOG.rst#v0101 diff --git a/io.github.herve4m.Length.Devel.yaml b/io.github.herve4m.Length.Devel.yaml index 2abca20..a4cd366 100644 --- a/io.github.herve4m.Length.Devel.yaml +++ b/io.github.herve4m.Length.Devel.yaml @@ -18,16 +18,6 @@ finish-args: - --socket=fallback-x11 - --share=ipc - --device=dri -cleanup: - - /include - - /lib/pkgconfig - - /man - - /share/doc - - /share/gtk-doc - - /share/man - - /share/pkgconfig - - "*.la" - - "*.a" modules: - name: length builddir: true diff --git a/meson.build b/meson.build index 48be2fc..54333fd 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('length', - version: '0.10.1', + version: '0.10.2', meson_version: '>= 1.1.0', default_options: [ 'warning_level=2', 'werror=false', ], ) diff --git a/src/main.py b/src/main.py index d08b4c2..e0aaa5a 100644 --- a/src/main.py +++ b/src/main.py @@ -1,6 +1,6 @@ # main.py # -# Copyright 2025 Hervé Quatremain +# Copyright 2025, 2026 Hervé Quatremain # # This file is part of Length. # @@ -83,13 +83,11 @@ def do_command_line(self, command_line) -> int: options = options.end().unpack() if "version" in options: - print( - f"""Length {self.version} -Copyright (C) 2025 Hervé Quatremain + print(f"""Length {self.version} +Copyright (C) 2025, 2026 Hervé Quatremain License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law.""" - ) +There is NO WARRANTY, to the extent permitted by law.""") return 0 if "debug" in options: logging.basicConfig(level=logging.DEBUG) @@ -143,7 +141,7 @@ def on_about_action(self, *args) -> None: developer_name="Hervé Quatremain", version=self.version, developers=["Hervé Quatremain"], - copyright="© 2025 Hervé Quatremain", + copyright="© 2025, 2026 Hervé Quatremain", issue_url="https://github.com/herve4m/length/issues", license_type=Gtk.License.GPL_3_0, website="https://github.com/herve4m/length", diff --git a/src/orientation.py b/src/orientation.py index 6feebd9..88b75db 100644 --- a/src/orientation.py +++ b/src/orientation.py @@ -1,6 +1,6 @@ # orientation.py # -# Copyright 2025 Hervé Quatremain +# Copyright 2025, 2026 Hervé Quatremain # # This file is part of Length. # @@ -42,6 +42,7 @@ def update_orientation(self) -> None: w, h = self.application_window.get_default_size() self.h_toggle.set_active(w > h) self.v_toggle.set_active(w <= h) + self._set_class(w, h) def rotate(self, w: int = 0, h: int = 0) -> None: if w == 0 or h == 0: @@ -55,6 +56,7 @@ def rotate(self, w: int = 0, h: int = 0) -> None: self.application_window.maximize() self.application_window.unmaximize() self.application_window.present() + self._set_class(h, w) if ( self.application_window.context.track_pointer @@ -68,6 +70,15 @@ def rotate(self, w: int = 0, h: int = 0) -> None: self.application_window.context.track_pos_x, ) + def _set_class(self, w: int, h: int): + """Add the horizontal or vertical CSS class to the application window.""" + if w > h: + self.application_window.remove_css_class("vertical") + self.application_window.add_css_class("horizontal") + else: + self.application_window.remove_css_class("horizontal") + self.application_window.add_css_class("vertical") + @Gtk.Template.Callback() def _orientation_toggled(self, toggle) -> None: w, h = self.application_window.get_default_size()