From a19982af81764af100da42978eeb84cc1227bbda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sun, 10 Nov 2024 13:46:34 -0800 Subject: [PATCH] MainWindow: center with pantheon protocol (#841) --- .github/workflows/ci.yml | 2 +- README.md | 1 + data/installer.metainfo.xml.in | 12 ++++++++++++ meson.build | 1 + src/MainWindow.vala | 7 ++++++- src/meson.build | 1 + 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db99c7221..8dfa35e59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y desktop-file-utils gettext libadwaita-1-dev libdistinst-dev libgee-0.8-dev libgranite-7-dev libgtk-4-dev libxkbregistry-dev libjson-glib-dev libpwquality-dev meson valac + apt install -y desktop-file-utils gettext libadwaita-1-dev libdistinst-dev libgee-0.8-dev libgranite-7-dev libgtk-4-dev libxkbregistry-dev libjson-glib-dev libpantheon-wayland-1-dev libpwquality-dev meson valac - name: Build and Test env: DESTDIR: out diff --git a/README.md b/README.md index 9d2bb648c..e2c120efb 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ You'll need the following dependencies: - libgee-0.8-dev - libadwaita-1-dev >=1.4.0 - libjson-glib-dev + - libpantheon-wayland-1-dev - libpwquality-dev - libxkbregistry-dev - [distinst](https://github.com/pop-os/distinst/) diff --git a/data/installer.metainfo.xml.in b/data/installer.metainfo.xml.in index 338b2a20f..833cdcef2 100644 --- a/data/installer.metainfo.xml.in +++ b/data/installer.metainfo.xml.in @@ -56,6 +56,18 @@ contact_at_elementary.io + + +

Improvements:

+
    +
  • Updated translations
  • +
+
+ + Installer UI is not centered + +
+

Improvements:

diff --git a/meson.build b/meson.build index eabdac9f7..8aaa0f49d 100644 --- a/meson.build +++ b/meson.build @@ -22,6 +22,7 @@ adw_dep = dependency('libadwaita-1', version: '>=1.4.0') json_glib_dep = dependency('json-glib-1.0') xkbregistry_dep = dependency('xkbregistry') pwquality_dep = dependency('pwquality') +pantheon_wayland_dep = dependency('pantheon-wayland-1') systemd_dep = dependency('systemd') installer_backend = get_option('installer_backend') diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 35660ad81..6dd0bd390 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -22,7 +22,7 @@ public interface UPower : GLib.Object { public abstract bool on_battery { owned get; set; } } -public class Installer.MainWindow : Gtk.ApplicationWindow { +public class Installer.MainWindow : Gtk.ApplicationWindow, PantheonWayland.ExtendedBehavior { // We have to do it step by step because the vala compiler has overflows with big numbers. private const uint64 ONE_GB = 1000 * 1000 * 1000; // Minimum 15 GB @@ -87,6 +87,11 @@ public class Installer.MainWindow : Gtk.ApplicationWindow { return Source.REMOVE; }); + + child.realize.connect (() => { + connect_to_shell (); + make_centered (); + }); } private void load_keyboard_view () { diff --git a/src/meson.build b/src/meson.build index 39df2156f..ae630da68 100644 --- a/src/meson.build +++ b/src/meson.build @@ -60,6 +60,7 @@ gui_dependencies = [ gtk_dep, adw_dep, json_glib_dep, + pantheon_wayland_dep, pwquality_dep, xkbregistry_dep ]