From 8a7f053f3c35a9da701fdf2d066e5d67a5c6c289 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 28 Oct 2021 23:52:56 +0800 Subject: [PATCH] pantheon.switchboard-plug-about: fix wallpaper path --- .../apps/switchboard-plugs/about/default.nix | 9 +++-- .../about/fix-background-path.patch | 13 +++++++ .../about/remove-logo-background.patch | 36 ------------------- 3 files changed, 19 insertions(+), 39 deletions(-) create mode 100644 pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-background-path.patch delete mode 100644 pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix index c1144dd4ecd6..f196ba970bd6 100644 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix @@ -15,6 +15,7 @@ , switchboard , fwupd , appstream +, nixos-artwork }: stdenv.mkDerivation rec { @@ -53,9 +54,11 @@ stdenv.mkDerivation rec { ]; patches = [ - # The NixOS logo is not centered in the circular background and path - # to the background is hardcoded, we will drop the background. - ./remove-logo-background.patch + # Use NixOS's default wallpaper + (substituteAll { + src = ./fix-background-path.patch; + default_wallpaper = "${nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}"; + }) ]; meta = with lib; { diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-background-path.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-background-path.patch new file mode 100644 index 000000000000..6fea88691331 --- /dev/null +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-background-path.patch @@ -0,0 +1,13 @@ +diff --git a/src/Views/OperatingSystemView.vala b/src/Views/OperatingSystemView.vala +index fdb92e7e..4161538e 100644 +--- a/src/Views/OperatingSystemView.vala ++++ b/src/Views/OperatingSystemView.vala +@@ -47,7 +47,7 @@ public class About.OperatingSystemView : Gtk.Grid { + }; + logo.set_image_load_func ((size) => { + try { +- return new Gdk.Pixbuf.from_file_at_scale ("/usr/share/backgrounds/elementaryos-default", -1, size, true); ++ return new Gdk.Pixbuf.from_file_at_scale ("@default_wallpaper@", -1, size, true); + } catch (Error e) { + critical (e.message); + } diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch deleted file mode 100644 index bc7805a22c47..000000000000 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/src/Views/OperatingSystemView.vala b/src/Views/OperatingSystemView.vala -index fdb92e7..87bb3a4 100644 ---- a/src/Views/OperatingSystemView.vala -+++ b/src/Views/OperatingSystemView.vala -@@ -39,21 +39,6 @@ public class About.OperatingSystemView : Gtk.Grid { - logo_icon_name = "distributor-logo"; - } - -- var logo = new Hdy.Avatar (128, "", false) { -- // In case the wallpaper can't be loaded, we don't want an icon or text -- icon_name = "invalid-icon-name", -- // We need this for the shadow to not get clipped by Gtk.Overlay -- margin = 6 -- }; -- logo.set_image_load_func ((size) => { -- try { -- return new Gdk.Pixbuf.from_file_at_scale ("/usr/share/backgrounds/elementaryos-default", -1, size, true); -- } catch (Error e) { -- critical (e.message); -- } -- }); -- logo.get_style_context ().add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); -- - var icon = new Gtk.Image () { - icon_name = logo_icon_name + "-symbolic", - // 128 minus 3px padding on each side -@@ -65,8 +50,7 @@ public class About.OperatingSystemView : Gtk.Grid { - icon_style_context.add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - - var logo_overlay = new Gtk.Overlay (); -- logo_overlay.add (logo); -- logo_overlay.add_overlay (icon); -+ logo_overlay.add (icon); - - // Intentionally not using GLib.OsInfoKey.PRETTY_NAME here because we - // want more granular control over text formatting