From 484d414cc31cec3315d0e2a5cb0d5ecc04d46d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 9 Nov 2023 10:50:28 -0800 Subject: [PATCH 01/23] WallpaperContainer: Gtk4 prep --- data/plug.css | 2 + src/Widgets/WallpaperContainer.vala | 74 ++++++++++++++--------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/data/plug.css b/data/plug.css index e5b343a48..ae3a263e6 100644 --- a/data/plug.css +++ b/data/plug.css @@ -55,11 +55,13 @@ .wallpaper-container { background-color: transparent; + margin: 1em; } .wallpaper-container .card { border-radius: 1px; border: none; + margin: 0.666em; /* Needs to be separate to position checkbutton */ } .wallpaper-container .card:checked { diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 1c333aa92..2218ca374 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -24,7 +24,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { private const int THUMB_WIDTH = 162; private const int THUMB_HEIGHT = 100; - private Gtk.Grid card_box; + private Gtk.Box card_box; private Gtk.Revealer check_revealer; private Granite.AsyncImage image; @@ -78,41 +78,39 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { scale = style_context.get_scale (); - height_request = THUMB_HEIGHT + 18; - width_request = THUMB_WIDTH + 18; - - image = new Granite.AsyncImage (); - image.halign = Gtk.Align.CENTER; - image.valign = Gtk.Align.CENTER; + image = new Granite.AsyncImage () { + halign = CENTER, + valign = CENTER + }; image.get_style_context ().set_scale (1); // We need an extra grid to not apply a scale == 1 to the "card" style. - card_box = new Gtk.Grid (); - card_box.get_style_context ().add_class ("card"); + card_box = new Gtk.Box (VERTICAL, 0); + card_box.get_style_context ().add_class (Granite.STYLE_CLASS_CARD); card_box.add (image); - card_box.margin = 9; var check_provider = new Gtk.CssProvider (); check_provider.load_from_resource ("/io/elementary/switchboard/plug/pantheon-shell/Check.css"); var check = new Gtk.RadioButton (null) { - halign = Gtk.Align.START, - valign = Gtk.Align.START, + halign = START, + valign = START, can_focus = false }; check.get_style_context ().add_provider (check_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER); - check_revealer = new Gtk.Revealer (); - check_revealer.transition_type = Gtk.RevealerTransitionType.CROSSFADE; - check_revealer.add (check); + check_revealer = new Gtk.Revealer () { + child = check, + transition_type = CROSSFADE + }; - var overlay = new Gtk.Overlay (); - overlay.add (card_box); + var overlay = new Gtk.Overlay () { + child = card_box + }; overlay.add_overlay (check_revealer); - halign = Gtk.Align.CENTER; - valign = Gtk.Align.CENTER; - margin = 6; + halign = CENTER; + valign = CENTER; child = overlay; @@ -183,7 +181,17 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { }); } - private void load_artist_tooltip () { + private async void update_thumb () { + if (thumb_path == null) { + return; + } + + try { + yield image.set_from_file_async (File.new_for_path (thumb_path), THUMB_WIDTH, THUMB_HEIGHT, false); + } catch (Error e) { + warning (e.message); + } + if (uri != null) { string path = ""; GExiv2.Metadata metadata; @@ -197,25 +205,15 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { } if (metadata.has_exif ()) { - var artist_name = metadata.get_tag_string ("Exif.Image.Artist"); - if (artist_name != null) { - set_tooltip_text (_("Artist: %s").printf (artist_name)); + try { + var artist_name = metadata.try_get_tag_string ("Exif.Image.Artist"); + if (artist_name != null) { + tooltip_text = _("Artist: %s").printf (artist_name); + } + } catch (Error e) { + critical ("Unable to set wallpaper artist name: %s", e.message); } } } } - - private async void update_thumb () { - if (thumb_path == null) { - return; - } - - try { - yield image.set_from_file_async (File.new_for_path (thumb_path), THUMB_WIDTH, THUMB_HEIGHT, false); - } catch (Error e) { - warning (e.message); - } - - load_artist_tooltip (); - } } From e4462c29a6320d566811647a46646745751e149f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 09:28:17 -0800 Subject: [PATCH 02/23] Initial GTK 4 build --- .github/workflows/main.yml | 2 +- README.md | 7 +- meson.build | 7 +- set-wallpaper-contract/meson.build | 7 +- src/meson.build | 3 +- vapi/gdesktopenums-3.0.vapi | 119 ----------- vapi/gnome-desktop-3.0.deps | 7 - vapi/gnome-desktop-3.0.vapi | 319 ----------------------------- 8 files changed, 9 insertions(+), 462 deletions(-) delete mode 100644 vapi/gdesktopenums-3.0.vapi delete mode 100644 vapi/gnome-desktop-3.0.deps delete mode 100644 vapi/gnome-desktop-3.0.vapi diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15e660342..969d693d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y libgnome-desktop-3-dev libgranite-dev libgranite-7-dev libgtk-3-dev libgtk-4-dev libswitchboard-2.0-dev libgexiv2-dev meson valac + apt install -y libadwaita-1-dev libgranite-7-dev libgtk-4-dev libswitchboard-3-dev libgexiv2-dev meson valac - name: Build env: DESTDIR: out diff --git a/README.md b/README.md index eacde5634..7575731e1 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,10 @@ You'll need the following dependencies: * gnome-settings-daemon-dev -* libswitchboard-2.0-dev -* libgnome-desktop-3-dev +* libswitchboard-3-dev * libgee-0.8-dev * libgexiv2-dev -* libgtk-3-dev (>= 3.22) * libgtk-4-dev -* libgranite-dev * libgranite-7-dev * meson * valac @@ -27,4 +24,4 @@ Run `meson` to configure the build environment and then `ninja` to build To install, use `ninja install` - sudo ninja install + ninja install diff --git a/meson.build b/meson.build index a8eaa1de1..0230a0d30 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,6 @@ libexecdir = join_paths(prefix, get_option('libexecdir')) add_project_arguments( '-DGETTEXT_PACKAGE="@0@"'.format(gettext_name), - '-DGNOME_DESKTOP_USE_UNSTABLE_API', language: 'c' ) @@ -26,9 +25,9 @@ add_project_arguments( gio_dep = dependency('gio-2.0') glib_dep = dependency('glib-2.0') gobject_dep = dependency('gobject-2.0') -granite_dep = dependency('granite', version: '>=6.0.0') -gtk_dep = dependency('gtk+-3.0', version: '>= 3.22') -hdy_dep = dependency ('libhandy-1') +granite_dep = dependency('granite-7', version: '>=7.4.0') +gtk_dep = dependency('gtk4') +hdy_dep = dependency ('libadwaita-1') posix_dep = meson.get_compiler('vala').find_library('posix') plug_resources = gnome.compile_resources( diff --git a/set-wallpaper-contract/meson.build b/set-wallpaper-contract/meson.build index bfef309c8..284edde48 100644 --- a/set-wallpaper-contract/meson.build +++ b/set-wallpaper-contract/meson.build @@ -28,11 +28,8 @@ executable( glib_dep, gio_dep, gobject_dep, -# granite_dep, -# gtk_dep, - # TODO: Re-use the variables above when the plug itself is ported to GTK 4 - dependency('gtk4'), - dependency('granite-7'), + granite_dep, + gtk_dep, posix_dep, meson.get_compiler('c').find_library('m') ], diff --git a/src/meson.build b/src/meson.build index 640a4e27d..6b3e04054 100644 --- a/src/meson.build +++ b/src/meson.build @@ -13,7 +13,7 @@ plug_files = files( 'Widgets/WallpaperContainer.vala', ) -switchboard_dep = dependency('switchboard-2.0') +switchboard_dep = dependency('switchboard-3') switchboard_plugsdir = switchboard_dep.get_pkgconfig_variable('plugsdir', define_variable: ['libdir', libdir]) configuration = configuration_data() @@ -39,7 +39,6 @@ shared_module( gtk_dep, hdy_dep, dependency('gexiv2'), - dependency('gnome-desktop-3.0'), posix_dep, switchboard_dep ], diff --git a/vapi/gdesktopenums-3.0.vapi b/vapi/gdesktopenums-3.0.vapi deleted file mode 100644 index dda473547..000000000 --- a/vapi/gdesktopenums-3.0.vapi +++ /dev/null @@ -1,119 +0,0 @@ -/* gdesktopenums-3.0.vapi generated by vapigen, do not modify. */ - -[CCode (cprefix = "GDesktop", gir_namespace = "GDesktopEnums", gir_version = "3.0", lower_case_cprefix = "g_desktop_")] -namespace GDesktop { - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_SHADING_", has_type_id = false)] - public enum BackgroundShading { - SOLID, - VERTICAL, - HORIZONTAL - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_STYLE_", has_type_id = false)] - public enum BackgroundStyle { - NONE, - WALLPAPER, - CENTERED, - SCALED, - STRETCHED, - ZOOM, - SPANNED - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_CLOCK_FORMAT_", has_type_id = false)] - public enum ClockFormat { - @24H, - @12H - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_MODE_", has_type_id = false)] - public enum FocusMode { - CLICK, - SLOPPY, - MOUSE - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_NEW_WINDOWS_", has_type_id = false)] - public enum FocusNewWindows { - SMART, - STRICT - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_CARET_TRACKING_MODE_", has_type_id = false)] - public enum MagnifierCaretTrackingMode { - NONE, - CENTERED, - PROPORTIONAL, - PUSH - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_FOCUS_TRACKING_MODE_", has_type_id = false)] - public enum MagnifierFocusTrackingMode { - NONE, - CENTERED, - PROPORTIONAL, - PUSH - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_MOUSE_TRACKING_MODE_", has_type_id = false)] - public enum MagnifierMouseTrackingMode { - NONE, - CENTERED, - PROPORTIONAL, - PUSH - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_SCREEN_POSITION_", has_type_id = false)] - public enum MagnifierScreenPosition { - NONE, - FULL_SCREEN, - TOP_HALF, - BOTTOM_HALF, - LEFT_HALF, - RIGHT_HALF - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_DIRECTION_", has_type_id = false)] - public enum MouseDwellDirection { - LEFT, - RIGHT, - UP, - DOWN - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_MODE_", has_type_id = false)] - public enum MouseDwellMode { - WINDOW, - GESTURE - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_PROXY_MODE_", has_type_id = false)] - public enum ProxyMode { - NONE, - MANUAL, - AUTO - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_SCREENSAVER_MODE_", has_type_id = false)] - public enum ScreensaverMode { - BLANK_ONLY, - RANDOM, - SINGLE - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TITLEBAR_ACTION_", has_type_id = false)] - public enum TitlebarAction { - TOGGLE_SHADE, - TOGGLE_MAXIMIZE, - TOGGLE_MAXIMIZE_HORIZONTALLY, - TOGGLE_MAXIMIZE_VERTICALLY, - MINIMIZE, - NONE, - LOWER, - MENU - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_ICON_SIZE_", has_type_id = false)] - public enum ToolbarIconSize { - SMALL, - LARGE - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_STYLE_", has_type_id = false)] - public enum ToolbarStyle { - BOTH, - BOTH_HORIZ, - ICONS, - TEXT - } - [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_VISUAL_BELL_", has_type_id = false)] - public enum VisualBellType { - FULLSCREEN_FLASH, - FRAME_FLASH - } -} diff --git a/vapi/gnome-desktop-3.0.deps b/vapi/gnome-desktop-3.0.deps deleted file mode 100644 index 32804f83f..000000000 --- a/vapi/gnome-desktop-3.0.deps +++ /dev/null @@ -1,7 +0,0 @@ -atk -cairo -gio-2.0 -gdesktopenums-3.0 -gdk-pixbuf-2.0 -gdk-3.0 -gtk+-3.0 diff --git a/vapi/gnome-desktop-3.0.vapi b/vapi/gnome-desktop-3.0.vapi deleted file mode 100644 index 2ef7b43c6..000000000 --- a/vapi/gnome-desktop-3.0.vapi +++ /dev/null @@ -1,319 +0,0 @@ -/* gnome-desktop-3.0.vapi generated by vapigen, do not modify. */ - -[CCode (cprefix = "Gnome", gir_namespace = "GnomeDesktop", gir_version = "3.0", lower_case_cprefix = "gnome_")] -namespace Gnome { - namespace DesktopThumbnail { - [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] - public static bool has_uri (Gdk.Pixbuf pixbuf, string uri); - [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] - public static bool is_valid (Gdk.Pixbuf pixbuf, string uri, long mtime); - [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] - [Version (deprecated = true, since = "2.22")] - public static string md5 (string uri); - [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] - public static string path_for_uri (string uri, Gnome.DesktopThumbnailSize size); - [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] - public static Gdk.Pixbuf scale_down_pixbuf (Gdk.Pixbuf pixbuf, int dest_width, int dest_height); - } - namespace Languages { - [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_all_languages")] - public static string[] get_all_languages (); - [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_all_locales")] - public static string[] get_all_locales (); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_country_from_code")] - public static string get_country_from_code (string code, string? translation); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_country_from_locale")] - public static string get_country_from_locale (string locale, string? translation); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_input_source_from_locale")] - public static bool get_input_source_from_locale (string locale, out unowned string type, out unowned string id); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_language_from_code")] - public static string get_language_from_code (string code, string? translation); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_language_from_locale")] - public static string get_language_from_locale (string locale, string? translation); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_language_has_translations")] - public static bool language_has_translations (string code); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_normalize_locale")] - public static string normalize_locale (string locale); - [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_parse_locale")] - public static bool parse_locale (string locale, out string language_codep, out string country_codep, out string codesetp, out string modifierp); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-bg.h", type_id = "gnome_bg_get_type ()")] - public class BG : GLib.Object { - [CCode (has_construct_function = false)] - public BG (); - public bool changes_with_time (); - public Gdk.Pixbuf create_frame_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height, int frame_num); - public Cairo.Surface create_surface (Gdk.Window window, int width, int height, bool root); - public Gdk.Pixbuf create_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height); - public void draw (Gdk.Pixbuf dest, Gdk.Screen screen, bool is_root); - public void get_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary); - public bool get_draw_background (); - public unowned string get_filename (); - public bool get_image_size (Gnome.DesktopThumbnailFactory factory, int best_width, int best_height, int width, int height); - public GDesktop.BackgroundStyle get_placement (); - public static Cairo.Surface get_surface_from_root (Gdk.Screen screen); - public bool has_multiple_sizes (); - public bool is_dark (int dest_width, int dest_height); - public void load_from_preferences (GLib.Settings settings); - public void save_to_preferences (GLib.Settings settings); - public void set_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary); - public void set_draw_background (bool draw_background); - public void set_filename (string filename); - public void set_placement (GDesktop.BackgroundStyle placement); - public static void set_surface_as_root (Gdk.Screen screen, Cairo.Surface surface); - public static Gnome.BGCrossfade set_surface_as_root_with_crossfade (Gdk.Screen screen, Cairo.Surface surface); - public signal void changed (); - public signal void transitioned (); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h", type_id = "gnome_bg_crossfade_get_type ()")] - public class BGCrossfade : GLib.Object { - [CCode (has_construct_function = false)] - public BGCrossfade (int width, int height); - public bool is_started (); - public bool set_end_surface (Cairo.Surface surface); - public bool set_start_surface (Cairo.Surface surface); - public void start (Gdk.Window window); - public void stop (); - [NoAccessorMethod] - public int height { get; construct; } - [NoAccessorMethod] - public int width { get; construct; } - public virtual signal void finished (GLib.Object window); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-bg-slide-show.h", type_id = "gnome_bg_slide_show_get_type ()")] - public class BGSlideShow : GLib.Object { - [CCode (has_construct_function = false)] - public BGSlideShow (string filename); - public void get_current_slide (int width, int height, out double progress, out double duration, out bool is_fixed, out unowned string file1, out unowned string file2); - public bool get_has_multiple_sizes (); - public int get_num_slides (); - public bool get_slide (int frame_number, int width, int height, double progress, out double duration, out bool is_fixed, out unowned string file1, out unowned string file2); - public double get_start_time (); - public double get_total_duration (); - public bool load () throws GLib.Error; - public void load_async (GLib.Cancellable? cancellable, GLib.AsyncReadyCallback callback); - [NoAccessorMethod] - public string filename { owned get; construct; } - public bool has_multiple_sizes { get; } - public double start_time { get; } - public double total_duration { get; } - } - [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h", type_id = "gnome_desktop_thumbnail_factory_get_type ()")] - public class DesktopThumbnailFactory : GLib.Object { - [CCode (has_construct_function = false)] - public DesktopThumbnailFactory (Gnome.DesktopThumbnailSize size); - public bool can_thumbnail (string uri, string mime_type, long mtime); - public void create_failed_thumbnail (string uri, long mtime); - public Gdk.Pixbuf generate_thumbnail (string uri, string mime_type); - public bool has_valid_failed_thumbnail (string uri, long mtime); - public string lookup (string uri, long mtime); - public void save_thumbnail (Gdk.Pixbuf thumbnail, string uri, long original_mtime); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-idle-monitor.h", type_id = "gnome_idle_monitor_get_type ()")] - public class IdleMonitor : GLib.Object, GLib.Initable { - [CCode (has_construct_function = false)] - public IdleMonitor (); - public uint add_idle_watch (uint64 interval_msec, owned Gnome.IdleMonitorWatchFunc? callback); - public uint add_user_active_watch (owned Gnome.IdleMonitorWatchFunc? callback); - [CCode (has_construct_function = false)] - public IdleMonitor.for_device (Gdk.Device device) throws GLib.Error; - public uint64 get_idletime (); - public void remove_watch (uint id); - [NoAccessorMethod] - public Gdk.Device device { owned get; construct; } - } - [CCode (cheader_filename = "libgnome-desktop/gnome-pnp-ids.h", type_id = "gnome_pnp_ids_get_type ()")] - public class PnpIds : GLib.Object { - [CCode (has_construct_function = false)] - public PnpIds (); - public string get_pnp_id (string pnp_id); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr-config.h", type_id = "gnome_rr_config_get_type ()")] - public class RRConfig : GLib.Object { - [CCode (has_construct_function = false)] - protected RRConfig (); - public bool applicable (Gnome.RRScreen screen) throws GLib.Error; - public bool apply (Gnome.RRScreen screen) throws GLib.Error; -#if HAS_GNOME312 - public bool apply_persistent (Gnome.RRScreen screen) throws GLib.Error; -#else - public bool save () throws GLib.Error; -#endif - [CCode (has_construct_function = false)] - public RRConfig.current (Gnome.RRScreen screen) throws GLib.Error; - public bool ensure_primary (); - public bool equal (Gnome.RRConfig config2); - public bool get_clone (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned Gnome.RROutputInfo[] get_outputs (); - public bool load_current () throws GLib.Error; - public bool match (Gnome.RRConfig config2); - public void sanitize (); - public void set_clone (bool clone); - public Gnome.RRScreen screen { construct; } - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_crtc_get_type ()")] - [Compact] - public class RRCrtc { - public bool can_drive_output (Gnome.RROutput output); - public Gnome.RRMode get_current_mode (); - public Gnome.RRRotation get_current_rotation (); - public bool get_gamma (int size, ushort red, ushort green, ushort blue); - public uint32 get_id (); - public void get_position (out int x, out int y); - public Gnome.RRRotation get_rotations (); - public bool set_gamma (int size, ushort red, ushort green, ushort blue); - public bool supports_rotation (Gnome.RRRotation rotation); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_mode_get_type ()")] - [Compact] - public class RRMode { - public int get_freq (); - public uint get_height (); - public uint32 get_id (); - public uint get_width (); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_output_get_type ()")] - [Compact] - public class RROutput { - public bool can_clone (Gnome.RROutput clone); - public int get_backlight (); - public Gnome.RRCrtc get_crtc (); - public unowned Gnome.RRMode get_current_mode (); - public unowned string get_display_name (); - public uint8 get_edid_data (size_t size); - public uint32 get_id (); - public void get_ids_from_edid (out string vendor, out string product, out string serial); - public bool get_is_primary (); - public int get_min_backlight_step (); - public unowned string get_name (); - public void get_physical_size (out int width_mm, out int height_mm); - public void get_position (out int x, out int y); - public Gnome.RRCrtc get_possible_crtcs (); - public Gnome.RRMode get_preferred_mode (); - public bool is_builtin_display (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned Gnome.RRMode[] list_modes (); - public bool set_backlight (int value) throws GLib.Error; - public bool supports_mode (Gnome.RRMode mode); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr-config.h", type_id = "gnome_rr_output_info_get_type ()")] - public class RROutputInfo : GLib.Object { - [CCode (has_construct_function = false)] - protected RROutputInfo (); - public double get_aspect_ratio (); - public unowned string get_display_name (); - public void get_geometry (out int x, out int y, out int width, out int height); - public unowned string get_name (); - public int get_preferred_height (); - public int get_preferred_width (); - public bool get_primary (); - public unowned string get_product (); - public int get_refresh_rate (); - public Gnome.RRRotation get_rotation (); - public unowned string get_serial (); - public unowned string get_vendor (); - public bool is_active (); - public bool is_connected (); - public void set_active (bool active); - public void set_geometry (int x, int y, int width, int height); - public void set_primary (bool primary); - public void set_refresh_rate (int rate); - public void set_rotation (Gnome.RRRotation rotation); -#if HAS_GNOME312 - public bool supports_rotation (Gnome.RRRotation rotation); -#endif - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", type_id = "gnome_rr_screen_get_type ()")] - public class RRScreen : GLib.Object, GLib.AsyncInitable, GLib.Initable { - [CCode (has_construct_function = false)] - public RRScreen (Gdk.Screen screen) throws GLib.Error; - public Gnome.RRMode create_clone_modes (); - [CCode (cname = "gnome_rr_screen_new_async", has_construct_function = false)] - public async RRScreen.from_async (Gdk.Screen screen) throws GLib.Error; - public unowned Gnome.RRCrtc get_crtc_by_id (uint32 id); - public bool get_dpms_mode (out Gnome.RRDpmsMode mode) throws GLib.Error; - public unowned Gnome.RROutput get_output_by_id (uint32 id); - public unowned Gnome.RROutput get_output_by_name (string name); - public void get_ranges (out int min_width, out int max_width, out int min_height, out int max_height); - [CCode (array_length = false, array_null_terminated = true)] - public unowned Gnome.RRMode[] list_clone_modes (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned Gnome.RRCrtc[] list_crtcs (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned Gnome.RRMode[] list_modes (); - [CCode (array_length = false, array_null_terminated = true)] - public unowned Gnome.RROutput[] list_outputs (); - public bool refresh () throws GLib.Error; - public bool set_dpms_mode (Gnome.RRDpmsMode mode) throws GLib.Error; - [NoAccessorMethod] - public Gdk.Screen gdk_screen { owned get; construct; } - public virtual signal void changed (); - public virtual signal void output_connected (void* output); - public virtual signal void output_disconnected (void* output); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-wall-clock.h", type_id = "gnome_wall_clock_get_type ()")] - public class WallClock : GLib.Object { - [CCode (has_construct_function = false)] - public WallClock (); - public unowned string get_clock (); - public unowned GLib.TimeZone get_timezone (); - public string clock { get; } - [NoAccessorMethod] - public bool time_only { get; set; } - public GLib.TimeZone timezone { get; } - } - [CCode (cheader_filename = "libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_xkb_info_get_type ()")] - public class XkbInfo : GLib.Object { - [CCode (has_construct_function = false)] - public XkbInfo (); - public unowned string description_for_group (string group_id); - public unowned string description_for_option (string group_id, string id); - public GLib.List get_all_layouts (); - public GLib.List get_all_option_groups (); - public bool get_layout_info (string id, out unowned string display_name, out unowned string short_name, out unowned string xkb_layout, out unowned string xkb_variant); - public GLib.List get_layouts_for_country (string country_code); - public GLib.List get_layouts_for_language (string language_code); - public GLib.List get_options_for_group (string group_id); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h", cprefix = "GNOME_DESKTOP_THUMBNAIL_SIZE_", has_type_id = false)] - public enum DesktopThumbnailSize { - NORMAL, - LARGE - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_DPMS_", has_type_id = false)] - public enum RRDpmsMode { - ON, - STANDBY, - SUSPEND, - OFF, - DISABLED, - UNKNOWN - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_", has_type_id = false)] - [Flags] - public enum RRRotation { - ROTATION_NEXT, - ROTATION_0, - ROTATION_90, - ROTATION_180, - ROTATION_270, - REFLECT_X, - REFLECT_Y - } - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_ERROR_")] - public errordomain RRError { - UNKNOWN, - NO_RANDR_EXTENSION, - RANDR_ERROR, - BOUNDS_ERROR, - CRTC_ASSIGNMENT, - NO_MATCHING_CONFIG, - NO_DPMS_EXTENSION; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "libgnome-desktop/gnome-idle-monitor.h", instance_pos = 2.9)] - public delegate void IdleMonitorWatchFunc (Gnome.IdleMonitor monitor, uint id); - [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cname = "GNOME_RR_CONNECTOR_TYPE_PANEL")] - public const string RR_CONNECTOR_TYPE_PANEL; -} \ No newline at end of file From 489dbed99f8b3a9b793d02aae69e8bba665097b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 09:36:46 -0800 Subject: [PATCH 03/23] Plug, Dock --- src/Plug.vala | 22 +++++----- src/Views/Appearance.vala | 16 ++++---- src/Views/Dock.vala | 23 +++++------ src/Views/Wallpaper.vala | 62 ++++++++++++++--------------- src/Widgets/WallpaperContainer.vala | 8 ++-- 5 files changed, 65 insertions(+), 66 deletions(-) diff --git a/src/Plug.vala b/src/Plug.vala index 55893e149..858e2ed3a 100644 --- a/src/Plug.vala +++ b/src/Plug.vala @@ -54,8 +54,6 @@ public class PantheonShell.Plug : Switchboard.Plug { public override Gtk.Widget get_widget () { if (main_grid == null) { - main_grid = new Gtk.Grid (); - wallpaper_view = new Wallpaper (this); var multitasking = new Multitasking (); @@ -74,15 +72,19 @@ public class PantheonShell.Plug : Switchboard.Plug { stack.add_titled (multitasking, "multitasking", _("Multitasking")); - var stack_switcher = new Gtk.StackSwitcher (); - stack_switcher.stack = stack; - stack_switcher.halign = Gtk.Align.CENTER; - stack_switcher.homogeneous = true; - stack_switcher.margin = 24; + var stack_switcher = new Gtk.StackSwitcher () { + stack = stack, + halign = CENTER, + margin_top = 24, + margin_end = 24, + margin_bottom = 24, + margin_start = 24 + }; + // stack_switcher.homogeneous = true; - main_grid.attach (stack_switcher, 0, 0, 1, 1); - main_grid.attach (stack, 0, 1, 1, 1); - main_grid.show_all (); + main_grid = new Gtk.Grid (); + main_grid.attach (stack_switcher, 0, 0); + main_grid.attach (stack, 0, 1); } return main_grid; diff --git a/src/Views/Appearance.vala b/src/Views/Appearance.vala index 3d757bde7..6672b3778 100644 --- a/src/Views/Appearance.vala +++ b/src/Views/Appearance.vala @@ -85,7 +85,7 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_default_grid.attach (prefer_default_card, 0, 0); prefer_default_grid.attach (new Gtk.Label (_("Default")), 0, 1); - var prefer_default_radio = new Gtk.RadioButton (null) { + var prefer_default_radio = new Gtk.CheckButton (null) { halign = Gtk.Align.START }; prefer_default_radio.get_style_context ().add_class ("image-button"); @@ -109,7 +109,7 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_dark_grid.attach (prefer_dark_card, 0, 0); prefer_dark_grid.attach (new Gtk.Label (_("Dark")), 0, 1); - var prefer_dark_radio = new Gtk.RadioButton.from_widget (prefer_default_radio) { + var prefer_dark_radio = new Gtk.CheckButton.from_widget (prefer_default_radio) { halign = Gtk.Align.START, hexpand = true }; @@ -128,11 +128,11 @@ public class PantheonShell.Appearance : Gtk.Box { var schedule_label = new Granite.HeaderLabel (_("Schedule")); - var schedule_disabled_radio = new Gtk.RadioButton.with_label (null, _("Disabled")) { + var schedule_disabled_radio = new Gtk.CheckButton.with_label (null, _("Disabled")) { margin_bottom = 3 }; - var schedule_sunset_radio = new Gtk.RadioButton.with_label_from_widget ( + var schedule_sunset_radio = new Gtk.CheckButton.with_label_from_widget ( schedule_disabled_radio, _("Sunset to Sunrise") ); @@ -156,7 +156,7 @@ public class PantheonShell.Appearance : Gtk.Box { schedule_manual_box.add (to_label); schedule_manual_box.add (to_time); - var schedule_manual_radio = new Gtk.RadioButton.from_widget (schedule_disabled_radio) ; + var schedule_manual_radio = new Gtk.CheckButton.from_widget (schedule_disabled_radio) ; Pantheon.AccountsService? pantheon_act = null; @@ -187,7 +187,7 @@ public class PantheonShell.Appearance : Gtk.Box { } var grid = new Gtk.Grid () { - column_spacing = 7, // Off by one with Gtk.RadioButton + column_spacing = 7, // Off by one with Gtk.CheckButton row_spacing = 6, margin_start = 12, margin_end = 12, @@ -418,13 +418,13 @@ public class PantheonShell.Appearance : Gtk.Box { animations_settings.bind ("enable-animations", animations_switch, "active", SettingsBindFlags.INVERT_BOOLEAN); } - private class PrefersAccentColorButton : Gtk.RadioButton { + private class PrefersAccentColorButton : Gtk.CheckButton { public AccentColor color { get; construct; } public Pantheon.AccountsService? pantheon_act { get; construct; default = null; } private static GLib.Settings interface_settings; - public PrefersAccentColorButton (Pantheon.AccountsService? pantheon_act, AccentColor color, Gtk.RadioButton? group_member = null) { + public PrefersAccentColorButton (Pantheon.AccountsService? pantheon_act, AccentColor color, Gtk.CheckButton? group_member = null) { Object ( pantheon_act: pantheon_act, color: color, diff --git a/src/Views/Dock.vala b/src/Views/Dock.vala index 9996ed0ae..0a6588a64 100644 --- a/src/Views/Dock.vala +++ b/src/Views/Dock.vala @@ -7,7 +7,6 @@ public class PantheonShell.Dock : Gtk.Box { private const string PANEL_SCHEMA = "io.elementary.desktop.wingpanel"; private const string TRANSLUCENCY_KEY = "use-transparency"; - construct { var translucency_header = new Granite.HeaderLabel (_("Panel Translucency")); @@ -15,7 +14,7 @@ public class PantheonShell.Dock : Gtk.Box { wrap = true, xalign = 0 }; - translucency_subtitle.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + translucency_subtitle.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); var translucency_switch = new Gtk.Switch () { halign = END, @@ -33,13 +32,13 @@ public class PantheonShell.Dock : Gtk.Box { var indicators_header = new Granite.HeaderLabel (_("Show in Panel")); var indicators_box = new Gtk.Box (VERTICAL, 6); - indicators_box.add (indicators_header); + indicators_box.append (indicators_header); var a11y_schema = SettingsSchemaSource.get_default ().lookup ("io.elementary.desktop.wingpanel.a11y", true); if (a11y_schema != null && a11y_schema.has_key ("show-indicator")) { var a11y_check = new Gtk.CheckButton.with_label (_("Accessibility")); - indicators_box.add (a11y_check); + indicators_box.append (a11y_check); var a11y_settings = new Settings ("io.elementary.desktop.wingpanel.a11y"); a11y_settings.bind ("show-indicator", a11y_check, "active", DEFAULT); @@ -50,8 +49,8 @@ public class PantheonShell.Dock : Gtk.Box { var caps_check = new Gtk.CheckButton.with_label (_("Caps Lock ⇪")); var num_check = new Gtk.CheckButton.with_label (_("Num Lock")); - indicators_box.add (caps_check); - indicators_box.add (num_check); + indicators_box.append (caps_check); + indicators_box.append (num_check); var keyboard_settings = new Settings ("io.elementary.wingpanel.keyboard"); keyboard_settings.bind ("capslock", caps_check, "active", DEFAULT); @@ -63,22 +62,22 @@ public class PantheonShell.Dock : Gtk.Box { margin_end = 12, margin_bottom = 12 }; - box.add (translucency_grid); + box.append (translucency_grid); // Only add this box if it has more than the header in it - if (indicators_box.get_children ().length () > 1) { - box.add (indicators_box); + if (indicators_header.get_next_sibling () != null) { + box.append (indicators_box); } - var clamp = new Hdy.Clamp () { + var clamp = new Adw.Clamp () { child = box }; - var scrolled = new Gtk.ScrolledWindow (null, null) { + var scrolled = new Gtk.ScrolledWindow () { child = clamp }; - add (scrolled); + append (scrolled); var panel_settings = new GLib.Settings (PANEL_SCHEMA); panel_settings.bind (TRANSLUCENCY_KEY, translucency_switch, "active", SettingsBindFlags.DEFAULT); diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index d41675760..c41f0b2c9 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -78,9 +78,9 @@ public class PantheonShell.Wallpaper : Gtk.Grid { var color = gnome_background_settings.get_string ("primary-color"); create_solid_color_container (color); - Gtk.TargetEntry e = {"text/uri-list", 0, 0}; - wallpaper_view.drag_data_received.connect (on_drag_data_received); - Gtk.drag_dest_set (wallpaper_view, Gtk.DestDefaults.ALL, {e}, Gdk.DragAction.COPY); + // Gtk.TargetEntry e = {"text/uri-list", 0, 0}; + // wallpaper_view.drag_data_received.connect (on_drag_data_received); + // Gtk.drag_dest_set (wallpaper_view, Gtk.DestDefaults.ALL, {e}, Gdk.DragAction.COPY); wallpaper_scrolled_window = new Gtk.ScrolledWindow (null, null); wallpaper_scrolled_window.expand = true; @@ -401,39 +401,39 @@ public class PantheonShell.Wallpaper : Gtk.Grid { solid_color = null; } - private void on_drag_data_received (Gtk.Widget widget, Gdk.DragContext ctx, int x, int y, Gtk.SelectionData sel, uint information, uint timestamp) { - if (sel.get_length () > 0) { - try { - var file = File.new_for_uri (sel.get_uris ()[0]); - var info = file.query_info (string.joinv (",", REQUIRED_FILE_ATTRS), 0); + // private void on_drag_data_received (Gtk.Widget widget, Gdk.DragContext ctx, int x, int y, Gtk.SelectionData sel, uint information, uint timestamp) { + // if (sel.get_length () > 0) { + // try { + // var file = File.new_for_uri (sel.get_uris ()[0]); + // var info = file.query_info (string.joinv (",", REQUIRED_FILE_ATTRS), 0); - if (!IOHelper.is_valid_file_type (info)) { - Gtk.drag_finish (ctx, false, false, timestamp); - return; - } + // if (!IOHelper.is_valid_file_type (info)) { + // Gtk.drag_finish (ctx, false, false, timestamp); + // return; + // } - if (WallpaperOperation.get_is_file_in_bg_dir (file)) { - Gtk.drag_finish (ctx, true, false, timestamp); - return; - } + // if (WallpaperOperation.get_is_file_in_bg_dir (file)) { + // Gtk.drag_finish (ctx, true, false, timestamp); + // return; + // } - string local_uri = file.get_uri (); - var dest = WallpaperOperation.copy_for_library (file); - if (dest != null) { - local_uri = dest.get_uri (); - } + // string local_uri = file.get_uri (); + // var dest = WallpaperOperation.copy_for_library (file); + // if (dest != null) { + // local_uri = dest.get_uri (); + // } - add_wallpaper_from_file (file, local_uri); + // add_wallpaper_from_file (file, local_uri); - Gtk.drag_finish (ctx, true, false, timestamp); - } catch (Error e) { - warning (e.message); - } - } + // Gtk.drag_finish (ctx, true, false, timestamp); + // } catch (Error e) { + // warning (e.message); + // } + // } - Gtk.drag_finish (ctx, false, false, timestamp); - return; - } + // Gtk.drag_finish (ctx, false, false, timestamp); + // return; + // } private void add_wallpaper_from_file (GLib.File file, string uri) { // don't load 'removed' wallpaper on plug reload @@ -518,7 +518,7 @@ public class PantheonShell.Wallpaper : Gtk.Grid { private void send_undo_toast () { foreach (weak Gtk.Widget child in view_overlay.get_children ()) { - if (child is Granite.Widgets.Toast) { + if (child is Granite.Toast) { child.destroy (); } } diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 2218ca374..0dfdf181d 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -26,7 +26,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { private Gtk.Box card_box; private Gtk.Revealer check_revealer; - private Granite.AsyncImage image; + private Gtk.Picture image; public string? thumb_path { get; construct set; } public bool thumb_valid { get; construct; } @@ -34,8 +34,6 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { public Gdk.Pixbuf thumb { get; set; } public uint64 creation_date = 0; - private Gtk.GestureMultiPress secondary_click_gesture; - private int scale; public bool checked { @@ -78,7 +76,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { scale = style_context.get_scale (); - image = new Granite.AsyncImage () { + image = new Gtk.Picture () { halign = CENTER, valign = CENTER }; @@ -92,7 +90,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { var check_provider = new Gtk.CssProvider (); check_provider.load_from_resource ("/io/elementary/switchboard/plug/pantheon-shell/Check.css"); - var check = new Gtk.RadioButton (null) { + var check = new Gtk.CheckButton (null) { halign = START, valign = START, can_focus = false From ac413cd453db3a4f8a10ab41cbe87db3419c32b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 09:38:03 -0800 Subject: [PATCH 04/23] Text --- src/Views/Text.vala | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Views/Text.vala b/src/Views/Text.vala index 60da4b2ea..4115c089e 100644 --- a/src/Views/Text.vala +++ b/src/Views/Text.vala @@ -63,7 +63,7 @@ public class PantheonShell.Text : Gtk.Box { wrap = true, xalign = 0 }; - dyslexia_font_description_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + dyslexia_font_description_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); var dyslexia_grid = new Gtk.Grid () { column_spacing = 12 @@ -77,13 +77,14 @@ public class PantheonShell.Text : Gtk.Box { margin_end = 12, margin_bottom = 24 }; - box.add (size_grid); - box.add (dyslexia_grid); + box.append (size_grid); + box.append (dyslexia_grid); - var clamp = new Hdy.Clamp (); - clamp.add (box); + var clamp = new Adw.Clamp () { + child = box + }; - add (clamp); + append (clamp); var interface_settings = new Settings ("org.gnome.desktop.interface"); interface_settings.bind ("text-scaling-factor", size_adjustment, "value", SettingsBindFlags.GET); From aa3e23ccb50e2ad6d05482e462186674bc359a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 09:45:51 -0800 Subject: [PATCH 05/23] Appearance --- src/Views/Appearance.vala | 140 ++++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 68 deletions(-) diff --git a/src/Views/Appearance.vala b/src/Views/Appearance.vala index 6672b3778..f63a1d3d5 100644 --- a/src/Views/Appearance.vala +++ b/src/Views/Appearance.vala @@ -69,15 +69,15 @@ public class PantheonShell.Appearance : Gtk.Box { var prefer_default_image = new Gtk.Image.from_resource ("/io/elementary/switchboard/plug/pantheon-shell/appearance-default.svg"); - var prefer_default_card = new Gtk.Grid () { - margin = 6, + var prefer_default_card = new Gtk.Box (HORIZONTAL, 0) { + margin_top = 6, + margin_end = 6, + margin_bottom = 6, margin_start = 12 }; - prefer_default_card.add (prefer_default_image); - - unowned Gtk.StyleContext prefer_default_card_context = prefer_default_card.get_style_context (); - prefer_default_card_context.add_class (Granite.STYLE_CLASS_CARD); - prefer_default_card_context.add_class (Granite.STYLE_CLASS_ROUNDED); + prefer_default_card.append (prefer_default_image); + prefer_default_card.add_css_class (Granite.STYLE_CLASS_CARD); + prefer_default_card.add_css_class (Granite.STYLE_CLASS_ROUNDED); var prefer_default_grid = new Gtk.Grid () { row_spacing = 6 @@ -85,23 +85,23 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_default_grid.attach (prefer_default_card, 0, 0); prefer_default_grid.attach (new Gtk.Label (_("Default")), 0, 1); - var prefer_default_radio = new Gtk.CheckButton (null) { + var prefer_default_radio = new Gtk.CheckButton () { + child = prefer_default_grid, halign = Gtk.Align.START }; - prefer_default_radio.get_style_context ().add_class ("image-button"); - prefer_default_radio.add (prefer_default_grid); + prefer_default_radio.add_css_class ("image-button"); var prefer_dark_image = new Gtk.Image.from_resource ("/io/elementary/switchboard/plug/pantheon-shell/appearance-dark.svg"); - var prefer_dark_card = new Gtk.Grid () { - margin = 6, + var prefer_dark_card = new Gtk.Box (HORIZONTAL, 6) { + margin_top = 6, + margin_end = 6, + margin_bottom = 6, margin_start = 12 }; - prefer_dark_card.add (prefer_dark_image); - - unowned Gtk.StyleContext prefer_dark_card_context = prefer_dark_card.get_style_context (); - prefer_dark_card_context.add_class (Granite.STYLE_CLASS_CARD); - prefer_dark_card_context.add_class (Granite.STYLE_CLASS_ROUNDED); + prefer_dark_card.append (prefer_dark_image); + prefer_dark_card.add_css_class (Granite.STYLE_CLASS_CARD); + prefer_dark_card.add_css_class (Granite.STYLE_CLASS_ROUNDED); var prefer_dark_grid = new Gtk.Grid () { row_spacing = 6 @@ -109,54 +109,58 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_dark_grid.attach (prefer_dark_card, 0, 0); prefer_dark_grid.attach (new Gtk.Label (_("Dark")), 0, 1); - var prefer_dark_radio = new Gtk.CheckButton.from_widget (prefer_default_radio) { + var prefer_dark_radio = new Gtk.CheckButton () { + child = prefer_dark_grid, + group = prefer_default_radio, halign = Gtk.Align.START, hexpand = true }; - prefer_dark_radio.get_style_context ().add_class ("image-button"); - prefer_dark_radio.add (prefer_dark_grid); + prefer_dark_radio.add_css_class ("image-button"); var prefer_style_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12); - prefer_style_box.add (prefer_default_radio); - prefer_style_box.add (prefer_dark_radio); + prefer_style_box.append (prefer_default_radio); + prefer_style_box.append (prefer_dark_radio); var dark_info = new Gtk.Label (_("Preferred visual style for system components. Apps may also choose to follow this preference.")) { wrap = true, xalign = 0 }; - dark_info.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + dark_info.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); var schedule_label = new Granite.HeaderLabel (_("Schedule")); - var schedule_disabled_radio = new Gtk.CheckButton.with_label (null, _("Disabled")) { + var schedule_disabled_radio = new Gtk.CheckButton.with_label (_("Disabled")) { margin_bottom = 3 }; - var schedule_sunset_radio = new Gtk.CheckButton.with_label_from_widget ( - schedule_disabled_radio, + var schedule_sunset_radio = new Gtk.CheckButton.with_label ( _("Sunset to Sunrise") - ); + ) { + group = schedule_disabled_radio + }; var from_label = new Gtk.Label (_("From:")); - var from_time = new Granite.Widgets.TimePicker () { + var from_time = new Granite.TimePicker () { hexpand = true, margin_end = 6 }; var to_label = new Gtk.Label (_("To:")); - var to_time = new Granite.Widgets.TimePicker () { + var to_time = new Granite.TimePicker () { hexpand = true }; var schedule_manual_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); - schedule_manual_box.add (from_label); - schedule_manual_box.add (from_time); - schedule_manual_box.add (to_label); - schedule_manual_box.add (to_time); + schedule_manual_box.append (from_label); + schedule_manual_box.append (from_time); + schedule_manual_box.append (to_label); + schedule_manual_box.append (to_time); - var schedule_manual_radio = new Gtk.CheckButton.from_widget (schedule_disabled_radio) ; + var schedule_manual_radio = new Gtk.CheckButton () { + group = schedule_disabled_radio + }; Pantheon.AccountsService? pantheon_act = null; @@ -274,21 +278,21 @@ public class PantheonShell.Appearance : Gtk.Box { /* Connect to focus_in_event so that this is only triggered * through user interaction, not if scheduling changes the selection */ - prefer_default_radio.focus_in_event.connect (() => { - // Check if selection changed - if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.NO_PREFERENCE) { - schedule_disabled_radio.active = true; - } - return Gdk.EVENT_PROPAGATE; - }); - - prefer_dark_radio.focus_in_event.connect (() => { - // Check if selection changed - if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.DARK) { - schedule_disabled_radio.active = true; - } - return Gdk.EVENT_PROPAGATE; - }); + // prefer_default_radio.focus_in_event.connect (() => { + // // Check if selection changed + // if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.NO_PREFERENCE) { + // schedule_disabled_radio.active = true; + // } + // return Gdk.EVENT_PROPAGATE; + // }); + + // prefer_dark_radio.focus_in_event.connect (() => { + // // Check if selection changed + // if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.DARK) { + // schedule_disabled_radio.active = true; + // } + // return Gdk.EVENT_PROPAGATE; + // }); ((GLib.DBusProxy) pantheon_act).g_properties_changed.connect ((changed, invalid) => { var color_scheme = changed.lookup_value ("PrefersColorScheme", new VariantType ("i")); @@ -359,29 +363,28 @@ public class PantheonShell.Appearance : Gtk.Box { var auto_button = new PrefersAccentColorButton (pantheon_act, AccentColor.NO_PREFERENCE, blueberry_button); auto_button.tooltip_text = _("Automatic based on wallpaper"); - var accent_grid = new Gtk.Grid (); - accent_grid.column_spacing = 6; - accent_grid.add (blueberry_button); - accent_grid.add (mint_button); - accent_grid.add (lime_button); - accent_grid.add (banana_button); - accent_grid.add (orange_button); - accent_grid.add (strawberry_button); - accent_grid.add (bubblegum_button); - accent_grid.add (grape_button); - accent_grid.add (cocoa_button); - accent_grid.add (slate_button); - accent_grid.add (auto_button); + var accent_box = new Gtk.Box (HORIZONTAL, 6); + accent_box.append (blueberry_button); + accent_box.append (mint_button); + accent_box.append (lime_button); + accent_box.append (banana_button); + accent_box.append (orange_button); + accent_box.append (strawberry_button); + accent_box.append (bubblegum_button); + accent_box.append (grape_button); + accent_box.append (cocoa_button); + accent_box.append (slate_button); + accent_box.append (auto_button); var accent_info = new Gtk.Label (_("Used across the system by default. Apps can always use their own accent color.")) { xalign = 0, wrap = true }; - accent_info.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + accent_info.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); grid.attach (accent_label, 0, 7, 2); grid.attach (accent_info, 0, 8, 2); - grid.attach (accent_grid, 0, 9, 2); + grid.attach (accent_box, 0, 9, 2); } var animations_label = new Granite.HeaderLabel (_("Reduce Motion")) { @@ -392,7 +395,7 @@ public class PantheonShell.Appearance : Gtk.Box { wrap = true, xalign = 0 }; - animations_description.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + animations_description.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); var animations_switch = new Gtk.Switch () { halign = Gtk.Align.END, @@ -409,10 +412,11 @@ public class PantheonShell.Appearance : Gtk.Box { grid.attach (animations_grid, 0, 10, 2); - var clamp = new Hdy.Clamp (); - clamp.add (grid); + var clamp = new Adw.Clamp () { + child = grid + }; - add (clamp); + append (clamp); var animations_settings = new Settings ("org.pantheon.desktop.gala.animations"); animations_settings.bind ("enable-animations", animations_switch, "active", SettingsBindFlags.INVERT_BOOLEAN); From 45d5a74f6bb4a44273ec333bdde06164b566864f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 09:47:34 -0800 Subject: [PATCH 06/23] Multitasking --- src/Views/Multitasking.vala | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Views/Multitasking.vala b/src/Views/Multitasking.vala index 4a7c1caf8..2e0750cfc 100644 --- a/src/Views/Multitasking.vala +++ b/src/Views/Multitasking.vala @@ -41,12 +41,11 @@ public class PantheonShell.Multitasking : Gtk.Box { var fullscreen_checkbutton = new Gtk.CheckButton.with_label (_("When entering fullscreen")); var maximize_checkbutton = new Gtk.CheckButton.with_label (_("When maximizing")); - var checkbutton_grid = new Gtk.Grid () { - column_spacing = 12, + var checkbutton_box = new Gtk.Box (HORIZONTAL, 12) { margin_bottom = 12 }; - checkbutton_grid.add (fullscreen_checkbutton); - checkbutton_grid.add (maximize_checkbutton); + checkbutton_box.append (fullscreen_checkbutton); + checkbutton_box.append (maximize_checkbutton); var grid = new Gtk.Grid () { column_spacing = 12, @@ -61,17 +60,18 @@ public class PantheonShell.Multitasking : Gtk.Box { grid.attach (bottomleft, 0, 3, 2); grid.attach (bottomright, 0, 4, 2); grid.attach (workspaces_label, 0, 6, 2); - grid.attach (checkbutton_grid, 0, 7, 2); + grid.attach (checkbutton_box, 0, 7, 2); - var clamp = new Hdy.Clamp (); - clamp.add (grid); + var clamp = new Adw.Clamp () { + child = grid + }; - var scrolled = new Gtk.ScrolledWindow (null, null) { + var scrolled = new Gtk.ScrolledWindow () { + child = clamp, hscrollbar_policy = Gtk.PolicyType.NEVER }; - scrolled.add (clamp); - add (scrolled); + append (scrolled); behavior_settings = new GLib.Settings ("org.pantheon.desktop.gala.behavior"); behavior_settings.bind ("move-fullscreened-workspace", fullscreen_checkbutton, "active", GLib.SettingsBindFlags.DEFAULT); @@ -130,10 +130,10 @@ public class PantheonShell.Multitasking : Gtk.Box { }; var command_revealer = new Gtk.Revealer () { + child = command_entry, margin_top = 6, transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN }; - command_revealer.add (command_entry); margin_bottom = 12; column_spacing = 12; From 9e237d6188f758b9772574ab6208972f1053cb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 10:09:09 -0800 Subject: [PATCH 07/23] Finish making it compile --- src/Plug.vala | 2 +- src/Views/Wallpaper.vala | 126 +++++++++++++--------------- src/Widgets/WallpaperContainer.vala | 31 ++++--- 3 files changed, 75 insertions(+), 84 deletions(-) diff --git a/src/Plug.vala b/src/Plug.vala index 858e2ed3a..02b5f0bb0 100644 --- a/src/Plug.vala +++ b/src/Plug.vala @@ -38,7 +38,7 @@ public class PantheonShell.Plug : Switchboard.Plug { var provider = new Gtk.CssProvider (); provider.load_from_resource ("/io/elementary/switchboard/plug/pantheon-shell/plug.css"); - Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); + Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); // DEPRECATED settings.set ("desktop/wallpaper", "wallpaper"); diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index c41f0b2c9..23ec7da94 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -69,7 +69,7 @@ public class PantheonShell.Wallpaper : Gtk.Grid { wallpaper_view = new Gtk.FlowBox (); wallpaper_view.activate_on_single_click = true; - wallpaper_view.get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW); + wallpaper_view.add_css_class (Granite.STYLE_CLASS_VIEW); wallpaper_view.homogeneous = true; wallpaper_view.selection_mode = Gtk.SelectionMode.SINGLE; wallpaper_view.child_activated.connect (update_checked_wallpaper); @@ -82,15 +82,22 @@ public class PantheonShell.Wallpaper : Gtk.Grid { // wallpaper_view.drag_data_received.connect (on_drag_data_received); // Gtk.drag_dest_set (wallpaper_view, Gtk.DestDefaults.ALL, {e}, Gdk.DragAction.COPY); - wallpaper_scrolled_window = new Gtk.ScrolledWindow (null, null); - wallpaper_scrolled_window.expand = true; - wallpaper_scrolled_window.add (wallpaper_view); + wallpaper_scrolled_window = new Gtk.ScrolledWindow () { + child = wallpaper_view, + hexpand = true, + vexpand = true + }; - view_overlay = new Gtk.Overlay (); - view_overlay.add (wallpaper_scrolled_window); + view_overlay = new Gtk.Overlay () { + child = wallpaper_scrolled_window + }; - var add_wallpaper_button = new Gtk.Button.with_label (_("Import Photo…")); - add_wallpaper_button.margin = 12; + var add_wallpaper_button = new Gtk.Button.with_label (_("Import Photo…")) { + margin_top = 12, + margin_end = 12, + margin_bottom = 12, + margin_start = 12 + }; var dim_label = new Gtk.Label (_("Dim with dark style:")); @@ -113,10 +120,13 @@ public class PantheonShell.Wallpaper : Gtk.Grid { rgba_color = { 1, 1, 1, 1 }; } - color_button = new Gtk.ColorButton (); - color_button.margin = 12; - color_button.margin_start = 0; - color_button.rgba = rgba_color; + color_button = new Gtk.ColorButton () { + margin_top = 12, + margin_end = 12, + margin_bottom = 12, + margin_start = 0, + rgba = rgba_color + }; color_button.color_set.connect (update_color); var size_group = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL); @@ -127,7 +137,7 @@ public class PantheonShell.Wallpaper : Gtk.Grid { load_settings (); var actionbar = new Gtk.ActionBar (); - actionbar.get_style_context ().add_class (Gtk.STYLE_CLASS_INLINE_TOOLBAR); + actionbar.add_css_class (Granite.STYLE_CLASS_FLAT); actionbar.pack_start (add_wallpaper_button); actionbar.pack_end (color_button); actionbar.pack_end (combo); @@ -145,10 +155,6 @@ public class PantheonShell.Wallpaper : Gtk.Grid { var filter = new Gtk.FileFilter (); filter.add_mime_type ("image/*"); - var preview_area = new Granite.AsyncImage (false); - preview_area.pixel_size = 256; - preview_area.margin_end = 12; - var chooser = new Gtk.FileChooserNative ( _("Import Photo"), null, Gtk.FileChooserAction.OPEN, _("Import"), @@ -156,37 +162,24 @@ public class PantheonShell.Wallpaper : Gtk.Grid { ); chooser.filter = filter; chooser.select_multiple = true; - chooser.set_preview_widget (preview_area); - chooser.update_preview.connect (() => { - string uri = chooser.get_preview_uri (); - - if (uri != null && uri.has_prefix ("file://") == true) { - var file = GLib.File.new_for_uri (uri); - preview_area.set_from_gicon_async.begin (new FileIcon (file), 256); - preview_area.show (); - } else { - preview_area.hide (); - } - }); - - if (chooser.run () == Gtk.ResponseType.ACCEPT) { - SList uris = chooser.get_uris (); - foreach (unowned string uri in uris) { - var file = GLib.File.new_for_uri (uri); - if (WallpaperOperation.get_is_file_in_bg_dir (file)) { - continue; - } + // if (chooser.run () == Gtk.ResponseType.ACCEPT) { + // SList uris = chooser.get_uris (); + // foreach (unowned string uri in uris) { + // var file = GLib.File.new_for_uri (uri); + // if (WallpaperOperation.get_is_file_in_bg_dir (file)) { + // continue; + // } - string local_uri = uri; - var dest = WallpaperOperation.copy_for_library (file); - if (dest != null) { - local_uri = dest.get_uri (); - } + // string local_uri = uri; + // var dest = WallpaperOperation.copy_for_library (file); + // if (dest != null) { + // local_uri = dest.get_uri (); + // } - add_wallpaper_from_file (file, local_uri); - } - } + // add_wallpaper_from_file (file, local_uri); + // } + // } chooser.destroy (); } @@ -259,7 +252,7 @@ public class PantheonShell.Wallpaper : Gtk.Grid { if (finished) { set_combo_disabled_if_necessary (); create_solid_color_container (color_button.rgba.to_string ()); - wallpaper_view.add (solid_color); + wallpaper_view.append (solid_color); wallpaper_view.select_child (solid_color); if (active_wallpaper != null) { @@ -281,7 +274,8 @@ public class PantheonShell.Wallpaper : Gtk.Grid { if (active_wallpaper == solid_color) { active_wallpaper.checked = false; - foreach (var child in wallpaper_view.get_children ()) { + var child = wallpaper_view.get_first_child (); + while (child != null) { var container = (WallpaperContainer) child; if (container.uri == current_wallpaper_path) { container.checked = true; @@ -289,6 +283,8 @@ public class PantheonShell.Wallpaper : Gtk.Grid { active_wallpaper = container; break; } + + child = child.get_next_sibling (); } } } else { @@ -360,7 +356,7 @@ public class PantheonShell.Wallpaper : Gtk.Grid { if (toplevel_folder) { create_solid_color_container (color_button.rgba.to_string ()); - wallpaper_view.add (solid_color); + wallpaper_view.append (solid_color); finished = true; if (gnome_background_settings.get_string ("picture-options") == "none") { @@ -390,12 +386,11 @@ public class PantheonShell.Wallpaper : Gtk.Grid { } solid_color = new SolidColorContainer (color); - solid_color.show_all (); } private void clean_wallpapers () { - foreach (var child in wallpaper_view.get_children ()) { - child.destroy (); + while (wallpaper_view.get_first_child () != null) { + wallpaper_view.remove (wallpaper_view.get_first_child ()); } solid_color = null; @@ -446,9 +441,7 @@ public class PantheonShell.Wallpaper : Gtk.Grid { var thumb_path = info.get_attribute_as_string (FileAttribute.THUMBNAIL_PATH); var thumb_valid = info.get_attribute_boolean (FileAttribute.THUMBNAIL_IS_VALID); var wallpaper = new WallpaperContainer (uri, thumb_path, thumb_valid); - wallpaper_view.add (wallpaper); - - wallpaper.show_all (); + wallpaper_view.append (wallpaper); wallpaper.trash.connect (() => { send_undo_toast (); @@ -517,29 +510,28 @@ public class PantheonShell.Wallpaper : Gtk.Grid { } private void send_undo_toast () { - foreach (weak Gtk.Widget child in view_overlay.get_children ()) { - if (child is Granite.Toast) { - child.destroy (); - } - } + // foreach (weak Gtk.Widget child in view_overlay.get_children ()) { + // if (child is Granite.Toast) { + // child.destroy (); + // } + // } if (wallpaper_for_removal != null) { confirm_removal (); } - var toast = new Granite.Widgets.Toast (_("Wallpaper Deleted")); + var toast = new Granite.Toast (_("Wallpaper Deleted")); toast.set_default_action (_("Undo")); - toast.show_all (); toast.default_action.connect (() => { undo_removal (); }); - toast.notify["child-revealed"].connect (() => { - if (!toast.child_revealed) { - confirm_removal (); - } - }); + // toast.notify["child-revealed"].connect (() => { + // if (!toast.child_revealed) { + // confirm_removal (); + // } + // }); view_overlay.add_overlay (toast); toast.send_notification (); @@ -562,7 +554,7 @@ public class PantheonShell.Wallpaper : Gtk.Grid { } private void undo_removal () { - wallpaper_view.add (wallpaper_for_removal); + wallpaper_view.append (wallpaper_for_removal); wallpaper_for_removal = null; } } diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 0dfdf181d..07d250cfc 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -84,13 +84,13 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { // We need an extra grid to not apply a scale == 1 to the "card" style. card_box = new Gtk.Box (VERTICAL, 0); - card_box.get_style_context ().add_class (Granite.STYLE_CLASS_CARD); - card_box.add (image); + card_box.add_css_class (Granite.STYLE_CLASS_CARD); + card_box.append (image); var check_provider = new Gtk.CssProvider (); check_provider.load_from_resource ("/io/elementary/switchboard/plug/pantheon-shell/Check.css"); - var check = new Gtk.CheckButton (null) { + var check = new Gtk.CheckButton () { halign = START, valign = START, can_focus = false @@ -133,16 +133,19 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { var menu_model = new Menu (); menu_model.append (_("Remove"), "wallpaper.trash"); - var context_menu = new Gtk.Menu.from_model (menu_model) { - attach_widget = this - }; - context_menu.show_all (); + var context_menu = new Gtk.PopoverMenu.from_model (menu_model); + context_menu.set_parent (this); - secondary_click_gesture = new Gtk.GestureMultiPress (overlay) { + var secondary_click_gesture = new Gtk.GestureClick () { button = Gdk.BUTTON_SECONDARY }; - secondary_click_gesture.released.connect (() => { - context_menu.popup_at_pointer (null); + overlay.add_controller (secondary_click_gesture); + secondary_click_gesture.released.connect ((n_press, x, y) => { + context_menu.pointing_to = Gdk.Rectangle () { + x = (int) x, + y = (int) y + }; + context_menu.popup (); }); } @@ -158,7 +161,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { } } else { thumb = new Gdk.Pixbuf (Gdk.Colorspace.RGB, false, 8, THUMB_WIDTH * scale, THUMB_HEIGHT * scale); - image.gicon = thumb; + image.paintable = Gdk.Texture.for_pixbuf (thumb); } } catch (Error e) { critical ("Failed to load wallpaper thumbnail: %s", e.message); @@ -184,11 +187,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { return; } - try { - yield image.set_from_file_async (File.new_for_path (thumb_path), THUMB_WIDTH, THUMB_HEIGHT, false); - } catch (Error e) { - warning (e.message); - } + image.file = File.new_for_path (thumb_path); if (uri != null) { string path = ""; From 860d8c65141910023b78fa8428bbf6bf7e17f0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 10:11:45 -0800 Subject: [PATCH 08/23] Fix crash --- data/plug.css | 18 +++++++++--------- src/Views/Appearance.vala | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/plug.css b/data/plug.css index ae3a263e6..cd0abeb8f 100644 --- a/data/plug.css +++ b/data/plug.css @@ -26,8 +26,8 @@ ), linear-gradient( to bottom, - alpha (@accent_color_500, 0.1), - alpha (@accent_color_500, 0.1) + alpha(@accent_color_500, 0.1), + alpha(@accent_color_500, 0.1) ); background-repeat: no-repeat; background-size: 48px 48px, cover; @@ -66,23 +66,23 @@ .wallpaper-container .card:checked { box-shadow: - 0 0 0 4px alpha (@text_color, 0.2), - 0 0 0 1px alpha (#000, 0.05), - 0 3px 3px alpha (#000, 0.22); + 0 0 0 4px alpha(@text_color, 0.2), + 0 0 0 1px alpha(#000, 0.05), + 0 3px 3px alpha(#000, 0.22); } .wallpaper-container:focus .card { box-shadow: 0 0 0 4px @accent_color, - 0 0 0 1px alpha (#000, 0.05), - 0 3px 3px alpha (#000, 0.22); + 0 0 0 1px alpha(#000, 0.05), + 0 3px 3px alpha(#000, 0.22); } radiobutton .card { background-image: linear-gradient( to bottom, - alpha (@accent_color_300, 0.1), - alpha (@accent_color_500, 0.1) + alpha(@accent_color_300, 0.1), + alpha(@accent_color_500, 0.1) ); } diff --git a/src/Views/Appearance.vala b/src/Views/Appearance.vala index f63a1d3d5..68c995c90 100644 --- a/src/Views/Appearance.vala +++ b/src/Views/Appearance.vala @@ -86,10 +86,10 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_default_grid.attach (new Gtk.Label (_("Default")), 0, 1); var prefer_default_radio = new Gtk.CheckButton () { - child = prefer_default_grid, halign = Gtk.Align.START }; prefer_default_radio.add_css_class ("image-button"); + prefer_default_grid.set_parent (prefer_default_radio); var prefer_dark_image = new Gtk.Image.from_resource ("/io/elementary/switchboard/plug/pantheon-shell/appearance-dark.svg"); @@ -110,12 +110,12 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_dark_grid.attach (new Gtk.Label (_("Dark")), 0, 1); var prefer_dark_radio = new Gtk.CheckButton () { - child = prefer_dark_grid, group = prefer_default_radio, halign = Gtk.Align.START, hexpand = true }; prefer_dark_radio.add_css_class ("image-button"); + prefer_dark_grid.set_parent (prefer_dark_radio); var prefer_style_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12); prefer_style_box.append (prefer_default_radio); From e1e962258d4c8046ca8d4aedbf81f1f54eb16466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 10:26:27 -0800 Subject: [PATCH 09/23] Fix checkbutton --- data/Check.css | 5 ----- data/icons.gresource.xml | 3 +-- data/plug.css | 14 +++++++++++++- src/Widgets/WallpaperContainer.vala | 13 ++++--------- 4 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 data/Check.css diff --git a/data/Check.css b/data/Check.css deleted file mode 100644 index 6c755c857..000000000 --- a/data/Check.css +++ /dev/null @@ -1,5 +0,0 @@ -radio { - min-height: 20px; - min-width: 20px; - -gtk-icon-transform: scale(0.6); -} diff --git a/data/icons.gresource.xml b/data/icons.gresource.xml index c2774bf72..803f64fbf 100644 --- a/data/icons.gresource.xml +++ b/data/icons.gresource.xml @@ -3,8 +3,7 @@ appearance-default.svg appearance-dark.svg - Check.css - plug.css + plug.css icons/32.svg diff --git a/data/plug.css b/data/plug.css index cd0abeb8f..677899327 100644 --- a/data/plug.css +++ b/data/plug.css @@ -78,7 +78,19 @@ 0 3px 3px alpha(#000, 0.22); } -radiobutton .card { +.wallpaper-container check { + border-radius: 50%; + min-height: 20px; + min-width: 20px; + -gtk-icon-transform: scale(0.6); +} + +.wallpaper-container picture { + min-width: 162px; + min-height: 100px; +} + +checkbutton .card { background-image: linear-gradient( to bottom, diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 07d250cfc..11611545c 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -76,10 +76,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { scale = style_context.get_scale (); - image = new Gtk.Picture () { - halign = CENTER, - valign = CENTER - }; + image = new Gtk.Picture (); image.get_style_context ().set_scale (1); // We need an extra grid to not apply a scale == 1 to the "card" style. @@ -87,15 +84,13 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { card_box.add_css_class (Granite.STYLE_CLASS_CARD); card_box.append (image); - var check_provider = new Gtk.CssProvider (); - check_provider.load_from_resource ("/io/elementary/switchboard/plug/pantheon-shell/Check.css"); - var check = new Gtk.CheckButton () { + active = true, halign = START, valign = START, - can_focus = false + can_focus = false, + can_target = false }; - check.get_style_context ().add_provider (check_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER); check_revealer = new Gtk.Revealer () { child = check, From b5931d1f640675cace10307bd2961304803b09f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 17:47:24 -0800 Subject: [PATCH 10/23] Fix focus controller --- src/Views/Appearance.vala | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/Views/Appearance.vala b/src/Views/Appearance.vala index 68c995c90..a68e4864c 100644 --- a/src/Views/Appearance.vala +++ b/src/Views/Appearance.vala @@ -278,21 +278,23 @@ public class PantheonShell.Appearance : Gtk.Box { /* Connect to focus_in_event so that this is only triggered * through user interaction, not if scheduling changes the selection */ - // prefer_default_radio.focus_in_event.connect (() => { - // // Check if selection changed - // if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.NO_PREFERENCE) { - // schedule_disabled_radio.active = true; - // } - // return Gdk.EVENT_PROPAGATE; - // }); - - // prefer_dark_radio.focus_in_event.connect (() => { - // // Check if selection changed - // if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.DARK) { - // schedule_disabled_radio.active = true; - // } - // return Gdk.EVENT_PROPAGATE; - // }); + var prefer_default_radio_controller = new Gtk.EventControllerFocus (); + prefer_default_radio.add_controller (prefer_default_radio_controller); + prefer_default_radio_controller.enter.connect (() => { + // Check if selection changed + if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.NO_PREFERENCE) { + schedule_disabled_radio.active = true; + } + }); + + var prefer_dark_radio_controller = new Gtk.EventControllerFocus (); + prefer_dark_radio.add_controller (prefer_dark_radio_controller); + prefer_dark_radio_controller.enter.connect (() => { + // Check if selection changed + if (pantheon_act.prefers_color_scheme != Granite.Settings.ColorScheme.DARK) { + schedule_disabled_radio.active = true; + } + }); ((GLib.DBusProxy) pantheon_act).g_properties_changed.connect ((changed, invalid) => { var color_scheme = changed.lookup_value ("PrefersColorScheme", new VariantType ("i")); From 92b0810c7ed5ba6a3135d6bb22ff6020c4d9e7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 17:53:10 -0800 Subject: [PATCH 11/23] Fix DnD --- src/Views/Wallpaper.vala | 57 ++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index 23ec7da94..831395ce3 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -67,6 +67,8 @@ public class PantheonShell.Wallpaper : Gtk.Grid { construct { var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL); + var drop_target = new Gtk.DropTarget (typeof (Gdk.FileList), Gdk.DragAction.COPY); + wallpaper_view = new Gtk.FlowBox (); wallpaper_view.activate_on_single_click = true; wallpaper_view.add_css_class (Granite.STYLE_CLASS_VIEW); @@ -74,14 +76,11 @@ public class PantheonShell.Wallpaper : Gtk.Grid { wallpaper_view.selection_mode = Gtk.SelectionMode.SINGLE; wallpaper_view.child_activated.connect (update_checked_wallpaper); wallpaper_view.set_sort_func (wallpapers_sort_function); + wallpaper_view.add_controller (drop_target); var color = gnome_background_settings.get_string ("primary-color"); create_solid_color_container (color); - // Gtk.TargetEntry e = {"text/uri-list", 0, 0}; - // wallpaper_view.drag_data_received.connect (on_drag_data_received); - // Gtk.drag_dest_set (wallpaper_view, Gtk.DestDefaults.ALL, {e}, Gdk.DragAction.COPY); - wallpaper_scrolled_window = new Gtk.ScrolledWindow () { child = wallpaper_view, hexpand = true, @@ -149,6 +148,8 @@ public class PantheonShell.Wallpaper : Gtk.Grid { attach (actionbar, 0, 2, 1, 1); add_wallpaper_button.clicked.connect (show_wallpaper_chooser); + + drop_target.drop.connect (on_drag_data_received); } private void show_wallpaper_chooser () { @@ -396,39 +397,21 @@ public class PantheonShell.Wallpaper : Gtk.Grid { solid_color = null; } - // private void on_drag_data_received (Gtk.Widget widget, Gdk.DragContext ctx, int x, int y, Gtk.SelectionData sel, uint information, uint timestamp) { - // if (sel.get_length () > 0) { - // try { - // var file = File.new_for_uri (sel.get_uris ()[0]); - // var info = file.query_info (string.joinv (",", REQUIRED_FILE_ATTRS), 0); - - // if (!IOHelper.is_valid_file_type (info)) { - // Gtk.drag_finish (ctx, false, false, timestamp); - // return; - // } - - // if (WallpaperOperation.get_is_file_in_bg_dir (file)) { - // Gtk.drag_finish (ctx, true, false, timestamp); - // return; - // } - - // string local_uri = file.get_uri (); - // var dest = WallpaperOperation.copy_for_library (file); - // if (dest != null) { - // local_uri = dest.get_uri (); - // } - - // add_wallpaper_from_file (file, local_uri); - - // Gtk.drag_finish (ctx, true, false, timestamp); - // } catch (Error e) { - // warning (e.message); - // } - // } - - // Gtk.drag_finish (ctx, false, false, timestamp); - // return; - // } + private bool on_drag_data_received (Value val, double x, double y) { + var file_list = (Gdk.FileList) val; + foreach (var file in file_list.get_files ()) { + var local_uri = file.get_uri (); + + var dest = WallpaperOperation.copy_for_library (file); + if (dest != null) { + local_uri = dest.get_uri (); + } + + add_wallpaper_from_file (file, local_uri); + } + + return true; + } private void add_wallpaper_from_file (GLib.File file, string uri) { // don't load 'removed' wallpaper on plug reload From 1d19e03d308e6bd5b003e7511d32a35882aa50aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 18:51:25 -0800 Subject: [PATCH 12/23] Fix missing icons --- data/icons.gresource.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/icons.gresource.xml b/data/icons.gresource.xml index 803f64fbf..a1723be8f 100644 --- a/data/icons.gresource.xml +++ b/data/icons.gresource.xml @@ -5,7 +5,7 @@ appearance-dark.svg plug.css - + icons/32.svg icons/32.svg icons/48.svg From ba60e885d10d5841a87c954107114f623815a612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 16 Nov 2023 19:02:17 -0800 Subject: [PATCH 13/23] HeaderLabel secondary text, mnemonic widgets, etc --- src/Views/Appearance.vala | 50 +++++++++++++-------------------------- src/Views/Dock.vala | 22 +++++++---------- src/Views/Text.vala | 23 +++++++----------- 3 files changed, 32 insertions(+), 63 deletions(-) diff --git a/src/Views/Appearance.vala b/src/Views/Appearance.vala index a68e4864c..c26721cf5 100644 --- a/src/Views/Appearance.vala +++ b/src/Views/Appearance.vala @@ -65,7 +65,9 @@ public class PantheonShell.Appearance : Gtk.Box { } construct { - var dark_label = new Granite.HeaderLabel (_("Style")); + var dark_label = new Granite.HeaderLabel (_("Style")) { + secondary_text = _("Preferred visual style for system components. Apps may also choose to follow this preference.") + }; var prefer_default_image = new Gtk.Image.from_resource ("/io/elementary/switchboard/plug/pantheon-shell/appearance-default.svg"); @@ -121,12 +123,6 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_style_box.append (prefer_default_radio); prefer_style_box.append (prefer_dark_radio); - var dark_info = new Gtk.Label (_("Preferred visual style for system components. Apps may also choose to follow this preference.")) { - wrap = true, - xalign = 0 - }; - dark_info.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - var schedule_label = new Granite.HeaderLabel (_("Schedule")); var schedule_disabled_radio = new Gtk.CheckButton.with_label (_("Disabled")) { @@ -191,7 +187,6 @@ public class PantheonShell.Appearance : Gtk.Box { } var grid = new Gtk.Grid () { - column_spacing = 7, // Off by one with Gtk.CheckButton row_spacing = 6, margin_start = 12, margin_end = 12, @@ -200,7 +195,6 @@ public class PantheonShell.Appearance : Gtk.Box { if (((GLib.DBusProxy) pantheon_act).get_cached_property ("PrefersColorScheme") != null) { grid.attach (dark_label, 0, 0, 2); - grid.attach (dark_info, 0, 1, 2); grid.attach (prefer_style_box, 0, 2, 2); grid.attach (schedule_label, 0, 3, 2); grid.attach (schedule_disabled_radio, 0, 4, 2); @@ -329,7 +323,8 @@ public class PantheonShell.Appearance : Gtk.Box { if (current_stylesheet.has_prefix (STYLESHEET_PREFIX)) { var accent_label = new Granite.HeaderLabel (_("Accent Color")) { - margin_top = 18 + margin_top = 18, + secondary_text = _("Used across the system by default. Apps can always use their own accent color.") }; var blueberry_button = new PrefersAccentColorButton (pantheon_act, AccentColor.BLUE); @@ -378,41 +373,28 @@ public class PantheonShell.Appearance : Gtk.Box { accent_box.append (slate_button); accent_box.append (auto_button); - var accent_info = new Gtk.Label (_("Used across the system by default. Apps can always use their own accent color.")) { - xalign = 0, - wrap = true - }; - accent_info.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - grid.attach (accent_label, 0, 7, 2); - grid.attach (accent_info, 0, 8, 2); - grid.attach (accent_box, 0, 9, 2); + grid.attach (accent_box, 0, 8, 2); } - var animations_label = new Granite.HeaderLabel (_("Reduce Motion")) { - margin_top = 18 - }; - - var animations_description = new Gtk.Label (_("Disable animations in the window manager and some other interface elements.")) { - wrap = true, - xalign = 0 - }; - animations_description.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - var animations_switch = new Gtk.Switch () { halign = Gtk.Align.END, hexpand = true, valign = Gtk.Align.CENTER }; - var animations_grid = new Gtk.Grid () { - column_spacing = 12 + var animations_label = new Granite.HeaderLabel (_("Reduce Motion")) { + margin_top = 18, + mnemonic_widget = animations_switch, + secondary_text = _("Disable animations in the window manager and some other interface elements.") }; - animations_grid.attach (animations_label, 0, 0); - animations_grid.attach (animations_description, 0, 1); - animations_grid.attach (animations_switch, 1, 0, 1, 2); - grid.attach (animations_grid, 0, 10, 2); + + var animations_box = new Gtk.Box (HORIZONTAL, 12); + animations_box.append (animations_label); + animations_box.append (animations_switch); + + grid.attach (animations_box, 0, 10, 2); var clamp = new Adw.Clamp () { child = grid diff --git a/src/Views/Dock.vala b/src/Views/Dock.vala index a4beb4022..3fbd67e8e 100644 --- a/src/Views/Dock.vala +++ b/src/Views/Dock.vala @@ -52,26 +52,20 @@ public class PantheonShell.Dock : Gtk.Box { icon_box.append (icon_header); icon_box.append (icon_size_box); - var translucency_header = new Granite.HeaderLabel (_("Panel Translucency")); - - var translucency_subtitle = new Gtk.Label (_("Automatically transparent or opaque based on the wallpaper")) { - wrap = true, - xalign = 0 - }; - translucency_subtitle.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - var translucency_switch = new Gtk.Switch () { halign = END, hexpand = true, valign = CENTER }; - var translucency_grid = new Gtk.Grid () { - column_spacing = 12 + var translucency_header = new Granite.HeaderLabel (_("Panel Translucency")) { + mnemonic_widget = translucency_switch, + secondary_text = _("Automatically transparent or opaque based on the wallpaper") }; - translucency_grid.attach (translucency_header, 0, 0); - translucency_grid.attach (translucency_subtitle, 0, 1); - translucency_grid.attach (translucency_switch, 1, 0, 1, 2); + + var translucency_box = new Gtk.Box (HORIZONTAL, 12); + translucency_box.append (translucency_header); + translucency_box.append (translucency_switch); var indicators_header = new Granite.HeaderLabel (_("Show in Panel")); @@ -107,7 +101,7 @@ public class PantheonShell.Dock : Gtk.Box { margin_bottom = 12 }; box.append (icon_box); - box.append (translucency_grid); + box.append (translucency_box); // Only add this box if it has more than the header in it if (indicators_header.get_next_sibling () != null) { diff --git a/src/Views/Text.vala b/src/Views/Text.vala index 4115c089e..4f98777bf 100644 --- a/src/Views/Text.vala +++ b/src/Views/Text.vala @@ -51,26 +51,19 @@ public class PantheonShell.Text : Gtk.Box { size_grid.attach (size_scale, 0, 1); size_grid.attach (size_spinbutton, 1, 1); - var dyslexia_font_label = new Granite.HeaderLabel (_("Dyslexia-friendly")); - var dyslexia_font_switch = new Gtk.Switch () { valign = Gtk.Align.CENTER }; - var dyslexia_font_description_label = new Gtk.Label ( - _("Bottom-heavy shapes and increased character spacing can help improve legibility and reading speed.") - ) { - wrap = true, - xalign = 0 + var dyslexia_font_label = new Granite.HeaderLabel (_("Dyslexia-friendly")) { + hexpand = true, + mnemonic_widget = dyslexia_font_switch, + secondary_text = _("Bottom-heavy shapes and increased character spacing can help improve legibility and reading speed.") }; - dyslexia_font_description_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - var dyslexia_grid = new Gtk.Grid () { - column_spacing = 12 - }; - dyslexia_grid.attach (dyslexia_font_label, 0, 0); - dyslexia_grid.attach (dyslexia_font_description_label, 0, 1); - dyslexia_grid.attach (dyslexia_font_switch, 1, 0, 1, 2); + var dyslexia_box = new Gtk.Box (HORIZONTAL, 12); + dyslexia_box.append (dyslexia_font_label); + dyslexia_box.append (dyslexia_font_switch); var box = new Gtk.Box (VERTICAL, 24) { margin_start = 12, @@ -78,7 +71,7 @@ public class PantheonShell.Text : Gtk.Box { margin_bottom = 24 }; box.append (size_grid); - box.append (dyslexia_grid); + box.append (dyslexia_box); var clamp = new Adw.Clamp () { child = box From 5475464158cddefe0893cc6af656273876d8d0b0 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Tue, 9 Jan 2024 11:38:23 -0800 Subject: [PATCH 14/23] Fix thumb size --- src/Widgets/WallpaperContainer.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 11611545c..433776b35 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -182,7 +182,8 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { return; } - image.file = File.new_for_path (thumb_path); + var pixbuf = new Gdk.Pixbuf.from_file_at_scale (thumb_path, THUMB_WIDTH * scale, THUMB_HEIGHT * scale, false); + image.paintable = Gdk.Texture.for_pixbuf (pixbuf); if (uri != null) { string path = ""; From f925f0ec9a3c9743dc9f8bd2d2170719a10f47e2 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Tue, 9 Jan 2024 11:40:42 -0800 Subject: [PATCH 15/23] Fix switcher homoegeneous --- src/Plug.vala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Plug.vala b/src/Plug.vala index 02b5f0bb0..1abf25b49 100644 --- a/src/Plug.vala +++ b/src/Plug.vala @@ -80,7 +80,13 @@ public class PantheonShell.Plug : Switchboard.Plug { margin_bottom = 24, margin_start = 24 }; - // stack_switcher.homogeneous = true; + + var switcher_sizegroup = new Gtk.SizeGroup (HORIZONTAL); + unowned var switcher_child = stack_switcher.get_first_child (); + while (switcher_child != null) { + switcher_sizegroup.add_widget (switcher_child); + switcher_child = switcher_child.get_next_sibling (); + } main_grid = new Gtk.Grid (); main_grid.attach (stack_switcher, 0, 0); From 2f8019965358d6bde719386fb01067f5ea673737 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Tue, 9 Jan 2024 11:47:04 -0800 Subject: [PATCH 16/23] Fix appearance style --- data/appearance-dark.svg | 647 +++++++++++++++++++----------------- data/appearance-default.svg | 351 ++++++++++--------- data/plug.css | 24 +- src/Views/Appearance.vala | 102 ++++-- 4 files changed, 624 insertions(+), 500 deletions(-) diff --git a/data/appearance-dark.svg b/data/appearance-dark.svg index 3dfe4f63e..d3d040051 100644 --- a/data/appearance-dark.svg +++ b/data/appearance-dark.svg @@ -6,152 +6,195 @@ xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" - width="112" - height="80" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" id="svg4729" - version="1.1"> + height="64" + width="86" + sodipodi:docname="appearance-dark.svg" + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"> + + id="linearGradient84"> + offset="0" /> + id="stop78" /> + offset="0.96854061" /> + offset="1" /> + id="linearGradient65"> + id="stop59" /> + offset="0.98240989" /> + + + id="filter4700" + x="-0.03035295" + width="1.0607059" + y="-0.044228554" + height="1.0884571"> + stdDeviation="0.6450012" + id="feGaussianBlur4702" /> - + width="1.1416471" + y="-0.10319996" + height="1.2063999"> + stdDeviation="1.5050028" + id="feGaussianBlur4735" /> + style="color-interpolation-filters:sRGB" + id="filter4818" + x="-0.026270477" + width="1.052541" + y="-0.022090763" + height="1.0441815"> + stdDeviation="0.4050032" + id="feGaussianBlur4820" /> - + id="feGaussianBlur1525-9" + stdDeviation="0.98" /> + x1="438.65228" + y1="466.57907" + x2="438.65228" + y2="473.27878" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.98039219,0,0,0.9,-364.08413,-360.00433)" /> + + + + + + + width="1.1416471" + y="-0.10319996" + height="1.2063999"> + stdDeviation="1.5050028" + id="feGaussianBlur4735-9-0-3" /> + width="1.0607059" + y="-0.044228554" + height="1.0884571"> + stdDeviation="0.6450012" + id="feGaussianBlur4702-6-2-0" /> + id="linearGradient1303" + xlink:href="#linearGradient84" /> @@ -161,227 +204,229 @@ image/svg+xml - + + + + + - + style="color:#bebebe;fill:#abacae;stroke-width:2.41666675" + transform="matrix(0.4137931,0,0,0.4137931,-51.037087,87.90069)" + id="g5339"> - - - - - - - - - - - - - + d="m 301,-210.01 a 1,1 0 0 0 -1,1 v 0.01 c -1.764,0.456 -2.998,2.168 -3,3.99 0,0 0,5 -1.66,5.622 -0.016,0.01 -0.023,0.03 -0.04,0.043 a 0.726,0.726 0 0 0 -0.161,0.175 c -0.018,0.027 -0.039,0.048 -0.053,0.077 a 0.738,0.738 0 0 0 -0.086,0.334 c 0,0.415 0.335,0.75 0.75,0.75 h 10.5 c 0.416,0 0.75,-0.335 0.75,-0.75 a 0.738,0.738 0 0 0 -0.086,-0.334 c -0.014,-0.03 -0.035,-0.05 -0.052,-0.077 a 0.725,0.725 0 0 0 -0.162,-0.175 c -0.016,-0.012 -0.023,-0.033 -0.04,-0.043 -1.66,-0.622 -1.66,-5.622 -1.66,-5.622 -0.002,-1.822 -1.235,-3.534 -3,-3.99 v -0.01 a 1,1 0 0 0 -1,-1 z m -1.933,13 a 2,2 0 0 0 1.933,1.5 2,2 0 0 0 1.936,-1.5 z" + overflow="visible" + style="overflow:visible;isolation:auto;mix-blend-mode:normal;fill:#abacae;stroke-width:2.41666675;marker:none" + id="path5337" + inkscape:connector-curvature="0" /> + + + + + + + + + + + + + + + + transform="matrix(0.60993427,0,0,0.64007437,-206.3279,-241.27847)" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.56219625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.50216447;marker:none;filter:url(#filter4700-5-6-2);enable-background:accumulate" + id="rect1143-9-2-6" + width="51.00008" + height="35.00008" + x="364.71573" + y="414.61584" + rx="3.1246369" + ry="3.1246369" /> + ry="1.5" + rx="1.5" + y="23.164856" + x="15.856179" + height="22" + width="32" + id="rect4993-0-2-70-5" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#fafafa;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97582185;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.50216447;marker:none;enable-background:accumulate" /> + ry="2" + rx="2" + y="22.664764" + x="15.356149" + height="23.000078" + width="33.000076" + id="rect4993-0-9-6" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.15;vector-effect:none;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.9999218;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" /> + + + + transform="matrix(0.64007437,0,0,0.64007437,131.27054,152.21142)" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.2;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.56219625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.50216447;marker:none;filter:url(#filter4733);enable-background:accumulate" + id="rect1143-9-0" + width="51.00008" + height="35.00008" + x="364.71573" + y="415.61584" + rx="3.1246369" + ry="3.1246369" /> + transform="matrix(0.60993427,0,0,0.64007437,143.03168,151.67261)" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.5;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.56219625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.50216447;marker:none;filter:url(#filter4700);enable-background:accumulate" + id="rect1143-9" + width="51.00008" + height="35.00008" + x="364.71573" + y="414.61584" + rx="3.1246369" + ry="3.1246369" /> + ry="1.5" + rx="1.5" + y="416.11594" + x="365.21576" + height="22" + width="32" + id="rect4993-0-2" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#4d4d4d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.97582197;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.50216447;marker:none;enable-background:accumulate" /> + ry="2" + rx="2" + y="415.61584" + x="364.71573" + height="23.000078" + width="33.000076" + id="rect4993-0" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.74500002;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.99992174;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" /> - - - - - - - - - - + width="31" + height="21" + rx="1" + ry="1" + x="365.71576" + y="416.61591" + id="rect6741" + style="opacity:0.15;fill:none;stroke:url(#linearGradient9678);stroke-width:0.99999982;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> diff --git a/data/appearance-default.svg b/data/appearance-default.svg index 2eaa931b7..c1a479795 100644 --- a/data/appearance-default.svg +++ b/data/appearance-default.svg @@ -8,8 +8,8 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="112" - height="80" + width="86" + height="64" id="svg4729" version="1.1" sodipodi:docname="appearance-default.svg" @@ -23,47 +23,70 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="990" - inkscape:window-height="513" + inkscape:window-width="3200" + inkscape:window-height="1678" id="namedview55" showgrid="false" - inkscape:zoom="2.95" - inkscape:cx="56" - inkscape:cy="38.644068" + inkscape:zoom="8" + inkscape:cx="34.308007" + inkscape:cy="22.40478" inkscape:window-x="0" inkscape:window-y="60" - inkscape:window-maximized="0" - inkscape:current-layer="svg4729" /> + inkscape:window-maximized="1" + inkscape:current-layer="svg4729"> + + + id="linearGradient84"> + + + + + + id="linearGradient65"> + id="stop57" /> + offset="0.01931654" /> + id="stop61" /> + id="stop63" /> + + y2="66.264153" /> + + + - - - + gradientTransform="matrix(1.6615886,0,0,0.27717128,5.2172426,22.14036)" + x1="14.066927" + y1="6.709353" + x2="14.066927" + y2="78.866898" /> @@ -161,155 +184,157 @@ - - - + id="g987" + transform="translate(-361.35978,-402.95108)"> + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.2;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.56219625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.50216447;marker:none;filter:url(#filter4733);enable-background:accumulate" + transform="matrix(0.64007437,0,0,0.64007437,131.27054,152.21142)" /> + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.5;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.56219625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.50216447;marker:none;filter:url(#filter4700);enable-background:accumulate" + transform="matrix(0.60993427,0,0,0.64007437,143.03168,151.67261)" /> + ry="1" + rx="1" + height="21" + width="31" /> + + + + + + + + + d="m 73.498873,10.01299 c -0.12134,0 -0.24148,0.046 -0.33984,0.14257 l -2.26758,2.67579 c -0.09781,0.1153 -0.241385,0.181732 -0.39258,0.18164 h -14 c -0.83195,0 -1.48632,0.65437 -1.48632,1.48632 v 25 c 0,0.83196 0.65437,1.48633 1.48632,1.48633 h 23 c 0.83196,0 1.48633,-0.65437 1.48633,-1.48633 v -25 c 0,-0.83195 -0.65437,-1.48632 -1.48633,-1.48632 h -3 c -0.15119,8.9e-5 -0.29477,-0.06634 -0.39257,-0.18164 l -2.26758,-2.67579 c -0.0984,-0.0966 -0.21854,-0.14257 -0.33985,-0.14257 z" + sodipodi:nodetypes="scccsssssssscccs" /> - - - - - - - + d="m 56.524693,13.49999 h 14.47511 l 2.5,-2.99999 2.5,2.99999 h 3.46292 c 0.554,0 1.03707,0.446 1.03707,1 V 39.5 c 0,0.554 -0.446,1 -1,1 h -23 c -0.554,0 -1,-0.446 -1,-1 V 14.49999 c 0,-0.554 0.4709,-1 1.0249,-1 z" + style="opacity:1;fill:none;stroke:url(#linearGradient1529);stroke-width:0.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:nodetypes="scccssssssss" /> Date: Tue, 9 Jan 2024 12:08:45 -0800 Subject: [PATCH 17/23] Fix some menu stuff --- src/Views/Appearance.vala | 50 ----------------------------- src/Views/Wallpaper.vala | 39 +++++++++++----------- src/Widgets/WallpaperContainer.vala | 9 ++++-- 3 files changed, 28 insertions(+), 70 deletions(-) diff --git a/src/Views/Appearance.vala b/src/Views/Appearance.vala index 7f68b1082..846812aab 100644 --- a/src/Views/Appearance.vala +++ b/src/Views/Appearance.vala @@ -101,56 +101,6 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_dark_grid.attach (new Gtk.Label (_("Dark")), 0, 1); prefer_dark_grid.set_parent (prefer_dark_radio); - // var prefer_default_image = new Gtk.Image.from_resource ("/io/elementary/switchboard/plug/pantheon-shell/appearance-default.svg"); - - // var prefer_default_card = new Gtk.Box (HORIZONTAL, 0) { - // margin_top = 6, - // margin_end = 6, - // margin_bottom = 6, - // margin_start = 12 - // }; - // prefer_default_card.append (prefer_default_image); - // prefer_default_card.add_css_class (Granite.STYLE_CLASS_CARD); - // prefer_default_card.add_css_class (Granite.STYLE_CLASS_ROUNDED); - - // var prefer_default_grid = new Gtk.Grid () { - // row_spacing = 6 - // }; - // prefer_default_grid.attach (prefer_default_card, 0, 0); - // prefer_default_grid.attach (new Gtk.Label (_("Default")), 0, 1); - - // var prefer_default_radio = new Gtk.CheckButton () { - // halign = Gtk.Align.START - // }; - // prefer_default_radio.add_css_class ("image-button"); - // prefer_default_grid.set_parent (prefer_default_radio); - - // var prefer_dark_image = new Gtk.Image.from_resource ("/io/elementary/switchboard/plug/pantheon-shell/appearance-dark.svg"); - - // var prefer_dark_card = new Gtk.Box (HORIZONTAL, 6) { - // margin_top = 6, - // margin_end = 6, - // margin_bottom = 6, - // margin_start = 12 - // }; - // prefer_dark_card.append (prefer_dark_image); - // prefer_dark_card.add_css_class (Granite.STYLE_CLASS_CARD); - // prefer_dark_card.add_css_class (Granite.STYLE_CLASS_ROUNDED); - - // var prefer_dark_grid = new Gtk.Grid () { - // row_spacing = 6 - // }; - // prefer_dark_grid.attach (prefer_dark_card, 0, 0); - // prefer_dark_grid.attach (new Gtk.Label (_("Dark")), 0, 1); - - // var prefer_dark_radio = new Gtk.CheckButton () { - // group = prefer_default_radio, - // halign = Gtk.Align.START, - // hexpand = true - // }; - // prefer_dark_radio.add_css_class ("image-button"); - // prefer_dark_grid.set_parent (prefer_dark_radio); - var prefer_style_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12); prefer_style_box.append (prefer_default_radio); prefer_style_box.append (prefer_dark_radio); diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index e17d4f0db..e59c3a4a8 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -153,25 +153,28 @@ public class PantheonShell.Wallpaper : Gtk.Box { chooser.filter = filter; chooser.select_multiple = true; - // if (chooser.run () == Gtk.ResponseType.ACCEPT) { - // SList uris = chooser.get_uris (); - // foreach (unowned string uri in uris) { - // var file = GLib.File.new_for_uri (uri); - // if (WallpaperOperation.get_is_file_in_bg_dir (file)) { - // continue; - // } - - // string local_uri = uri; - // var dest = WallpaperOperation.copy_for_library (file); - // if (dest != null) { - // local_uri = dest.get_uri (); - // } - - // add_wallpaper_from_file (file, local_uri); - // } - // } + chooser.show (); + chooser.response.connect ((response) => { + if (response == Gtk.ResponseType.ACCEPT) { + var files = chooser.get_files (); + for (var i = 0; i <= files.get_n_items (); i++) { + var file = (File) files.get_item (i); + + if (WallpaperOperation.get_is_file_in_bg_dir (file)) { + continue; + } + + var local_uri = file.get_uri (); + var dest = WallpaperOperation.copy_for_library (file); + if (dest != null) { + local_uri = dest.get_uri (); + } - chooser.destroy (); + add_wallpaper_from_file (file, local_uri); + } + } + chooser.destroy (); + }); } private void load_settings () { diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 433776b35..3eea78a4a 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -128,20 +128,25 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { var menu_model = new Menu (); menu_model.append (_("Remove"), "wallpaper.trash"); - var context_menu = new Gtk.PopoverMenu.from_model (menu_model); + var context_menu = new Gtk.PopoverMenu.from_model (menu_model) { + halign = START, + has_arrow = false + }; context_menu.set_parent (this); var secondary_click_gesture = new Gtk.GestureClick () { button = Gdk.BUTTON_SECONDARY }; - overlay.add_controller (secondary_click_gesture); secondary_click_gesture.released.connect ((n_press, x, y) => { + secondary_click_gesture.set_state (CLAIMED); context_menu.pointing_to = Gdk.Rectangle () { x = (int) x, y = (int) y }; context_menu.popup (); }); + + add_controller (secondary_click_gesture); } activate.connect (() => { From 45e692ab256dfe51d278f8da128385431b25d14b Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Tue, 9 Jan 2024 12:15:40 -0800 Subject: [PATCH 18/23] Fix part of toast --- src/Views/Wallpaper.vala | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index e59c3a4a8..7ae930311 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -486,11 +486,13 @@ public class PantheonShell.Wallpaper : Gtk.Box { } private void send_undo_toast () { - // foreach (weak Gtk.Widget child in view_overlay.get_children ()) { - // if (child is Granite.Toast) { - // child.destroy (); - // } - // } + unowned var child = view_overlay.get_first_child (); + while (child != null) { + if (child is Granite.Toast) { + ((Granite.Toast) child).withdraw (); + } + child = child.get_next_sibling (); + } if (wallpaper_for_removal != null) { confirm_removal (); From c031ada33df0d64adda8ec6a90e2518dc13160e5 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Tue, 9 Jan 2024 15:30:59 -0800 Subject: [PATCH 19/23] Connect to toast closed --- src/Views/Wallpaper.vala | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index 7ae930311..cd9a0394c 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -505,11 +505,7 @@ public class PantheonShell.Wallpaper : Gtk.Box { undo_removal (); }); - // toast.notify["child-revealed"].connect (() => { - // if (!toast.child_revealed) { - // confirm_removal (); - // } - // }); + toast.closed.connect (confirm_removal); view_overlay.add_overlay (toast); toast.send_notification (); From 43c9a1eb5edf6a43c0925ca6827002ad31ef41a1 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Wed, 10 Jan 2024 11:13:05 -0800 Subject: [PATCH 20/23] Namespace --- README.md | 2 +- ...ntheon-shell.metainfo.xml.in => desktop.metainfo.xml.in} | 6 +++--- data/icons.gresource.xml | 2 +- data/meson.build | 4 ++-- data/plug.css | 4 ++-- meson.build | 4 ++-- po/extra/POTFILES | 2 +- src/Plug.vala | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) rename data/{pantheon-shell.metainfo.xml.in => desktop.metainfo.xml.in} (96%) diff --git a/README.md b/README.md index 14a4512f8..a685a36e4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Switchboard Desktop Plug +# Desktop Settings [![Translation status](https://l10n.elementary.io/widgets/switchboard/-/switchboard-plug-pantheon-shell/svg-badge.svg)](https://l10n.elementary.io/engage/switchboard/?utm_source=widget) ![screenshot](data/screenshot-appearance.png?raw=true) diff --git a/data/pantheon-shell.metainfo.xml.in b/data/desktop.metainfo.xml.in similarity index 96% rename from data/pantheon-shell.metainfo.xml.in rename to data/desktop.metainfo.xml.in index c629dc891..ed51fdf6e 100644 --- a/data/pantheon-shell.metainfo.xml.in +++ b/data/desktop.metainfo.xml.in @@ -1,8 +1,8 @@ - io.elementary.switchboard.pantheon-shell - io.elementary.switchboard - pantheon-desktop-plug + io.elementary.settings.desktop + io.elementary.settings + io.elementary.settings.desktop CC0-1.0 GPL-3.0 diff --git a/data/icons.gresource.xml b/data/icons.gresource.xml index a1723be8f..828e9a714 100644 --- a/data/icons.gresource.xml +++ b/data/icons.gresource.xml @@ -1,6 +1,6 @@ - + appearance-default.svg appearance-dark.svg plug.css diff --git a/data/meson.build b/data/meson.build index ae8eae898..ce22e167f 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,6 +1,6 @@ i18n.merge_file( - input: 'pantheon-shell.metainfo.xml.in', - output: 'io.elementary.switchboard.pantheon-shell.metainfo.xml', + input: 'desktop.metainfo.xml.in', + output: gettext_name + '.metainfo.xml', po_dir: meson.source_root() / 'po' / 'extra', type: 'xml', install: true, diff --git a/data/plug.css b/data/plug.css index f6bfce69b..faef8bd3d 100644 --- a/data/plug.css +++ b/data/plug.css @@ -102,7 +102,7 @@ appearance-view checkbutton .card { appearance-view checkbutton .card.prefer-default { background-color: white; background-image: - url("resource:///io/elementary/switchboard/plug/pantheon-shell/appearance-default.svg"), + url("resource:///io/elementary/settings/desktop/appearance-default.svg"), linear-gradient( to bottom, alpha(@accent_color_300, 0.1), @@ -113,7 +113,7 @@ appearance-view checkbutton .card.prefer-default { appearance-view checkbutton .card.prefer-dark { background-color: mix(@BLACK_300, @BLACK_500, 0.25); background-image: - url("resource:///io/elementary/switchboard/plug/pantheon-shell/appearance-dark.svg"), + url("resource:///io/elementary/settings/desktop/appearance-dark.svg"), linear-gradient( to bottom, alpha(@accent_color_300, 0.1), diff --git a/meson.build b/meson.build index 48d36e467..43de0e810 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,9 @@ project( - 'pantheon-desktop', + 'desktop', 'vala', 'c', version: '6.5.0' ) -gettext_name = meson.project_name() + '-plug' +gettext_name = 'io.elementary.settings.' + meson.project_name() gnome = import('gnome') i18n = import('i18n') diff --git a/po/extra/POTFILES b/po/extra/POTFILES index 9a55e13f3..4a0419119 100644 --- a/po/extra/POTFILES +++ b/po/extra/POTFILES @@ -1 +1 @@ -data/pantheon-shell.metainfo.xml.in +data/desktop.metainfo.xml.in diff --git a/src/Plug.vala b/src/Plug.vala index 1abf25b49..248ed581a 100644 --- a/src/Plug.vala +++ b/src/Plug.vala @@ -37,7 +37,7 @@ public class PantheonShell.Plug : Switchboard.Plug { settings.set ("desktop/text", "text"); var provider = new Gtk.CssProvider (); - provider.load_from_resource ("/io/elementary/switchboard/plug/pantheon-shell/plug.css"); + provider.load_from_resource ("/io/elementary/settings/plug/desktop/plug.css"); Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); // DEPRECATED @@ -45,7 +45,7 @@ public class PantheonShell.Plug : Switchboard.Plug { settings.set ("desktop/hot-corners", "multitasking"); Object (category: Category.PERSONAL, - code_name: "io.elementary.switchboard.pantheon-shell", + code_name: "io.elementary.settings.desktop", display_name: _("Desktop"), description: _("Configure the dock, hot corners, and change wallpaper"), icon: "preferences-desktop", From db67cb7b4dac485ca3ac60bcb1398bcbaa2f2bad Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Wed, 10 Jan 2024 11:14:13 -0800 Subject: [PATCH 21/23] catch error --- src/Widgets/WallpaperContainer.vala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 3eea78a4a..cc94c7575 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -187,8 +187,14 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild { return; } - var pixbuf = new Gdk.Pixbuf.from_file_at_scale (thumb_path, THUMB_WIDTH * scale, THUMB_HEIGHT * scale, false); - image.paintable = Gdk.Texture.for_pixbuf (pixbuf); + try { + var pixbuf = new Gdk.Pixbuf.from_file_at_scale (thumb_path, THUMB_WIDTH * scale, THUMB_HEIGHT * scale, false); + image.paintable = Gdk.Texture.for_pixbuf (pixbuf); + } catch (Error e) { + critical ("Unable to set wallpaper thumbnail: %s", e.message); + return; + } + if (uri != null) { string path = ""; From a8c9a888c848138d46c865c2bc6175021cc2f9bc Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Wed, 10 Jan 2024 11:15:50 -0800 Subject: [PATCH 22/23] =?UTF-8?q?master=20=E2=86=92=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gettext.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gettext.yml b/.github/workflows/gettext.yml index 3f5087d51..839f84b27 100644 --- a/.github/workflows/gettext.yml +++ b/.github/workflows/gettext.yml @@ -2,7 +2,7 @@ name: Gettext Updates on: push: - branches: [master] + branches: [main] jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 504e2b799..0b795bfff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release on: pull_request: - branches: [master] + branches: [main] types: [closed] jobs: release: From 8730514b7565c5f80d569d9504e8fd0eaab6ba13 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Wed, 10 Jan 2024 11:17:15 -0800 Subject: [PATCH 23/23] fix css path --- src/Plug.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plug.vala b/src/Plug.vala index 248ed581a..422704f3e 100644 --- a/src/Plug.vala +++ b/src/Plug.vala @@ -37,7 +37,7 @@ public class PantheonShell.Plug : Switchboard.Plug { settings.set ("desktop/text", "text"); var provider = new Gtk.CssProvider (); - provider.load_from_resource ("/io/elementary/settings/plug/desktop/plug.css"); + provider.load_from_resource ("/io/elementary/settings/desktop/plug.css"); Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); // DEPRECATED