mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
pantheon.switchboard-plug-about: 6.1.0 -> 6.2.0
This commit is contained in:
parent
e8103a0119
commit
0e2f5ada7f
@ -1,82 +0,0 @@
|
||||
From cc47fa33893e6840463ef8d59f9f4de4b7563726 Mon Sep 17 00:00:00 2001
|
||||
From: Bobby Rong <rjl931189261@126.com>
|
||||
Date: Sat, 4 Dec 2021 22:00:38 +0800
|
||||
Subject: [PATCH] Add meson option for overlaying logo on wallpaper
|
||||
|
||||
---
|
||||
meson.build | 8 ++++++++
|
||||
meson_options.txt | 1 +
|
||||
src/Views/OperatingSystemView.vala | 8 ++++++++
|
||||
3 files changed, 17 insertions(+)
|
||||
create mode 100644 meson_options.txt
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 2125de6e..cbe3cadd 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -20,6 +20,14 @@ add_project_arguments(
|
||||
vapi_dir = join_paths(meson.current_source_dir(), 'vapi')
|
||||
add_project_arguments(['--vapidir', vapi_dir], language: 'vala')
|
||||
|
||||
+vala_flags = []
|
||||
+
|
||||
+if get_option('wallpaper')
|
||||
+ vala_flags += ['--define', 'WALLPAPER']
|
||||
+endif
|
||||
+
|
||||
+add_project_arguments(vala_flags, language: 'vala')
|
||||
+
|
||||
subdir('data')
|
||||
subdir('src')
|
||||
subdir('po')
|
||||
diff --git a/meson_options.txt b/meson_options.txt
|
||||
new file mode 100644
|
||||
index 00000000..8cef0bb3
|
||||
--- /dev/null
|
||||
+++ b/meson_options.txt
|
||||
@@ -0,0 +1 @@
|
||||
+option('wallpaper', type : 'boolean', value : true, description : 'Overlay logo on default wallpaper')
|
||||
diff --git a/src/Views/OperatingSystemView.vala b/src/Views/OperatingSystemView.vala
|
||||
index fdb92e7e..6110d1aa 100644
|
||||
--- a/src/Views/OperatingSystemView.vala
|
||||
+++ b/src/Views/OperatingSystemView.vala
|
||||
@@ -39,6 +39,7 @@ public class About.OperatingSystemView : Gtk.Grid {
|
||||
logo_icon_name = "distributor-logo";
|
||||
}
|
||||
|
||||
+#if WALLPAPER
|
||||
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",
|
||||
@@ -53,6 +54,7 @@ public class About.OperatingSystemView : Gtk.Grid {
|
||||
}
|
||||
});
|
||||
logo.get_style_context ().add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
+#endif
|
||||
|
||||
var icon = new Gtk.Image () {
|
||||
icon_name = logo_icon_name + "-symbolic",
|
||||
@@ -64,9 +66,11 @@ public class About.OperatingSystemView : Gtk.Grid {
|
||||
icon_style_context.add_class ("logo");
|
||||
icon_style_context.add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
|
||||
+#if WALLPAPER
|
||||
var logo_overlay = new Gtk.Overlay ();
|
||||
logo_overlay.add (logo);
|
||||
logo_overlay.add_overlay (icon);
|
||||
+#endif
|
||||
|
||||
// Intentionally not using GLib.OsInfoKey.PRETTY_NAME here because we
|
||||
// want more granular control over text formatting
|
||||
@@ -145,7 +149,11 @@ public class About.OperatingSystemView : Gtk.Grid {
|
||||
valign = Gtk.Align.CENTER,
|
||||
vexpand = true
|
||||
};
|
||||
+#if WALLPAPER
|
||||
software_grid.attach (logo_overlay, 0, 0, 1, 4);
|
||||
+#else
|
||||
+ software_grid.attach (icon, 0, 0, 1, 4);
|
||||
+#endif
|
||||
software_grid.attach (title, 1, 0, 3);
|
||||
|
||||
software_grid.attach (kernel_version_label, 1, 2, 3);
|
@ -8,32 +8,27 @@
|
||||
, vala
|
||||
, libgee
|
||||
, libgtop
|
||||
, libgudev
|
||||
, libhandy
|
||||
, granite
|
||||
, gtk3
|
||||
, switchboard
|
||||
, udisks2
|
||||
, fwupd
|
||||
, appstream
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "switchboard-plug-about";
|
||||
version = "6.1.0";
|
||||
version = "6.2.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elementary";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-/8K3xSbzlagOT0zHdXNwEERJP88C+H2I6qJHXwdlTS4=";
|
||||
sha256 = "sha256-MJybc2yAchU6qMqkoRz45QdhR7bj/UFk2nyxcBivsHI=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Introduces a wallpaper meson flag.
|
||||
# The wallpapaper path does not exist on NixOS, let's just remove the wallpaper.
|
||||
# https://github.com/elementary/switchboard-plug-about/pull/236
|
||||
./add-wallpaper-option.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
@ -48,12 +43,14 @@ stdenv.mkDerivation rec {
|
||||
gtk3
|
||||
libgee
|
||||
libgtop
|
||||
libgudev
|
||||
libhandy
|
||||
switchboard
|
||||
udisks2
|
||||
];
|
||||
|
||||
mesonFlags = [
|
||||
# This option is introduced in add-wallpaper-option.patch
|
||||
# Does not play nice with the nix-snowflake logo
|
||||
"-Dwallpaper=false"
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user