From 091a89ace3ec5b081a105b0ebc7c62be6d8e4bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 22 Jul 2025 10:46:29 -0700 Subject: [PATCH 01/26] Bump deps --- meson.build | 21 +- src/meson.build | 7 +- vapi/champlain-0.12.deps | 4 - vapi/champlain-0.12.vapi | 841 ----------------------------------- vapi/champlain-gtk-0.12.deps | 6 - vapi/champlain-gtk-0.12.vapi | 14 - 6 files changed, 10 insertions(+), 883 deletions(-) delete mode 100644 vapi/champlain-0.12.deps delete mode 100644 vapi/champlain-0.12.vapi delete mode 100644 vapi/champlain-gtk-0.12.deps delete mode 100644 vapi/champlain-gtk-0.12.vapi diff --git a/meson.build b/meson.build index 746f7c453..d41839773 100644 --- a/meson.build +++ b/meson.build @@ -22,13 +22,13 @@ gnome = import('gnome') i18n = import('i18n') pkgconfig = import('pkgconfig') +adw_dep = dependency('libadwaita-1', version: '>=1.0.0') glib_dep = dependency('glib-2.0') gee_dep = dependency('gee-0.8') -granite_dep = dependency('granite', version: '>=6.2.0') -gtk_dep = dependency('gtk+-3.0', version: '>=3.22') -handy_dep = dependency('libhandy-1', version: '>=0.90.0') -libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.8.0') -libedataserverui_dep = dependency('libedataserverui-1.2', version: '>=3.8.0') +granite_dep = dependency('granite-7', version: '>=7.0.0') +gtk_dep = dependency('gtk4', version: '>=3.22') +libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.45.1') +libedataserverui_dep = dependency('libedataserverui4-1.0', version: '>= 3.46.4') if (libedataserver_dep.version().version_compare ('>=3.46')) libsoup_dep = [] geocode_glib_dep = dependency('geocode-glib-2.0') @@ -38,21 +38,14 @@ else libsoup_dep = dependency('libsoup-2.4') endif gmodule_dep = dependency('gmodule-2.0') -champlain_dep = dependency('champlain-0.12', fallback: ['libchamplain', 'libchamplain_dep'], default_options: ['default_library=static', 'introspection=false', 'vapi=false']) -champlain_gtk_dep = dependency('champlain-gtk-0.12', fallback: ['libchamplain', 'libchamplain_gtk_dep'], default_options: ['default_library=static', 'introspection=false', 'vapi=false']) -# We need to force the inclusion of the Vapi in case of fallback -if (champlain_dep.type_name() == 'internal') - vapi_dir = meson.current_source_dir() / 'vapi' - champlain_dep = [champlain_dep, meson.get_compiler('vala').find_library('champlain-0.12', dirs: vapi_dir)] - champlain_gtk_dep = [champlain_gtk_dep, meson.get_compiler('vala').find_library('champlain-gtk-0.12', dirs: vapi_dir)] -endif clutter_dep = dependency('clutter-1.0') clutter_gtk_dep = dependency('clutter-gtk-1.0') folks_dep = dependency('folks') gclue_dep = dependency('libgeoclue-2.0') libecal_dep = dependency('libecal-2.0') libical_dep = dependency('libical-glib') -libportal_dep = [ dependency('libportal'), dependency('libportal-gtk3') ] +libportal_dep = [ dependency('libportal'), dependency('libportal-gtk4') ] +shumate_dep = dependency('shumate-1.0') add_project_arguments('-DLIBICAL_GLIB_UNSTABLE_API=1', language: 'c') diff --git a/src/meson.build b/src/meson.build index f850d97b6..b5a6221bc 100644 --- a/src/meson.build +++ b/src/meson.build @@ -41,11 +41,11 @@ calendar_files = files( ) calendar_deps = [ + adw_dep, core_dep, glib_dep, granite_dep, gtk_dep, - handy_dep, libecal_dep, libedataserver_dep, libedataserverui_dep, @@ -53,14 +53,13 @@ calendar_deps = [ libsoup_dep, gmodule_dep, m_dep, - champlain_dep, - champlain_gtk_dep, clutter_dep, clutter_gtk_dep, folks_dep, geocode_glib_dep, gclue_dep, - libportal_dep + libportal_dep, + shumate_dep, ] executable( diff --git a/vapi/champlain-0.12.deps b/vapi/champlain-0.12.deps deleted file mode 100644 index 8d3fd570a..000000000 --- a/vapi/champlain-0.12.deps +++ /dev/null @@ -1,4 +0,0 @@ -clutter-1.0 -cogl-pango-1.0 -atk -pangocairo diff --git a/vapi/champlain-0.12.vapi b/vapi/champlain-0.12.vapi deleted file mode 100644 index 58a39ba84..000000000 --- a/vapi/champlain-0.12.vapi +++ /dev/null @@ -1,841 +0,0 @@ -/* champlain-0.12.vapi generated by vapigen, do not modify. */ - -[CCode (cprefix = "Champlain", gir_namespace = "Champlain", gir_version = "0.12", lower_case_cprefix = "champlain_")] -namespace Champlain { - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_adjustment_get_type ()")] - public class Adjustment : GLib.Object { - [CCode (has_construct_function = false)] - public Adjustment (double value, double lower, double upper, double step_increment); - public bool clamp (bool interpolate, uint n_frames, uint fps); - public double get_value (); - public void get_values (double value, double lower, double upper, double step_increment); - public void interpolate (double value, uint n_frames, uint fps); - public void interpolate_stop (); - public void set_value (double value); - public void set_values (double value, double lower, double upper, double step_increment); - [NoAccessorMethod] - public double lower { get; set; } - [NoAccessorMethod] - public double step_increment { get; set; } - [NoAccessorMethod] - public double upper { get; set; } - public double value { get; set; } - public virtual signal void changed (); - } - [CCode (cheader_filename = "champlain/champlain.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "champlain_bounding_box_get_type ()")] - [Compact] - [Version (since = "0.6")] - public class BoundingBox { - public double bottom; - public double left; - public double right; - public double top; - [CCode (has_construct_function = false)] - public BoundingBox (); - [Version (since = "0.10")] - public void compose (Champlain.BoundingBox other); - public Champlain.BoundingBox copy (); - [Version (since = "0.12.4")] - public bool covers (double latitude, double longitude); - [Version (since = "0.10")] - public void extend (double latitude, double longitude); - public void free (); - public void get_center (out double latitude, out double longitude); - [Version (since = "0.10")] - public bool is_valid (); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_coordinate_get_type ()")] - [Version (since = "0.10")] - public class Coordinate : GLib.InitiallyUnowned, Champlain.Location { - [CCode (has_construct_function = false)] - public Coordinate (); - [CCode (has_construct_function = false)] - public Coordinate.full (double latitude, double longitude); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_custom_marker_get_type ()")] - [Version (deprecated = true, deprecated_since = "0.12.4", since = "0.10")] - public class CustomMarker : Champlain.Marker, Atk.Implementor, Champlain.Location, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - public CustomMarker (); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_error_tile_renderer_get_type ()")] - [Version (since = "0.8")] - public class ErrorTileRenderer : Champlain.Renderer { - [CCode (has_construct_function = false)] - public ErrorTileRenderer (uint tile_size); - public uint get_tile_size (); - public void set_tile_size (uint size); - public uint tile_size { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_file_cache_get_type ()")] - [Version (since = "0.6")] - public class FileCache : Champlain.TileCache { - [CCode (has_construct_function = false)] - protected FileCache (); - [CCode (has_construct_function = false)] - [Version (since = "0.8")] - public FileCache.full (uint size_limit, string? cache_dir, Champlain.Renderer renderer); - public unowned string get_cache_dir (); - [Version (since = "0.4")] - public uint get_size_limit (); - [Version (since = "0.4")] - public void purge (); - [Version (since = "0.4")] - public void purge_on_idle (); - [Version (since = "0.4")] - public void set_size_limit (uint size_limit); - public string cache_dir { get; construct; } - [Version (since = "0.4")] - public uint size_limit { get; set construct; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_file_tile_source_get_type ()")] - [Version (since = "0.8")] - public class FileTileSource : Champlain.TileSource { - [CCode (has_construct_function = false)] - protected FileTileSource (); - [CCode (has_construct_function = false)] - public FileTileSource.full (string id, string name, string license, string license_uri, uint min_zoom, uint max_zoom, uint tile_size, Champlain.MapProjection projection, Champlain.Renderer renderer); - public void load_map_data (string map_path); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_image_renderer_get_type ()")] - [Version (since = "0.8")] - public class ImageRenderer : Champlain.Renderer { - [CCode (has_construct_function = false)] - public ImageRenderer (); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_kinetic_scroll_view_get_type ()")] - public class KineticScrollView : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - public KineticScrollView (bool kinetic, Champlain.Viewport viewport); - public void stop (); - [NoAccessorMethod] - public double decel_rate { get; set; } - [NoAccessorMethod] - public bool mode { get; set; } - [NoAccessorMethod] - public uint motion_buffer { get; set; } - public signal void panning_completed (); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_label_get_type ()")] - [Version (since = "0.10")] - public class Label : Champlain.Marker, Atk.Implementor, Champlain.Location, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Label (); - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Label.from_file (string filename) throws GLib.Error; - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Label.full (string text, Clutter.Actor actor); - public Pango.Alignment get_alignment (); - public Pango.AttrList get_attributes (); - public Clutter.Color? get_color (); - public bool get_draw_background (); - [Version (since = "0.12.10")] - public bool get_draw_shadow (); - public Pango.EllipsizeMode get_ellipsize (); - public unowned string get_font_name (); - public unowned Clutter.Actor get_image (); - public bool get_single_line_mode (); - public unowned string get_text (); - public Clutter.Color? get_text_color (); - public bool get_use_markup (); - public bool get_wrap (); - public Pango.WrapMode get_wrap_mode (); - public void set_alignment (Pango.Alignment alignment); - public void set_attributes (Pango.AttrList list); - public void set_color (Clutter.Color? color); - public void set_draw_background (bool background); - [Version (since = "0.12.10")] - public void set_draw_shadow (bool shadow); - public void set_ellipsize (Pango.EllipsizeMode mode); - public void set_font_name (string? font_name); - public void set_image (Clutter.Actor? image); - public void set_single_line_mode (bool mode); - public void set_text (string text); - public void set_text_color (Clutter.Color? color); - public void set_use_markup (bool use_markup); - public void set_wrap (bool wrap); - public void set_wrap_mode (Pango.WrapMode wrap_mode); - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Label.with_image (Clutter.Actor actor); - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Label.with_text (string text, string? font, Clutter.Color? text_color, Clutter.Color? label_color); - public Pango.Alignment alignment { get; set; } - public Clutter.Color color { owned get; set; } - public bool draw_background { get; set; } - [Version (since = "0.12.10")] - public bool draw_shadow { get; set; } - public Pango.EllipsizeMode ellipsize { get; set; } - public string font_name { get; set; } - public Clutter.Actor image { get; set; } - public bool single_line_mode { get; set; } - public string text { get; set; } - public Clutter.Color text_color { owned get; set; } - public bool use_markup { get; set; } - public bool wrap { get; set; } - public Pango.WrapMode wrap_mode { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_layer_get_type ()")] - [Version (since = "0.10")] - public abstract class Layer : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false)] - protected Layer (); - public virtual Champlain.BoundingBox get_bounding_box (); - public virtual void set_view (Champlain.View view); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_license_get_type ()")] - [Version (since = "0.10")] - public class License : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - public License (); - public void connect_view (Champlain.View view); - public void disconnect_view (); - public Pango.Alignment get_alignment (); - public unowned string get_extra_text (); - public void set_alignment (Pango.Alignment alignment); - public void set_extra_text (string text); - public Pango.Alignment alignment { get; set; } - public string extra_text { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_map_source_get_type ()")] - [Version (since = "0.4")] - public abstract class MapSource : GLib.InitiallyUnowned { - [CCode (has_construct_function = false)] - protected MapSource (); - public virtual void fill_tile (Champlain.Tile tile); - public uint get_column_count (uint zoom_level); - public virtual unowned string get_id (); - public double get_latitude (uint zoom_level, double y); - public virtual unowned string get_license (); - public virtual unowned string get_license_uri (); - public double get_longitude (uint zoom_level, double x); - public virtual uint get_max_zoom_level (); - [Version (since = "0.4.3")] - public double get_meters_per_pixel (uint zoom_level, double latitude, double longitude); - public virtual uint get_min_zoom_level (); - public virtual unowned string get_name (); - [Version (since = "0.6")] - public unowned Champlain.MapSource get_next_source (); - public virtual Champlain.MapProjection get_projection (); - [Version (since = "0.8")] - public unowned Champlain.Renderer get_renderer (); - public uint get_row_count (uint zoom_level); - public virtual uint get_tile_size (); - public double get_x (uint zoom_level, double longitude); - public double get_y (uint zoom_level, double latitude); - [Version (since = "0.6")] - public void set_next_source (Champlain.MapSource next_source); - [Version (since = "0.8")] - public void set_renderer (Champlain.Renderer renderer); - [Version (since = "0.6")] - public Champlain.MapSource next_source { get; set; } - [Version (since = "0.8")] - public Champlain.Renderer renderer { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_map_source_chain_get_type ()")] - [Version (since = "0.6")] - public class MapSourceChain : Champlain.MapSource { - [CCode (has_construct_function = false)] - public MapSourceChain (); - public void pop (); - public void push (Champlain.MapSource map_source); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_map_source_desc_get_type ()")] - [Version (since = "0.10")] - public class MapSourceDesc : GLib.Object { - [CCode (has_construct_function = false)] - protected MapSourceDesc (); - public void* get_data (); - public unowned string get_id (); - public unowned string get_license (); - public unowned string get_license_uri (); - public uint get_max_zoom_level (); - public uint get_min_zoom_level (); - public unowned string get_name (); - public Champlain.MapProjection get_projection (); - public uint get_tile_size (); - public unowned string get_uri_format (); - [NoAccessorMethod] - public void* constructor { get; construct; } - public void* data { get; construct; } - public string id { get; construct; } - public string license { get; construct; } - public string license_uri { get; construct; } - public uint max_zoom_level { get; construct; } - public uint min_zoom_level { get; construct; } - public string name { get; construct; } - public Champlain.MapProjection projection { get; construct; } - public uint tile_size { get; construct; } - public string uri_format { get; construct; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_map_source_factory_get_type ()")] - [Version (since = "0.4")] - public class MapSourceFactory : GLib.Object { - [CCode (has_construct_function = false)] - protected MapSourceFactory (); - public unowned Champlain.MapSource create (string id); - [Version (since = "0.6")] - public unowned Champlain.MapSource create_cached_source (string id); - [Version (since = "0.8")] - public unowned Champlain.MapSource create_error_source (uint tile_size); - [Version (since = "0.12.5")] - public unowned Champlain.MapSource create_memcached_source (string id); - public static Champlain.MapSourceFactory dup_default (); - public GLib.SList get_registered (); - [Version (since = "0.10")] - public bool register (Champlain.MapSourceDesc desc); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_marker_get_type ()")] - [Version (since = "0.10")] - public class Marker : Clutter.Actor, Atk.Implementor, Champlain.Location, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - [Version (since = "0.12.4")] - public Marker (); - public void animate_in (); - public void animate_in_with_delay (uint delay); - public void animate_out (); - public void animate_out_with_delay (uint delay); - public bool get_draggable (); - public bool get_selectable (); - public bool get_selected (); - public static unowned Clutter.Color? get_selection_color (); - public static unowned Clutter.Color? get_selection_text_color (); - public void set_draggable (bool value); - public void set_selectable (bool value); - public void set_selected (bool value); - public static void set_selection_color (Clutter.Color color); - public static void set_selection_text_color (Clutter.Color color); - public bool draggable { get; set; } - public bool selectable { get; set; } - public bool selected { get; set; } - public signal void button_press (Clutter.Event event); - public signal void button_release (Clutter.Event event); - public signal void drag_finish (Clutter.Event event); - public signal void drag_motion (double dx, double dy, Clutter.Event event); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_marker_layer_get_type ()")] - [Version (since = "0.10")] - public class MarkerLayer : Champlain.Layer, Atk.Implementor, Champlain.Exportable, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false)] - public MarkerLayer (); - public void add_marker (Champlain.Marker marker); - public void animate_in_all_markers (); - public void animate_out_all_markers (); - [CCode (has_construct_function = false)] - public MarkerLayer.full (Champlain.SelectionMode mode); - public GLib.List get_markers (); - public GLib.List get_selected (); - public Champlain.SelectionMode get_selection_mode (); - public void hide_all_markers (); - public void remove_all (); - public void remove_marker (Champlain.Marker marker); - public void select_all_markers (); - public void set_all_markers_draggable (); - public void set_all_markers_undraggable (); - public void set_selection_mode (Champlain.SelectionMode mode); - public void show_all_markers (); - public void unselect_all_markers (); - public Champlain.SelectionMode selection_mode { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_memory_cache_get_type ()")] - [Version (since = "0.8")] - public class MemoryCache : Champlain.TileCache { - [CCode (has_construct_function = false)] - protected MemoryCache (); - public void clean (); - [CCode (has_construct_function = false)] - public MemoryCache.full (uint size_limit, Champlain.Renderer renderer); - public uint get_size_limit (); - public void set_size_limit (uint size_limit); - public uint size_limit { get; set construct; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_network_bbox_tile_source_get_type ()")] - [Version (since = "0.8")] - public class NetworkBboxTileSource : Champlain.TileSource { - [CCode (has_construct_function = false)] - protected NetworkBboxTileSource (); - [CCode (has_construct_function = false)] - public NetworkBboxTileSource.full (string id, string name, string license, string license_uri, uint min_zoom, uint max_zoom, uint tile_size, Champlain.MapProjection projection, Champlain.Renderer renderer); - public unowned string get_api_uri (); - [Version (since = "0.10")] - public void load_map_data (Champlain.BoundingBox bbox); - public void set_api_uri (string api_uri); - [Version (since = "0.12.16")] - public void set_user_agent (string user_agent); - public string api_uri { get; set; } - [NoAccessorMethod] - public string proxy_uri { owned get; set; } - [NoAccessorMethod] - public Champlain.State state { get; set; } - [Version (since = "0.12.16")] - public string user_agent { set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_network_tile_source_get_type ()")] - [Version (since = "0.6")] - public class NetworkTileSource : Champlain.TileSource { - [CCode (has_construct_function = false)] - protected NetworkTileSource (); - [CCode (has_construct_function = false)] - [Version (since = "0.4")] - public NetworkTileSource.full (string id, string name, string license, string license_uri, uint min_zoom, uint max_zoom, uint tile_size, Champlain.MapProjection projection, string uri_format, Champlain.Renderer renderer); - [Version (since = "0.12.14")] - public int get_max_conns (); - public bool get_offline (); - public unowned string get_proxy_uri (); - public unowned string get_uri_format (); - [Version (since = "0.12.14")] - public void set_max_conns (int max_conns); - public void set_offline (bool offline); - public void set_proxy_uri (string proxy_uri); - [Version (since = "0.4")] - public void set_uri_format (string uri_format); - [Version (since = "0.12.16")] - public void set_user_agent (string user_agent); - [Version (since = "0.12.14")] - public int max_conns { get; set; } - [Version (since = "0.4")] - public bool offline { get; set; } - [Version (since = "0.4")] - public string proxy_uri { get; set; } - [Version (since = "0.4")] - public string uri_format { get; set construct; } - [Version (since = "0.12.16")] - public string user_agent { set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_null_tile_source_get_type ()")] - [Version (since = "0.8")] - public class NullTileSource : Champlain.TileSource { - [CCode (has_construct_function = false)] - protected NullTileSource (); - [CCode (has_construct_function = false)] - public NullTileSource.full (Champlain.Renderer renderer); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_path_layer_get_type ()")] - [Version (since = "0.10")] - public class PathLayer : Champlain.Layer, Atk.Implementor, Champlain.Exportable, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false)] - public PathLayer (); - public void add_node (Champlain.Location location); - public bool get_closed (); - [Version (since = "0.12.4")] - public GLib.List get_dash (); - public bool get_fill (); - public Clutter.Color? get_fill_color (); - public GLib.List get_nodes (); - public bool get_stroke (); - public Clutter.Color? get_stroke_color (); - public double get_stroke_width (); - public bool get_visible (); - public void insert_node (Champlain.Location location, uint position); - public void remove_all (); - public void remove_node (Champlain.Location location); - public void set_closed (bool value); - [Version (since = "0.12.4")] - public void set_dash (GLib.List dash_pattern); - public void set_fill (bool value); - public void set_fill_color (Clutter.Color? color); - public void set_stroke (bool value); - public void set_stroke_color (Clutter.Color? color); - public void set_stroke_width (double value); - public void set_visible (bool value); - public bool closed { get; set; } - public bool fill { get; set; } - public Clutter.Color fill_color { owned get; set; } - public bool stroke { get; set; } - public Clutter.Color stroke_color { owned get; set; } - public double stroke_width { get; set; } - public bool visible { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_point_get_type ()")] - [Version (since = "0.10")] - public class Point : Champlain.Marker, Atk.Implementor, Champlain.Exportable, Champlain.Location, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Point (); - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Point.full (double size, Clutter.Color color); - public Clutter.Color? get_color (); - public double get_size (); - public void set_color (Clutter.Color? color); - public void set_size (double size); - public Clutter.Color color { owned get; set; } - public double size { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_renderer_get_type ()")] - [Version (since = "0.8")] - public class Renderer : GLib.InitiallyUnowned { - [CCode (has_construct_function = false)] - protected Renderer (); - public virtual void render (Champlain.Tile tile); - public virtual void set_data ([CCode (array_length_cname = "size", array_length_pos = 1.1, array_length_type = "guint")] uint8[] data); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_scale_get_type ()")] - [Version (since = "0.10")] - public class Scale : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Scale (); - public void connect_view (Champlain.View view); - public void disconnect_view (); - public uint get_max_width (); - public Champlain.Unit get_unit (); - public void set_max_width (uint value); - public void set_unit (Champlain.Unit unit); - public uint max_width { get; set; } - public Champlain.Unit unit { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_tile_get_type ()")] - [Version (since = "0.4")] - public class Tile : Clutter.Actor, Atk.Implementor, Champlain.Exportable, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false)] - public Tile (); - [Version (since = "0.8")] - public void display_content (); - [CCode (has_construct_function = false)] - public Tile.full (uint x, uint y, uint size, uint zoom_level); - public unowned Clutter.Actor get_content (); - public unowned string get_etag (); - [Version (since = "0.6")] - public bool get_fade_in (); - public unowned GLib.TimeVal? get_modified_time (); - public uint get_size (); - public Champlain.State get_state (); - public uint get_x (); - public uint get_y (); - public uint get_zoom_level (); - public void set_content (Clutter.Actor actor); - public void set_etag (string etag); - [Version (since = "0.6")] - public void set_fade_in (bool fade_in); - public void set_modified_time (GLib.TimeVal time); - public void set_size (uint size); - public void set_state (Champlain.State state); - public void set_x (uint x); - public void set_y (uint y); - public void set_zoom_level (uint zoom_level); - public Clutter.Actor content { get; set; } - public string etag { get; set; } - [Version (since = "0.6")] - public bool fade_in { get; set; } - public uint size { get; set; } - public Champlain.State state { get; set; } - public uint x { get; set; } - public uint y { get; set; } - public uint zoom_level { get; set; } - [Version (since = "0.10")] - public signal void render_complete (void* data, uint size, bool error); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_tile_cache_get_type ()")] - [Version (since = "0.6")] - public abstract class TileCache : Champlain.MapSource { - [CCode (has_construct_function = false)] - protected TileCache (); - public virtual void on_tile_filled (Champlain.Tile tile); - public virtual void refresh_tile_time (Champlain.Tile tile); - public virtual void store_tile (Champlain.Tile tile, string contents, size_t size); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_tile_source_get_type ()")] - [Version (since = "0.6")] - public abstract class TileSource : Champlain.MapSource { - [CCode (has_construct_function = false)] - protected TileSource (); - public unowned Champlain.TileCache get_cache (); - public void set_cache (Champlain.TileCache cache); - [Version (since = "0.4")] - public void set_id (string id); - [Version (since = "0.4")] - public void set_license (string license); - [Version (since = "0.4")] - public void set_license_uri (string license_uri); - public void set_max_zoom_level (uint zoom_level); - public void set_min_zoom_level (uint zoom_level); - [Version (since = "0.4")] - public void set_name (string name); - [Version (since = "0.4")] - public void set_projection (Champlain.MapProjection projection); - public void set_tile_size (uint tile_size); - public Champlain.TileCache cache { get; set; } - [NoAccessorMethod] - [Version (since = "0.4")] - public string id { owned get; set construct; } - [NoAccessorMethod] - [Version (since = "0.4")] - public string license { owned get; set construct; } - [NoAccessorMethod] - [Version (since = "0.4")] - public string license_uri { owned get; set construct; } - [NoAccessorMethod] - [Version (since = "0.4")] - public uint max_zoom_level { get; set construct; } - [NoAccessorMethod] - [Version (since = "0.4")] - public uint min_zoom_level { get; set construct; } - [NoAccessorMethod] - [Version (since = "0.4")] - public string name { owned get; set construct; } - [NoAccessorMethod] - [Version (since = "0.4")] - public Champlain.MapProjection projection { get; set construct; } - [NoAccessorMethod] - [Version (since = "0.4")] - public uint tile_size { get; set construct; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_view_get_type ()")] - [Version (since = "0.1")] - public class View : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - [Version (since = "0.4")] - public View (); - [Version (since = "0.2")] - public void add_layer (Champlain.Layer layer); - [Version (since = "0.12.5")] - public void add_overlay_source (Champlain.MapSource map_source, uint8 opacity); - [Version (deprecated = true, deprecated_since = "0.12.4", since = "0.10")] - public void bin_layout_add (Clutter.Actor child, Clutter.BinAlignment x_align, Clutter.BinAlignment y_align); - public void center_on (double latitude, double longitude); - [Version (since = "0.10")] - public void ensure_layers_visible (bool animate); - [Version (since = "0.10")] - public void ensure_visible (Champlain.BoundingBox bbox, bool animate); - [Version (since = "0.12")] - public bool get_animate_zoom (); - [Version (since = "0.12.4")] - public unowned Clutter.Content get_background_pattern (); - [Version (since = "0.12.4")] - public Champlain.BoundingBox get_bounding_box (); - [Version (since = "0.12.6")] - public Champlain.BoundingBox get_bounding_box_for_zoom_level (uint zoom_level); - [Version (since = "0.10")] - public double get_center_latitude (); - [Version (since = "0.10")] - public double get_center_longitude (); - [Version (since = "0.4")] - public double get_deceleration (); - public bool get_horizontal_wrap (); - [Version (since = "0.4")] - public bool get_keep_center_on_resize (); - [Version (since = "0.10")] - public bool get_kinetic_mode (); - [Version (since = "0.10")] - public unowned Champlain.License get_license_actor (); - [Version (since = "0.4")] - public unowned Champlain.MapSource get_map_source (); - [Version (since = "0.4")] - public uint get_max_zoom_level (); - [Version (since = "0.4")] - public uint get_min_zoom_level (); - [Version (since = "0.12.5")] - public GLib.List get_overlay_sources (); - [Version (since = "0.10")] - public Champlain.State get_state (); - [Version (since = "0.12.14")] - public void get_viewport_anchor (out int anchor_x, out int anchor_y); - [Version (since = "0.10")] - public void get_viewport_origin (out int x, out int y); - [Version (since = "0.12.11")] - public unowned Champlain.BoundingBox get_world (); - [Version (since = "0.4")] - public uint get_zoom_level (); - [Version (since = "0.4")] - public bool get_zoom_on_double_click (); - [Version (since = "0.4")] - public void go_to (double latitude, double longitude); - [Version (since = "0.10")] - public double latitude_to_y (double latitude); - [Version (since = "0.10")] - public double longitude_to_x (double longitude); - [Version (since = "0.8")] - public void reload_tiles (); - [Version (since = "0.4.1")] - public void remove_layer (Champlain.Layer layer); - [Version (since = "0.12.5")] - public void remove_overlay_source (Champlain.MapSource map_source); - [Version (since = "0.12")] - public void set_animate_zoom (bool value); - [Version (since = "0.12.4")] - public void set_background_pattern (Clutter.Content background); - [Version (since = "0.4")] - public void set_deceleration (double rate); - public void set_horizontal_wrap (bool wrap); - [Version (since = "0.4")] - public void set_keep_center_on_resize (bool value); - [Version (since = "0.10")] - public void set_kinetic_mode (bool kinetic); - [Version (since = "0.4")] - public void set_map_source (Champlain.MapSource map_source); - [Version (since = "0.4")] - public void set_max_zoom_level (uint zoom_level); - [Version (since = "0.4")] - public void set_min_zoom_level (uint zoom_level); - [Version (since = "0.12.11")] - public void set_world (Champlain.BoundingBox bbox); - [Version (since = "0.4")] - public void set_zoom_level (uint zoom_level); - [Version (since = "0.4")] - public void set_zoom_on_double_click (bool value); - [Version (since = "0.4")] - public void stop_go_to (); - public Cairo.Surface to_surface (bool include_layers); - [Version (since = "0.10")] - public double x_to_longitude (double x); - [Version (since = "0.10")] - public double y_to_latitude (double y); - public void zoom_in (); - public void zoom_out (); - [Version (since = "0.12")] - public bool animate_zoom { get; set; } - [Version (since = "0.12.4")] - public Clutter.Actor background_pattern { get; set; } - [Version (since = "0.10")] - public double deceleration { get; set; } - [NoAccessorMethod] - public uint goto_animation_duration { get; set; } - [NoAccessorMethod] - public Clutter.AnimationMode goto_animation_mode { get; set; } - public bool horizontal_wrap { get; set; } - [Version (since = "0.2.7")] - public bool keep_center_on_resize { get; set; } - [Version (since = "0.10")] - public bool kinetic_mode { get; set; } - [NoAccessorMethod] - public double latitude { get; set; } - [NoAccessorMethod] - public double longitude { get; set; } - [Version (since = "0.2")] - public Champlain.MapSource map_source { get; set; } - [Version (since = "0.4")] - public uint max_zoom_level { get; set; } - [Version (since = "0.4")] - public uint min_zoom_level { get; set; } - [Version (since = "0.4")] - public Champlain.State state { get; } - [Version (since = "0.12.11")] - public Champlain.BoundingBox world { get; set; } - public uint zoom_level { get; set; } - [Version (since = "0.4")] - public bool zoom_on_double_click { get; set; } - [Version (since = "0.4")] - public signal void animation_completed (); - [Version (since = "0.10")] - public signal void layer_relocated (); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_viewport_get_type ()")] - public class Viewport : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { - [CCode (has_construct_function = false, type = "ClutterActor*")] - public Viewport (); - public void get_adjustments (Champlain.Adjustment hadjustment, Champlain.Adjustment vadjustment); - public void get_anchor (int x, int y); - public void get_origin (double x, double y); - public void set_actor_position (Clutter.Actor actor, double x, double y); - public void set_adjustments (Champlain.Adjustment hadjustment, Champlain.Adjustment vadjustment); - public void set_child (Clutter.Actor child); - public void set_origin (double x, double y); - public void stop (); - [NoAccessorMethod] - public Champlain.Adjustment hadjustment { owned get; set; } - [NoAccessorMethod] - public Champlain.Adjustment vadjustment { owned get; set; } - [NoAccessorMethod] - public int x_origin { get; set; } - [NoAccessorMethod] - public int y_origin { get; set; } - public signal void relocated (); - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_exportable_get_type ()")] - public interface Exportable : GLib.Object { - [Version (since = "0.12.12")] - public abstract unowned Cairo.Surface get_surface (); - [Version (since = "0.12.12")] - public abstract void set_surface (Cairo.Surface surface); - [Version (since = "0.12.12")] - public abstract Cairo.Surface surface { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", type_id = "champlain_location_get_type ()")] - public interface Location : GLib.Object { - [Version (since = "0.10")] - public abstract double get_latitude (); - [Version (since = "0.10")] - public abstract double get_longitude (); - [Version (since = "0.10")] - public abstract void set_location (double latitude, double longitude); - [NoAccessorMethod] - [Version (since = "0.10")] - public abstract double latitude { get; set; } - [NoAccessorMethod] - [Version (since = "0.10")] - public abstract double longitude { get; set; } - } - [CCode (cheader_filename = "champlain/champlain.h", cprefix = "CHAMPLAIN_MAP_PROJECTION_", type_id = "champlain_map_projection_get_type ()")] - public enum MapProjection { - MERCATOR - } - [CCode (cheader_filename = "champlain/champlain.h", cprefix = "CHAMPLAIN_SELECTION_", type_id = "champlain_selection_mode_get_type ()")] - public enum SelectionMode { - NONE, - SINGLE, - MULTIPLE - } - [CCode (cheader_filename = "champlain/champlain.h", cprefix = "CHAMPLAIN_STATE_", type_id = "champlain_state_get_type ()")] - public enum State { - NONE, - LOADING, - LOADED, - DONE - } - [CCode (cheader_filename = "champlain/champlain.h", cprefix = "CHAMPLAIN_UNIT_", type_id = "champlain_unit_get_type ()")] - public enum Unit { - KM, - MILES - } - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAJOR_VERSION")] - public const int MAJOR_VERSION; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_MEMPHIS_LOCAL")] - public const string MAP_SOURCE_MEMPHIS_LOCAL; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_MEMPHIS_NETWORK")] - public const string MAP_SOURCE_MEMPHIS_NETWORK; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_MFF_RELIEF")] - public const string MAP_SOURCE_MFF_RELIEF; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OAM")] - [Version (deprecated = true)] - public const string MAP_SOURCE_OAM; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OSM_AERIAL_MAP")] - [Version (deprecated = true)] - public const string MAP_SOURCE_OSM_AERIAL_MAP; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OSM_CYCLE_MAP")] - public const string MAP_SOURCE_OSM_CYCLE_MAP; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OSM_MAPNIK")] - public const string MAP_SOURCE_OSM_MAPNIK; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OSM_MAPQUEST")] - [Version (deprecated = true)] - public const string MAP_SOURCE_OSM_MAPQUEST; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OSM_OSMARENDER")] - [Version (deprecated = true)] - public const string MAP_SOURCE_OSM_OSMARENDER; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OSM_TRANSPORT_MAP")] - public const string MAP_SOURCE_OSM_TRANSPORT_MAP; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OWM_CLOUDS")] - public const string MAP_SOURCE_OWM_CLOUDS; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OWM_PRECIPITATION")] - public const string MAP_SOURCE_OWM_PRECIPITATION; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OWM_PRESSURE")] - public const string MAP_SOURCE_OWM_PRESSURE; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OWM_TEMPERATURE")] - public const string MAP_SOURCE_OWM_TEMPERATURE; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAP_SOURCE_OWM_WIND")] - public const string MAP_SOURCE_OWM_WIND; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAX_LATITUDE")] - public const double MAX_LATITUDE; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MAX_LONGITUDE")] - public const double MAX_LONGITUDE; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MICRO_VERSION")] - public const int MICRO_VERSION; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MINOR_VERSION")] - public const int MINOR_VERSION; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MIN_LATITUDE")] - public const double MIN_LATITUDE; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_MIN_LONGITUDE")] - public const double MIN_LONGITUDE; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_VERSION")] - public const double VERSION; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_VERSION_HEX")] - public const int VERSION_HEX; - [CCode (cheader_filename = "champlain/champlain.h", cname = "CHAMPLAIN_VERSION_S")] - public const string VERSION_S; -} diff --git a/vapi/champlain-gtk-0.12.deps b/vapi/champlain-gtk-0.12.deps deleted file mode 100644 index 6ed23b451..000000000 --- a/vapi/champlain-gtk-0.12.deps +++ /dev/null @@ -1,6 +0,0 @@ -clutter-gtk-1.0 -cogl-pango-1.0 -gtk+-3.0 -atk -pangocairo -champlain-0.12 diff --git a/vapi/champlain-gtk-0.12.vapi b/vapi/champlain-gtk-0.12.vapi deleted file mode 100644 index 1a35aa1fa..000000000 --- a/vapi/champlain-gtk-0.12.vapi +++ /dev/null @@ -1,14 +0,0 @@ -/* champlain-gtk-0.12.vapi generated by vapigen, do not modify. */ - -[CCode (cprefix = "GtkChamplain", gir_namespace = "GtkChamplain", gir_version = "0.12", lower_case_cprefix = "gtk_champlain_")] -namespace GtkChamplain { - [CCode (cheader_filename = "champlain-gtk/champlain-gtk.h", type_id = "gtk_champlain_embed_get_type ()")] - [Version (since = "0.4")] - public class Embed : Gtk.Alignment, Atk.Implementor, Gtk.Buildable { - [CCode (has_construct_function = false, type = "GtkWidget*")] - public Embed (); - public unowned Champlain.View get_view (); - [NoAccessorMethod] - public Champlain.View champlain_view { owned get; } - } -} From 6839753dfc61d614b21f772162f15bac5381c9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 23 Jul 2025 10:23:14 -0700 Subject: [PATCH 02/26] Update CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43ecac571..8b1cc9c80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y libchamplain-0.12-dev libchamplain-gtk-0.12-dev libclutter-1.0-dev libecal2.0-dev libedataserver1.2-dev libedataserverui1.2-dev libfolks-dev libgee-0.8-dev libgeoclue-2-dev libgeocode-glib-dev libglib2.0-dev libgranite-dev libgtk-3-dev libhandy-1-dev libical-dev libportal-dev libportal-gtk3-dev meson valac + apt install -y libadwaita-1-dev libclutter-1.0-dev libecal2.0-dev libedataserver1.2-dev libedataserverui4-dev libfolks-dev libgee-0.8-dev libgeoclue-2-dev libgeocode-glib-dev libglib2.0-dev libgranite-7-dev libgtk4-dev libical-dev libportal-dev libportal-gtk4-dev libshumate-dev meson valac - name: Build and Test env: DESTDIR: out From 13be7e0f98ffd7698c4cd28894d5409358df0bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 23 Jul 2025 10:25:56 -0700 Subject: [PATCH 03/26] Fix libgtk-4-dev --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b1cc9c80..45eef80f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y libadwaita-1-dev libclutter-1.0-dev libecal2.0-dev libedataserver1.2-dev libedataserverui4-dev libfolks-dev libgee-0.8-dev libgeoclue-2-dev libgeocode-glib-dev libglib2.0-dev libgranite-7-dev libgtk4-dev libical-dev libportal-dev libportal-gtk4-dev libshumate-dev meson valac + apt install -y libadwaita-1-dev libclutter-1.0-dev libecal2.0-dev libedataserver1.2-dev libedataserverui4-dev libfolks-dev libgee-0.8-dev libgeoclue-2-dev libgeocode-glib-dev libglib2.0-dev libgranite-7-dev libgtk-4-dev libical-dev libportal-dev libportal-gtk4-dev libshumate-dev meson valac - name: Build and Test env: DESTDIR: out From b690cc37ec2ddc725b6969aed2310a7800314ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 23 Jul 2025 10:30:46 -0700 Subject: [PATCH 04/26] Comment out gestures for now --- .github/workflows/ci.yml | 2 +- core/GesturesUtils.vala | 56 ++++++++++++++++++++-------------------- meson.build | 4 +-- src/meson.build | 4 +-- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45eef80f7..a3874b26c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y libadwaita-1-dev libclutter-1.0-dev libecal2.0-dev libedataserver1.2-dev libedataserverui4-dev libfolks-dev libgee-0.8-dev libgeoclue-2-dev libgeocode-glib-dev libglib2.0-dev libgranite-7-dev libgtk-4-dev libical-dev libportal-dev libportal-gtk4-dev libshumate-dev meson valac + apt install -y libadwaita-1-dev libecal2.0-dev libedataserver1.2-dev libedataserverui4-dev libfolks-dev libgee-0.8-dev libgeoclue-2-dev libgeocode-glib-dev libglib2.0-dev libgranite-7-dev libgtk-4-dev libical-dev libportal-dev libportal-gtk4-dev libshumate-dev meson valac - name: Build and Test env: DESTDIR: out diff --git a/core/GesturesUtils.vala b/core/GesturesUtils.vala index 4ed459e40..a84ff84ac 100644 --- a/core/GesturesUtils.vala +++ b/core/GesturesUtils.vala @@ -24,40 +24,40 @@ namespace Maya.GesturesUtils { static bool has_scrolled = false; const uint INTERVAL = 500; - public bool on_scroll_event (Gdk.EventScroll event) { - double delta_x; - double delta_y; - event.get_scroll_deltas (out delta_x, out delta_y); + // public bool on_scroll_event (Gdk.EventScroll event) { + // double delta_x; + // double delta_y; + // event.get_scroll_deltas (out delta_x, out delta_y); - double choice = delta_x; - if (((int)delta_x).abs () < ((int)delta_y).abs ()) { - choice = delta_y; - } + // double choice = delta_x; + // if (((int)delta_x).abs () < ((int)delta_y).abs ()) { + // choice = delta_y; + // } - // It's mouse scroll ! - if (choice == 1 || choice == -1) { - Calendar.EventStore.get_default ().change_month ((int) choice); - return true; - } + // // It's mouse scroll ! + // if (choice == 1 || choice == -1) { + // Calendar.EventStore.get_default ().change_month ((int) choice); + // return true; + // } - if (has_scrolled == true) { - return true; - } + // if (has_scrolled == true) { + // return true; + // } - if (choice > 0.3) { - reset_timer.begin (); - Calendar.EventStore.get_default ().change_month (1); - return true; - } + // if (choice > 0.3) { + // reset_timer.begin (); + // Calendar.EventStore.get_default ().change_month (1); + // return true; + // } - if (choice < -0.3) { - reset_timer.begin (); - Calendar.EventStore.get_default ().change_month (-1); - return true; - } + // if (choice < -0.3) { + // reset_timer.begin (); + // Calendar.EventStore.get_default ().change_month (-1); + // return true; + // } - return false; - } + // return false; + // } public async void reset_timer () { has_scrolled = true; diff --git a/meson.build b/meson.build index 2aa75ef55..f8b458811 100644 --- a/meson.build +++ b/meson.build @@ -31,8 +31,8 @@ libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.45.1') libedataserverui_dep = dependency('libedataserverui4-1.0', version: '>= 3.46.4') geocode_glib_dep = dependency('geocode-glib-2.0') gmodule_dep = dependency('gmodule-2.0') -clutter_dep = dependency('clutter-1.0') -clutter_gtk_dep = dependency('clutter-gtk-1.0') +# clutter_dep = dependency('clutter-1.0') +# clutter_gtk_dep = dependency('clutter-gtk-1.0') folks_dep = dependency('folks') gclue_dep = dependency('libgeoclue-2.0') libecal_dep = dependency('libecal-2.0') diff --git a/src/meson.build b/src/meson.build index be845835c..198b150d5 100644 --- a/src/meson.build +++ b/src/meson.build @@ -51,8 +51,8 @@ calendar_deps = [ libical_dep, gmodule_dep, m_dep, - clutter_dep, - clutter_gtk_dep, + # clutter_dep, + # clutter_gtk_dep, folks_dep, geocode_glib_dep, gclue_dep, From f4f496fc5ff8a90ae0bcccf588a994c4486d6000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 23 Jul 2025 10:33:38 -0700 Subject: [PATCH 05/26] Easy API changes --- src/AgendaView.vala | 4 ++-- src/Application.vala | 3 ++- src/EventEdition/GuestGrid.vala | 4 ++-- src/EventEdition/InfoPanel.vala | 16 ++++++++-------- src/EventEdition/RepeatPanel.vala | 8 ++++---- src/Grid/CalendarView.vala | 4 ++-- src/MainWindow.vala | 4 ++-- src/Widgets/DateTimePicker.vala | 8 ++++---- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/AgendaView.vala b/src/AgendaView.vala index e7684078e..663636b43 100644 --- a/src/AgendaView.vala +++ b/src/AgendaView.vala @@ -10,7 +10,7 @@ public class Maya.View.AgendaView : Gtk.Box { public signal void event_removed (ECal.Component event); - public Hdy.HeaderBar header_bar { get; private set; } + public Adw.HeaderBar header_bar { get; private set; } private Gtk.Label day_label; private Gtk.Label weekday_label; @@ -35,7 +35,7 @@ public class Maya.View.AgendaView : Gtk.Box { }; weekday_label.get_style_context ().add_class (Granite.STYLE_CLASS_H2_LABEL); - header_bar = new Hdy.HeaderBar () { + header_bar = new Adw.HeaderBar () { show_close_button = true }; header_bar.pack_start (weekday_label); diff --git a/src/Application.vala b/src/Application.vala index 56fc47fe5..bfe00c875 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -63,7 +63,8 @@ namespace Maya { protected override void startup () { base.startup (); - Hdy.init (); + Granite.init (); + Adw.init (); var granite_settings = Granite.Settings.get_default (); var gtk_settings = Gtk.Settings.get_default (); diff --git a/src/EventEdition/GuestGrid.vala b/src/EventEdition/GuestGrid.vala index c420b4ae2..3d3933b50 100644 --- a/src/EventEdition/GuestGrid.vala +++ b/src/EventEdition/GuestGrid.vala @@ -25,7 +25,7 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { private Folks.Individual individual; private Gtk.Label name_label; private Gtk.Label mail_label; - private Hdy.Avatar avatar; + private Adw.Avatar avatar; public GuestGrid (ICal.Property attendee) { this.attendee = attendee.clone (); @@ -75,7 +75,7 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { get_contact_by_mail.begin (attendee.get_attendee ().replace ("mailto:", "")); - avatar = new Hdy.Avatar (ICON_SIZE, name_label.label, true); + avatar = new Adw.Avatar (ICON_SIZE, name_label.label, true); column_spacing = 12; margin = 6; diff --git a/src/EventEdition/InfoPanel.vala b/src/EventEdition/InfoPanel.vala index c40df4931..404162368 100644 --- a/src/EventEdition/InfoPanel.vala +++ b/src/EventEdition/InfoPanel.vala @@ -21,11 +21,11 @@ public class Maya.View.EventEdition.InfoPanel : Gtk.Grid { private Gtk.Entry title_entry; private Granite.HyperTextView comment_textview; - private Granite.Widgets.DatePicker from_date_picker; - private Granite.Widgets.DatePicker to_date_picker; + private Granite.DatePicker from_date_picker; + private Granite.DatePicker to_date_picker; private Gtk.Switch allday_switch; - private Granite.Widgets.TimePicker from_time_picker; - private Granite.Widgets.TimePicker to_time_picker; + private Granite.TimePicker from_time_picker; + private Granite.TimePicker to_time_picker; private Gtk.Label timezone_label; private Widgets.CalendarChooser calchooser; @@ -373,15 +373,15 @@ public class Maya.View.EventEdition.InfoPanel : Gtk.Grid { timezone_label.label = timezone.get_display_name (); } - Granite.Widgets.DatePicker make_date_picker () { + Granite.DatePicker make_date_picker () { var format = Granite.DateTime.get_default_date_format (false, true, true); - var date_picker = new Granite.Widgets.DatePicker.with_format (format); + var date_picker = new Granite.DatePicker.with_format (format); date_picker.width_request = 200; return date_picker; } - Granite.Widgets.TimePicker make_time_picker () { - var time_picker = new Granite.Widgets.TimePicker (); + Granite.TimePicker make_time_picker () { + var time_picker = new Granite.TimePicker (); time_picker.width_request = 120; return time_picker; } diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index 116635e0c..3b7376193 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -23,7 +23,7 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { private Gtk.ComboBoxText repeat_combobox; private Gtk.ComboBoxText ends_combobox; private Gtk.SpinButton end_entry; - private Granite.Widgets.DatePicker end_datepicker; + private Granite.DatePicker end_datepicker; private Gtk.Box week_box; private Gtk.Grid month_grid; private Gtk.SpinButton every_entry; @@ -174,7 +174,7 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { }); var format = Granite.DateTime.get_default_date_format (false, true, true); - end_datepicker = new Granite.Widgets.DatePicker.with_format (format); + end_datepicker = new Granite.DatePicker.with_format (format); end_datepicker.no_show_all = true; var ends_grid = new Gtk.Grid (); @@ -760,13 +760,13 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { } public class Maya.View.EventEdition.ExceptionGrid : Gtk.ListBoxRow { - private Granite.Widgets.DatePicker date; + private Granite.DatePicker date; public ExceptionGrid (GLib.DateTime dt) { set_margin_top (6); set_margin_start (6); set_margin_end (6); - date = new Granite.Widgets.DatePicker (); + date = new Granite.DatePicker (); date.date = dt; date.hexpand = true; diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index 6e50a9a1d..1946a1818 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -36,7 +36,7 @@ public class Maya.View.CalendarView : Gtk.Box { private Calendar.Widgets.DateSwitcher month_switcher; private Calendar.Widgets.DateSwitcher year_switcher; - public Hdy.HeaderBar header_bar { get; private set; } + public Adw.HeaderBar header_bar { get; private set; } public DateTime? selected_date { get; private set; } private WeekLabels weeks { get; private set; } @@ -157,7 +157,7 @@ public class Maya.View.CalendarView : Gtk.Box { tooltip_text = _("Manage Calendars") }; - header_bar = new Hdy.HeaderBar () { + header_bar = new Adw.HeaderBar () { show_close_button = true }; header_bar.pack_start (month_switcher); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index d00237aaa..c8868c9de 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -6,7 +6,7 @@ * Corentin Noël */ -public class Maya.MainWindow : Hdy.ApplicationWindow { +public class Maya.MainWindow : Gtk.ApplicationWindow { public View.CalendarView calview; public const string ACTION_PREFIX = "win."; @@ -56,7 +56,7 @@ public class Maya.MainWindow : Hdy.ApplicationWindow { child = hpaned; - var header_group = new Hdy.HeaderGroup (); + var header_group = new Adw.HeaderGroup (); header_group.add_header_bar (calview.header_bar); header_group.add_header_bar (sidebar.header_bar); diff --git a/src/Widgets/DateTimePicker.vala b/src/Widgets/DateTimePicker.vala index 634d07191..e108051c3 100644 --- a/src/Widgets/DateTimePicker.vala +++ b/src/Widgets/DateTimePicker.vala @@ -28,13 +28,13 @@ namespace Maya.View.Widgets { time_picker.time.get_second ()); } } - public Granite.Widgets.DatePicker date_picker { get; private set; } - public Granite.Widgets.TimePicker time_picker { get; private set; } + public Granite.DatePicker date_picker { get; private set; } + public Granite.TimePicker time_picker { get; private set; } public DateTimePicker () { - date_picker = new Granite.Widgets.DatePicker (); - time_picker = new Granite.Widgets.TimePicker (); + date_picker = new Granite.DatePicker (); + time_picker = new Granite.TimePicker (); // Grid properties set_column_spacing (10); From c389bbd676886ec89884b54d8fa39f91795bb32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 23 Jul 2025 10:43:12 -0700 Subject: [PATCH 06/26] Shumate marker, checkbutton --- src/EventEdition/LocationPanel.vala | 29 ++++--------------- src/EventEdition/RepeatPanel.vala | 8 +++--- src/Grid/GridDay.vala | 4 +-- src/SourceDialog/SourceDialog.vala | 44 ++++++++++++++--------------- src/Widgets/AgendaEventRow.vala | 4 +-- 5 files changed, 36 insertions(+), 53 deletions(-) diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index fe4959df8..7bc3f10d1 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -25,7 +25,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { private Gtk.EntryCompletion location_completion; private Gtk.ListStore location_store; private GtkChamplain.Embed champlain_embed; - private Maya.Marker point; + private Shumate.Marker point; // Only set the geo property if map_selected is true, this is a smart behavior! private bool map_selected = false; private GLib.Cancellable search_cancellable; @@ -89,7 +89,11 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { attach (frame, 0, 2, 1, 1); // Load the location - point = new Maya.Marker (); + point = new Shumate.Marker () { + child = new Gtk.Image.from_icon_name ("location-marker") { + icon_size = LARGE + } + }; point.draggable = parent_dialog.can_edit; point.drag_finish.connect (() => { map_selected = true; @@ -302,24 +306,3 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { return true; } } - -public class Maya.Marker : Champlain.Marker { - public Marker () { - try { - weak Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default (); - var pixbuf = icon_theme.load_icon ("location-marker", 32, Gtk.IconLookupFlags.GENERIC_FALLBACK); - Clutter.Image image = new Clutter.Image (); - image.set_data (pixbuf.get_pixels (), - pixbuf.has_alpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888, - pixbuf.width, - pixbuf.height, - pixbuf.rowstride); - content = image; - set_size (pixbuf.width, pixbuf.height); - translation_x = -pixbuf.width / 2; - translation_y = -pixbuf.height; - } catch (Error e) { - critical (e.message); - } - } -} diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index 3b7376193..eb459f73f 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -38,8 +38,8 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { private Gtk.ToggleButton sat_button; private Gtk.ToggleButton sun_button; - private Gtk.RadioButton every_radiobutton; - private Gtk.RadioButton same_radiobutton; + private Gtk.CheckButton every_radiobutton; + private Gtk.CheckButton same_radiobutton; public RepeatPanel (EventDialog parent_dialog) { this.parent_dialog = parent_dialog; @@ -190,8 +190,8 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { create_week_box (); week_box.sensitive = false; - same_radiobutton = new Gtk.RadioButton.with_label (null, _("The same day every month")); - every_radiobutton = new Gtk.RadioButton.from_widget (same_radiobutton); + same_radiobutton = new Gtk.CheckButton.with_label (null, _("The same day every month")); + every_radiobutton = new Gtk.CheckButton.from_widget (same_radiobutton); month_grid = new Gtk.Grid (); month_grid.row_spacing = 6; diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 5806d0130..89e97df2c 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -22,7 +22,7 @@ public class Maya.View.GridDay : Gtk.EventBox { private VAutoHider event_box; private GLib.HashTable event_buttons; private Gtk.EventControllerKey key_controller; - private Gtk.GestureMultiPress click_gesture; + private Gtk.GestureClick click_gesture; public bool in_current_month { set { @@ -73,7 +73,7 @@ public class Maya.View.GridDay : Gtk.EventBox { events |= Gdk.EventMask.SMOOTH_SCROLL_MASK; get_style_context ().add_class ("cell"); - click_gesture = new Gtk.GestureMultiPress (this) { + click_gesture = new Gtk.GestureClick (this) { button = Gdk.BUTTON_PRIMARY, propagation_phase = BUBBLE }; diff --git a/src/SourceDialog/SourceDialog.vala b/src/SourceDialog/SourceDialog.vala index 186a504bd..432dd35f9 100644 --- a/src/SourceDialog/SourceDialog.vala +++ b/src/SourceDialog/SourceDialog.vala @@ -34,17 +34,17 @@ public class Maya.View.SourceDialog : Granite.Dialog { private Gtk.CheckButton is_default_check; private E.Source source = null; - private Gtk.RadioButton color_button_blue; - private Gtk.RadioButton color_button_mint; - private Gtk.RadioButton color_button_green; - private Gtk.RadioButton color_button_yellow; - private Gtk.RadioButton color_button_orange; - private Gtk.RadioButton color_button_red; - private Gtk.RadioButton color_button_pink; - private Gtk.RadioButton color_button_purple; - private Gtk.RadioButton color_button_brown; - private Gtk.RadioButton color_button_slate; - private Gtk.RadioButton color_button_none; + private Gtk.CheckButton color_button_blue; + private Gtk.CheckButton color_button_mint; + private Gtk.CheckButton color_button_green; + private Gtk.CheckButton color_button_yellow; + private Gtk.CheckButton color_button_orange; + private Gtk.CheckButton color_button_red; + private Gtk.CheckButton color_button_pink; + private Gtk.CheckButton color_button_purple; + private Gtk.CheckButton color_button_brown; + private Gtk.CheckButton color_button_slate; + private Gtk.CheckButton color_button_none; public signal void go_back (); @@ -105,67 +105,67 @@ public class Maya.View.SourceDialog : Granite.Dialog { var color_label = new Gtk.Label (_("Color:")); color_label.xalign = 1; - color_button_blue = new Gtk.RadioButton (null); + color_button_blue = new Gtk.CheckButton (null); var color_button_blue_context = color_button_blue.get_style_context (); color_button_blue_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_blue_context.add_class ("blue"); - color_button_mint = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_mint = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_mint_context = color_button_mint.get_style_context (); color_button_mint_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_mint_context.add_class ("mint"); - color_button_green = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_green = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_green_context = color_button_green.get_style_context (); color_button_green_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_green_context.add_class ("green"); - color_button_yellow = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_yellow = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_yellow_context = color_button_yellow.get_style_context (); color_button_yellow_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_yellow_context.add_class ("yellow"); - color_button_orange = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_orange = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_orange_context = color_button_orange.get_style_context (); color_button_orange_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_orange_context.add_class ("orange"); - color_button_red = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_red = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_red_context = color_button_red.get_style_context (); color_button_red_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_red_context.add_class ("red"); - color_button_pink = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_pink = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_pink_context = color_button_pink.get_style_context (); color_button_pink_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_pink_context.add_class ("pink"); - color_button_purple = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_purple = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_purple_context = color_button_purple.get_style_context (); color_button_purple_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_purple_context.add_class ("purple"); - color_button_brown = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_brown = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_brown_context = color_button_brown.get_style_context (); color_button_brown_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_brown_context.add_class ("brown"); - color_button_slate = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_slate = new Gtk.CheckButton.from_widget (color_button_blue); var color_button_slate_context = color_button_slate.get_style_context (); color_button_slate_context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON); color_button_slate_context.add_class ("slate"); - color_button_none = new Gtk.RadioButton.from_widget (color_button_blue); + color_button_none = new Gtk.CheckButton.from_widget (color_button_blue); var color_grid = new Gtk.Grid () { column_spacing = 3 diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index d1c17c2f6..08125148c 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -36,7 +36,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { public Gtk.Revealer revealer { public get; private set; } - private Gtk.GestureMultiPress click_gesture; + private Gtk.GestureClick click_gesture; private Gtk.Image event_image; private Gtk.Label name_label; @@ -261,7 +261,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { revealer.set_reveal_child (false); }); - click_gesture = new Gtk.GestureMultiPress (this) { + click_gesture = new Gtk.GestureClick (this) { button = Gdk.BUTTON_SECONDARY, propagation_phase = BUBBLE }; From c3438033393909dd5648d0eb65b17a96db617cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 23 Jul 2025 10:47:04 -0700 Subject: [PATCH 07/26] Use Granite.Bin --- README.md | 2 +- meson.build | 2 +- src/Grid/GridDay.vala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4885658ee..311696fd4 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ You'll need the following dependencies: * libgeocode-glib-dev * libgeoclue-2-dev * libglib2.0-dev -* libgranite-dev >= 6.2.0 +* libgranite-7-dev >= 7.6.0 * libgtk-3-dev * libical-dev * libhandy-1-dev >= 0.90.0 diff --git a/meson.build b/meson.build index f8b458811..64ebe25d5 100644 --- a/meson.build +++ b/meson.build @@ -25,7 +25,7 @@ pkgconfig = import('pkgconfig') adw_dep = dependency('libadwaita-1', version: '>=1.0.0') glib_dep = dependency('glib-2.0') gee_dep = dependency('gee-0.8') -granite_dep = dependency('granite-7', version: '>=7.0.0') +granite_dep = dependency('granite-7', version: '>=7.6.0') gtk_dep = dependency('gtk4', version: '>=3.22') libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.45.1') libedataserverui_dep = dependency('libedataserverui4-1.0', version: '>= 3.46.4') diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 89e97df2c..40b4c634a 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -9,7 +9,7 @@ /** * Represents a single day on the grid. */ -public class Maya.View.GridDay : Gtk.EventBox { +public class Maya.View.GridDay : Granite.Bin { /* * Event emitted when the day is double clicked or the ENTER key is pressed. */ From 1396f11bdc37156faa6885cd059a6c2252833f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 12 Nov 2025 12:44:08 -0800 Subject: [PATCH 08/26] remove clutter deps --- meson.build | 2 -- 1 file changed, 2 deletions(-) diff --git a/meson.build b/meson.build index 120ba4fe4..7f44ca16f 100644 --- a/meson.build +++ b/meson.build @@ -31,8 +31,6 @@ libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.45.1') libedataserverui_dep = dependency('libedataserverui4-1.0', version: '>= 3.46.4') geocode_glib_dep = dependency('geocode-glib-2.0') gmodule_dep = dependency('gmodule-2.0') -# clutter_dep = dependency('clutter-1.0') -# clutter_gtk_dep = dependency('clutter-gtk-1.0') folks_dep = dependency('folks') gclue_dep = dependency('libgeoclue-2.0') libecal_dep = dependency('libecal-2.0') From 00f074bfa2a29fc50a576d21cf6df64f15432182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 15 Jan 2026 09:19:54 -0800 Subject: [PATCH 09/26] Modernize state saving --- data/io.elementary.calendar.gschema.xml | 13 +++++++++---- src/Application.vala | 16 +++++++++++----- src/MainWindow.vala | 24 ------------------------ 3 files changed, 20 insertions(+), 33 deletions(-) diff --git a/data/io.elementary.calendar.gschema.xml b/data/io.elementary.calendar.gschema.xml index f531321a0..6cd6074c0 100644 --- a/data/io.elementary.calendar.gschema.xml +++ b/data/io.elementary.calendar.gschema.xml @@ -12,10 +12,15 @@ Whether the window was maximized on last run Whether the window was maximized on last run - - (1024, 750) - Most recent window size - Most recent window size (width, height) + + 750 + Most recent window height + Most recent window height + + + 1024 + Most recent window width + Most recent window width true diff --git a/src/Application.vala b/src/Application.vala index bfe00c875..58be20265 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -151,17 +151,23 @@ namespace Maya { * Initializes the graphical window and its components */ void init_gui () { - var rect = Gtk.Allocation (); - saved_state.get ("window-size", "(ii)", out rect.width, out rect.height); - window = new MainWindow (this); window.title = _(Build.APP_NAME); - window.set_allocation (rect); - if (saved_state.get_boolean ("window-maximized")) { + /* + * This is very finicky. Bind size after present else set_titlebar gives us bad sizes + * Set maximize after height/width else window is min size on unmaximize + * Bind maximize as SET else get get bad sizes + */ + settings.bind ("window-height", window, "default-height", SettingsBindFlags.DEFAULT); + settings.bind ("window-width", window, "default-width", SettingsBindFlags.DEFAULT); + + if (settings.get_boolean ("window-maximized")) { window.maximize (); } + settings.bind ("window-maximized", main_window, "maximized", SettingsBindFlags.SET); + window.destroy.connect (on_quit); } diff --git a/src/MainWindow.vala b/src/MainWindow.vala index c8868c9de..4b4a45724 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -115,30 +115,6 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { } } - public override bool configure_event (Gdk.EventConfigure event) { - if (configure_id != 0) { - GLib.Source.remove (configure_id); - } - - configure_id = Timeout.add (100, () => { - configure_id = 0; - - if (is_maximized) { - Maya.Application.saved_state.set_boolean ("window-maximized", true); - } else { - Maya.Application.saved_state.set_boolean ("window-maximized", false); - - Gdk.Rectangle rect; - get_allocation (out rect); - Maya.Application.saved_state.set ("window-size", "(ii)", rect.width, rect.height); - } - - return GLib.Source.REMOVE; - }); - - return base.configure_event (event); - } - public override bool delete_event (Gdk.EventAny event) { ((Application) application).ask_for_background.begin ((obj, res) => { unowned var app = (Application) obj; From 58bca4976f8456787e94ae479e3fa23a0f8702ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 15 Jan 2026 09:27:44 -0800 Subject: [PATCH 10/26] =?UTF-8?q?Gtk.Bin=20=E2=86=92=20Granite.Bin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Widgets/DynamicSpinner.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/DynamicSpinner.vala b/src/Widgets/DynamicSpinner.vala index 15f3afb1b..0a1730b53 100644 --- a/src/Widgets/DynamicSpinner.vala +++ b/src/Widgets/DynamicSpinner.vala @@ -5,7 +5,7 @@ * Authored by: Corentin Noël */ -public class Maya.View.Widgets.DynamicSpinner : Gtk.Bin { +public class Maya.View.Widgets.DynamicSpinner : Granite.Bin { private Gtk.ListBox list_box; private Gtk.Revealer revealer; From a81bdc6b336568839164dc6a1ff87196f4831954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 16 Jan 2026 08:51:56 -0800 Subject: [PATCH 11/26] Controller syntax --- src/Grid/EventButton.vala | 10 +++++----- src/Grid/VAutoHider.vala | 2 +- src/Grid/WeekLabels.vala | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index a1031cbab..15cc53b7c 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -26,9 +26,6 @@ public class Maya.View.EventButton : Gtk.Revealer { private Gtk.Label label; private Gtk.StyleContext grid_style_context; - private Gtk.GestureMultiPress click_gesture; - private Gtk.GestureLongPress long_press_gesture; - public EventButton (ECal.Component comp) { Object ( comp: comp @@ -61,7 +58,7 @@ public class Maya.View.EventButton : Gtk.Revealer { add (event_box); - click_gesture = new Gtk.GestureMultiPress (this) { + var click_gesture = new Gtk.GestureClick () { button = 0 }; click_gesture.pressed.connect ((n_press, x, y) => { @@ -86,7 +83,7 @@ public class Maya.View.EventButton : Gtk.Revealer { } }); - long_press_gesture = new Gtk.GestureLongPress (this) { + var long_press_gesture = new Gtk.GestureLongPress () { touch_only = true }; long_press_gesture.pressed.connect ((x, y) => { @@ -102,6 +99,9 @@ public class Maya.View.EventButton : Gtk.Revealer { long_press_gesture.reset (); }); + add_controller (click_gesture); + add_controller (long_press_gesture); + Gtk.TargetEntry dnd = {"binary/calendar", 0, 0}; Gtk.TargetEntry dnd2 = {"text/uri-list", 0, 0}; Gtk.drag_source_set (event_box, Gdk.ModifierType.BUTTON1_MASK, {dnd, dnd2}, Gdk.DragAction.MOVE); diff --git a/src/Grid/VAutoHider.vala b/src/Grid/VAutoHider.vala index a72481941..40d2acba6 100644 --- a/src/Grid/VAutoHider.vala +++ b/src/Grid/VAutoHider.vala @@ -20,7 +20,7 @@ */ namespace Maya.View { - public class VAutoHider : Gtk.Bin { + public class VAutoHider : Granite.Bin { Gtk.Label more_label; Gtk.Box main_box; diff --git a/src/Grid/WeekLabels.vala b/src/Grid/WeekLabels.vala index 3b068f9dd..fffac60d4 100644 --- a/src/Grid/WeekLabels.vala +++ b/src/Grid/WeekLabels.vala @@ -21,7 +21,7 @@ /** * Represent the week labels at the left side of the grid. */ -public class Maya.View.WeekLabels : Gtk.Bin { +public class Maya.View.WeekLabels : Granite.Bin { private Gtk.Grid day_grid; private Gtk.Label[] labels; private int nr_of_weeks; @@ -29,9 +29,6 @@ public class Maya.View.WeekLabels : Gtk.Bin { private static GLib.Settings show_weeks; private static Gtk.CssProvider style_provider; - private Gtk.GestureMultiPress click_gesture; - private Gtk.GestureLongPress long_press_gesture; - static construct { style_provider = new Gtk.CssProvider (); style_provider.load_from_resource ("/io/elementary/calendar/WeekLabels.css"); @@ -79,7 +76,7 @@ public class Maya.View.WeekLabels : Gtk.Bin { attach_widget = this }; - click_gesture = new Gtk.GestureMultiPress (revealer) { + var click_gesture = new Gtk.GestureMultiPress () { button = 0 }; click_gesture.pressed.connect ((n_press, x, y) => { @@ -94,7 +91,7 @@ public class Maya.View.WeekLabels : Gtk.Bin { } }); - long_press_gesture = new Gtk.GestureLongPress (this) { + var long_press_gesture = new Gtk.GestureLongPress () { touch_only = true }; long_press_gesture.pressed.connect ((x, y) => { @@ -106,6 +103,9 @@ public class Maya.View.WeekLabels : Gtk.Bin { long_press_gesture.set_state (CLAIMED); long_press_gesture.reset (); }); + + add_controller (click_gesture); + add_controller (long_press_gesture); } public void update (DateTime date, int nr_of_weeks) { From 08b0656148dfc035114edf7c87a9f5f6836d20ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 16 Jan 2026 09:00:19 -0800 Subject: [PATCH 12/26] maps stuff --- src/EventEdition/LocationPanel.vala | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index 7bc3f10d1..cc90749cf 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -24,7 +24,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { private Gtk.SearchEntry location_entry; private Gtk.EntryCompletion location_completion; private Gtk.ListStore location_store; - private GtkChamplain.Embed champlain_embed; + private Shumate.SimpleMap simple_map; private Shumate.Marker point; // Only set the geo property if map_selected is true, this is a smart behavior! private bool map_selected = false; @@ -76,10 +76,19 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { location_completion.set_text_column (1); location_completion.match_selected.connect ((model, iter) => suggestion_selected (model, iter)); - champlain_embed = new GtkChamplain.Embed (); - var view = champlain_embed.champlain_view; - var marker_layer = new Champlain.MarkerLayer.full (Champlain.SelectionMode.SINGLE); - view.add_layer (marker_layer); + simple_map = new Shumate.SimpleMap () { + map_source = registry.get_by_id (Shumate.MAP_SOURCE_OSM_MAPNIK) + }; + + var marker_layer = new Shumate.MarkerLayer.full (simple_map.viewport, SINGLE);; + + var view = simple_map.viewport; + view.zoom_level = 10; + + var map = simple_map.map; + map.go_to_duration = 500; + map.add_layer (marker_layer);); + map.center_on (point.latitude, point.longitude); load_contact.begin (); @@ -115,8 +124,8 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { if (geo != null) { var latitude = geo.get_lat (); var longitude = geo.get_lon (); - if (latitude >= Champlain.MIN_LATITUDE && longitude >= Champlain.MIN_LONGITUDE && - latitude <= Champlain.MAX_LATITUDE && longitude <= Champlain.MAX_LONGITUDE) { + if (latitude >= Shumate.MIN_LATITUDE && longitude >= Shumate.MIN_LONGITUDE && + latitude <= Shumate.MAX_LATITUDE && longitude <= Shumate.MAX_LONGITUDE) { need_relocation = false; point.latitude = latitude; point.longitude = longitude; @@ -135,9 +144,6 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { } } - view.zoom_level = 10; - view.goto_animation_duration = 500; - view.center_on (point.latitude, point.longitude); marker_layer.add_marker (point); destroy.connect (() => { From d1d3e78b53af793b6509b6f8a1e435b3998887ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 16 Jan 2026 10:49:29 -0800 Subject: [PATCH 13/26] Fix extra semicolons --- data/meson.build | 2 +- src/EventEdition/LocationPanel.vala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/meson.build b/data/meson.build index 515473194..f9e09f927 100644 --- a/data/meson.build +++ b/data/meson.build @@ -50,7 +50,7 @@ i18n.merge_file( i18n.merge_file( input: 'calendar.metainfo.xml.in', output: meson.project_name() + '.metainfo.xml', - po_dir: meson.source_root() / 'po' / 'extra', + po_dir: meson.project_source_root() / 'po' / 'extra', type: 'xml', install: true, install_dir: get_option('datadir') / 'metainfo', diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index cc90749cf..3196b2d06 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -80,14 +80,14 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Grid { map_source = registry.get_by_id (Shumate.MAP_SOURCE_OSM_MAPNIK) }; - var marker_layer = new Shumate.MarkerLayer.full (simple_map.viewport, SINGLE);; + var marker_layer = new Shumate.MarkerLayer.full (simple_map.viewport, SINGLE); var view = simple_map.viewport; view.zoom_level = 10; var map = simple_map.map; map.go_to_duration = 500; - map.add_layer (marker_layer);); + map.add_layer (marker_layer); map.center_on (point.latitude, point.longitude); load_contact.begin (); From 7b3bcd7a4fc3931900bda93e019f2f6c92fffdb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 16 Jan 2026 11:23:18 -0800 Subject: [PATCH 14/26] Header: fix controller syntax, no eventbox --- src/Grid/Header.vala | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Grid/Header.vala b/src/Grid/Header.vala index 5574e9c76..63854fdce 100644 --- a/src/Grid/Header.vala +++ b/src/Grid/Header.vala @@ -24,15 +24,12 @@ namespace Maya.View { /** * Represents the header at the top of the calendar grid. */ -public class Header : Gtk.EventBox { +public class Header : Granite.Bin { private Gtk.Grid header_grid; private Gtk.Label[] labels; private static GLib.Settings show_weeks; - private Gtk.GestureMultiPress click_gesture; - private Gtk.GestureLongPress long_press_gesture; - static construct { if (Application.wingpanel_settings != null) { show_weeks = Application.wingpanel_settings; @@ -50,9 +47,6 @@ public class Header : Gtk.EventBox { header_grid.column_spacing = 0; header_grid.row_spacing = 0; - // EventBox properties - set_visible_window (true); // needed for style - labels = new Gtk.Label[7]; for (int c = 0; c < 7; c++) { labels[c] = new Gtk.Label (""); @@ -64,7 +58,7 @@ public class Header : Gtk.EventBox { header_grid.attach (labels[c], c, 0); } - add (header_grid); + child = header_grid; var action_show_weeks = show_weeks.create_action ("show-weeks"); @@ -80,7 +74,7 @@ public class Header : Gtk.EventBox { attach_widget = this }; - click_gesture = new Gtk.GestureMultiPress (this) { + var click_gesture = new Gtk.GestureClick () { button = 0 }; click_gesture.pressed.connect ((n_press, x, y) => { @@ -95,7 +89,7 @@ public class Header : Gtk.EventBox { } }); - long_press_gesture = new Gtk.GestureLongPress (this) { + var long_press_gesture = new Gtk.GestureLongPress () { touch_only = true }; long_press_gesture.pressed.connect ((x, y) => { @@ -107,6 +101,9 @@ public class Header : Gtk.EventBox { long_press_gesture.set_state (CLAIMED); long_press_gesture.reset (); }); + + add_controller (click_gesture); + add_controller (long_press_gesture); } public void update_columns (int week_starts_on) { From 95dfe091f59bf9285aea5b6b7b5c8b0f4e7dfecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 16 Jan 2026 08:22:39 -0800 Subject: [PATCH 15/26] EventMenu: Use GLib.Menu Fix remove item labels Fix extra whitespace --- src/Widgets/EventMenu.vala | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/src/Widgets/EventMenu.vala b/src/Widgets/EventMenu.vala index dd43ad947..51306f414 100644 --- a/src/Widgets/EventMenu.vala +++ b/src/Widgets/EventMenu.vala @@ -37,7 +37,6 @@ public class Maya.EventMenu : Gtk.Menu { action_add_exception.set_enabled (sensitive); action_add_exception.activate.connect (add_exception); - var action_group = new SimpleActionGroup (); action_group.add_action (action_edit); action_group.add_action (action_duplicate); @@ -46,36 +45,19 @@ public class Maya.EventMenu : Gtk.Menu { insert_action_group ("event", action_group); - var edit_item = new Gtk.MenuItem.with_label (_("Edit…")) { - action_name = "event.edit" - }; + var menu_model = new GLib.Menu (); + menu_model.append (_("Edit…"), "event.edit"); + menu_model.append (_("Duplicate…"), "event.duplicate"); - var duplicate_item = new Gtk.MenuItem.with_label (_("Duplicate…")) { - action_name = "event.duplicate" - }; + bind_model (menu_model, null, false); + show_all (); - Gtk.MenuItem remove_item; if (comp.has_recurrences ()) { - remove_item = new Gtk.MenuItem.with_label (_("Remove Event")) { - action_name = "event.remove" - }; - - var exception_item = new Gtk.MenuItem.with_label (_("Remove Occurrence")) { - action_name = "event.add-exception" - }; - - append (exception_item); + menu_model.prepend (_("Remove Event"), "event.remove"); + menu_model.insert (1, _("Remove Occurrence"), "event.add-exception"); } else { - remove_item = new Gtk.MenuItem.with_label (_("Remove")) { - action_name = "event.remove" - }; + menu_model.prepend (_("Remove"), "event.remove"); } - - append (remove_item); - append (edit_item); - append (duplicate_item); - - show_all (); } private void remove_event () { From f33917cabd41b6e2848247c5ffeae80a5f55bd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 16 Jan 2026 08:43:21 -0800 Subject: [PATCH 16/26] EventMenu: don't subclass menu Make it a namespace --- src/Grid/EventButton.vala | 13 ++++----- src/Widgets/AgendaEventRow.vala | 2 +- src/Widgets/EventMenu.vala | 47 +++++++++++++++------------------ 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index c4442fd6b..65c8bdeb6 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -53,6 +53,9 @@ public class Maya.View.EventButton : Gtk.Revealer { add (event_box); + var context_menu = Maya.EventMenu.build (comp); + context_menu.attach_to_widget (this, null); + click_gesture = new Gtk.GestureMultiPress (this) { button = 0 }; @@ -68,10 +71,7 @@ public class Maya.View.EventButton : Gtk.Revealer { } if (event.triggers_context_menu ()) { - var menu = new Maya.EventMenu (comp); - menu.attach_to_widget (this, null); - - menu.popup_at_pointer (event); + context_menu.popup_at_pointer (event); click_gesture.set_state (CLAIMED); click_gesture.reset (); @@ -85,10 +85,7 @@ public class Maya.View.EventButton : Gtk.Revealer { var sequence = long_press_gesture.get_current_sequence (); var event = long_press_gesture.get_last_event (sequence); - var menu = new Maya.EventMenu (comp); - menu.attach_to_widget (this, null); - - menu.popup_at_pointer (event); + context_menu.popup_at_pointer (event); long_press_gesture.set_state (CLAIMED); long_press_gesture.reset (); diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index f4163d5a8..cb1f41b1d 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -267,7 +267,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { } private void on_button_press (int n_press, double x, double y) { - var menu = new Maya.EventMenu (calevent); + var menu = Maya.EventMenu.build (calevent); menu.attach_to_widget (this, null); menu.popup_at_pointer (); } diff --git a/src/Widgets/EventMenu.vala b/src/Widgets/EventMenu.vala index 51306f414..122eab323 100644 --- a/src/Widgets/EventMenu.vala +++ b/src/Widgets/EventMenu.vala @@ -1,41 +1,28 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later - * SPDX-FileCopyrightText: 2011-2025 elementary, Inc. (https://elementary.io) + * SPDX-FileCopyrightText: 2011-2026 elementary, Inc. (https://elementary.io) * * Authored by: Maxwell Barvian * Corentin Noël */ -public class Maya.EventMenu : Gtk.Menu { - public ECal.Component comp { get; construct set; } - - public EventMenu (ECal.Component comp) { - Object (comp: comp); - } - - construct { - E.Source src = comp.get_data ("source"); - bool sensitive = src.writable == true && Calendar.EventStore.get_default ().calclient_is_readonly (src) == false; - +namespace Maya.EventMenu { + public static Gtk.Menu build (ECal.Component comp) { var action_edit = new GLib.SimpleAction ("edit", null); - action_edit.set_enabled (sensitive); action_edit.activate.connect (() => { ((Maya.Application) GLib.Application.get_default ()).window.on_modified (comp); }); var action_duplicate = new GLib.SimpleAction ("duplicate", null); - action_duplicate.set_enabled (sensitive); action_duplicate.activate.connect (() => { ((Maya.Application) GLib.Application.get_default ()).window.on_duplicated (comp); }); var action_remove = new GLib.SimpleAction ("remove", null); - action_remove.set_enabled (sensitive); - action_remove.activate.connect (remove_event); + action_remove.activate.connect (() => remove_event (comp)); var action_add_exception = new GLib.SimpleAction ("add-exception", null); - action_add_exception.set_enabled (sensitive); - action_add_exception.activate.connect (add_exception); + action_add_exception.activate.connect (() => add_exception (comp)); var action_group = new SimpleActionGroup (); action_group.add_action (action_edit); @@ -43,24 +30,34 @@ public class Maya.EventMenu : Gtk.Menu { action_group.add_action (action_remove); action_group.add_action (action_add_exception); - insert_action_group ("event", action_group); - var menu_model = new GLib.Menu (); menu_model.append (_("Edit…"), "event.edit"); menu_model.append (_("Duplicate…"), "event.duplicate"); - bind_model (menu_model, null, false); - show_all (); - if (comp.has_recurrences ()) { menu_model.prepend (_("Remove Event"), "event.remove"); menu_model.insert (1, _("Remove Occurrence"), "event.add-exception"); } else { menu_model.prepend (_("Remove"), "event.remove"); } + + var menu = new Gtk.Menu.from_model (menu_model); + menu.insert_action_group ("event", action_group); + + E.Source src = comp.get_data ("source"); + menu.popped_up.connect (() => { + var sensitive = src.writable == true && Calendar.EventStore.get_default ().calclient_is_readonly (src) == false; + + action_edit.set_enabled (sensitive); + action_duplicate.set_enabled (sensitive); + action_remove.set_enabled (sensitive); + action_add_exception.set_enabled (sensitive); + }); + + return menu; } - private void remove_event () { + private static void remove_event (ECal.Component comp) { var application = (Gtk.Application) GLib.Application.get_default (); var source = comp.get_data ("source"); var delete_dialog = new Calendar.DeleteEventDialog (source, comp, ECal.ObjModType.ALL) { @@ -69,7 +66,7 @@ public class Maya.EventMenu : Gtk.Menu { delete_dialog.run_dialog (); } - private void add_exception () { + private static void add_exception (ECal.Component comp) { var application = (Gtk.Application) GLib.Application.get_default (); var source = comp.get_data ("source"); var delete_dialog = new Calendar.DeleteEventDialog (source, comp, ECal.ObjModType.THIS) { From 89af9654ac85d7133d8b8eadc9623485165b63b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 20 Jan 2026 09:42:17 -0800 Subject: [PATCH 17/26] Replace Gtk.Menu with Gtk.PopoverMenu --- src/Widgets/EventMenu.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Widgets/EventMenu.vala b/src/Widgets/EventMenu.vala index 122eab323..928f4693b 100644 --- a/src/Widgets/EventMenu.vala +++ b/src/Widgets/EventMenu.vala @@ -7,7 +7,7 @@ */ namespace Maya.EventMenu { - public static Gtk.Menu build (ECal.Component comp) { + public static Gtk.PopoverMenu build (ECal.Component comp) { var action_edit = new GLib.SimpleAction ("edit", null); action_edit.activate.connect (() => { ((Maya.Application) GLib.Application.get_default ()).window.on_modified (comp); @@ -41,7 +41,7 @@ namespace Maya.EventMenu { menu_model.prepend (_("Remove"), "event.remove"); } - var menu = new Gtk.Menu.from_model (menu_model); + var menu = new Gtk.PopoverMenu.from_model (menu_model); menu.insert_action_group ("event", action_group); E.Source src = comp.get_data ("source"); From f7bab8954dd38e6bbfa2a5f42cbf8c014b5fe7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 20 Jan 2026 09:43:39 -0800 Subject: [PATCH 18/26] Next stage --- src/Grid/EventButton.vala | 36 +++++++++++++------------- src/Grid/GridDay.vala | 54 +++++++++++++++++++-------------------- src/MainWindow.vala | 24 ++++++++--------- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index 5676bbe2c..4f82a6226 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -91,24 +91,24 @@ public class Maya.View.EventButton : Gtk.Revealer { add_controller (click_gesture); add_controller (long_press_gesture); - Gtk.TargetEntry dnd = {"binary/calendar", 0, 0}; - Gtk.TargetEntry dnd2 = {"text/uri-list", 0, 0}; - Gtk.drag_source_set (event_box, Gdk.ModifierType.BUTTON1_MASK, {dnd, dnd2}, Gdk.DragAction.MOVE); - - event_box.drag_data_get.connect ( (ctx, sel, info, time) => { - Calendar.EventStore.get_default ().drag_component = comp; - unowned ICal.Component icalcomp = comp.get_icalcomponent (); - var ical_str = icalcomp.as_ical_string (); - sel.set_text (ical_str, ical_str.length); - try { - var path = GLib.Path.build_filename (GLib.Environment.get_tmp_dir (), icalcomp.get_summary () + ".ics"); - var file = File.new_for_path (path); - if (file.replace_contents (ical_str.data, null, false, FileCreateFlags.PRIVATE, null)) - sel.set_uris ({file.get_uri ()}); - } catch (Error e) { - critical (e.message); - } - }); + // Gtk.TargetEntry dnd = {"binary/calendar", 0, 0}; + // Gtk.TargetEntry dnd2 = {"text/uri-list", 0, 0}; + // Gtk.drag_source_set (event_box, Gdk.ModifierType.BUTTON1_MASK, {dnd, dnd2}, Gdk.DragAction.MOVE); + + // event_box.drag_data_get.connect ( (ctx, sel, info, time) => { + // Calendar.EventStore.get_default ().drag_component = comp; + // unowned ICal.Component icalcomp = comp.get_icalcomponent (); + // var ical_str = icalcomp.as_ical_string (); + // sel.set_text (ical_str, ical_str.length); + // try { + // var path = GLib.Path.build_filename (GLib.Environment.get_tmp_dir (), icalcomp.get_summary () + ".ics"); + // var file = File.new_for_path (path); + // if (file.replace_contents (ical_str.data, null, false, FileCreateFlags.PRIVATE, null)) + // sel.set_uris ({file.get_uri ()}); + // } catch (Error e) { + // critical (e.message); + // } + // }); E.Source source = comp.get_data ("source"); diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 2fd24ba41..58a4938d6 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -73,8 +73,8 @@ public class Maya.View.GridDay : Granite.Bin { }; key_controller.key_pressed.connect (on_key_press); - Gtk.TargetEntry dnd = {"binary/calendar", 0, 0}; - Gtk.drag_dest_set (this, Gtk.DestDefaults.MOTION, {dnd}, Gdk.DragAction.MOVE); + // Gtk.TargetEntry dnd = {"binary/calendar", 0, 0}; + // Gtk.drag_dest_set (this, Gtk.DestDefaults.MOTION, {dnd}, Gdk.DragAction.MOVE); this.bind_property ("date", label, "label", BindingFlags.SYNC_CREATE, (binding, srcval, ref targetval) => { unowned var date = (GLib.DateTime) srcval.get_boxed (); @@ -83,31 +83,31 @@ public class Maya.View.GridDay : Granite.Bin { }); } - public override bool drag_drop (Gdk.DragContext context, int x, int y, uint time_) { - Gtk.drag_finish (context, true, false, time_); - Gdk.Atom atom = Gtk.drag_dest_find_target (this, context, Gtk.drag_dest_get_target_list (this)); - Gtk.drag_get_data (this, context, atom, time_); - return true; - } - - public override void drag_data_received (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time_) { - var calmodel = Calendar.EventStore.get_default (); - var comp = calmodel.drag_component; - unowned ICal.Component icalcomp = comp.get_icalcomponent (); - E.Source src = comp.get_data ("source"); - var start = icalcomp.get_dtstart (); - var end = icalcomp.get_dtend (); - var gap = date.get_day_of_month () - start.get_day (); - start.set_day (start.get_day () + gap); - - if (!end.is_null_time ()) { - end.set_day (end.get_day () + gap); - icalcomp.set_dtend (end); - } - - icalcomp.set_dtstart (start); - calmodel.update_event (src, comp, ECal.ObjModType.ALL); - } + // public override bool drag_drop (Gdk.DragContext context, int x, int y, uint time_) { + // Gtk.drag_finish (context, true, false, time_); + // Gdk.Atom atom = Gtk.drag_dest_find_target (this, context, Gtk.drag_dest_get_target_list (this)); + // Gtk.drag_get_data (this, context, atom, time_); + // return true; + // } + + // public override void drag_data_received (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time_) { + // var calmodel = Calendar.EventStore.get_default (); + // var comp = calmodel.drag_component; + // unowned ICal.Component icalcomp = comp.get_icalcomponent (); + // E.Source src = comp.get_data ("source"); + // var start = icalcomp.get_dtstart (); + // var end = icalcomp.get_dtend (); + // var gap = date.get_day_of_month () - start.get_day (); + // start.set_day (start.get_day () + gap); + + // if (!end.is_null_time ()) { + // end.set_day (end.get_day () + gap); + // icalcomp.set_dtend (end); + // } + + // icalcomp.set_dtstart (start); + // calmodel.update_event (src, comp, ECal.ObjModType.ALL); + // } public void add_event_button (EventButton button) { string uid = button.get_uid (); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index fff8d621d..3e5d40913 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -116,16 +116,16 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { } } - public override bool delete_event (Gdk.EventAny event) { - ((Application) application).ask_for_background.begin ((obj, res) => { - unowned var app = (Application) obj; - if (app.ask_for_background.end (res)) { - hide (); - } else { - destroy (); - } - }); - - return Gdk.EVENT_STOP; - } + // public override bool delete_event (Gdk.EventAny event) { + // ((Application) application).ask_for_background.begin ((obj, res) => { + // unowned var app = (Application) obj; + // if (app.ask_for_background.end (res)) { + // hide (); + // } else { + // destroy (); + // } + // }); + + // return Gdk.EVENT_STOP; + // } } From 57e888236fb2ca34bbf05df6382490681f77cb7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 20 Jan 2026 10:09:02 -0800 Subject: [PATCH 19/26] Little syntax changes --- README.md | 2 +- meson.build | 4 +- src/AgendaView.vala | 36 ++++----- src/Application.vala | 18 ----- src/EventEdition/EventDialog.vala | 16 ++-- src/EventEdition/GuestGrid.vala | 11 +-- src/EventEdition/GuestsPanel.vala | 2 +- src/EventEdition/InfoPanel.vala | 4 +- src/EventEdition/ReminderPanel.vala | 21 ++--- src/EventEdition/RepeatPanel.vala | 114 ++++++++++++++-------------- src/Grid/CalendarView.vala | 22 ++---- src/Grid/EventButton.vala | 2 +- src/Grid/Grid.vala | 1 - src/Grid/GridDay.vala | 11 ++- src/Grid/VAutoHider.vala | 2 +- src/ImportDialog.vala | 4 +- src/MainWindow.vala | 1 - src/SourceDialog/SourceDialog.vala | 46 ++++++----- src/Widgets/AgendaEventRow.vala | 20 ++--- src/Widgets/CalendarChooser.vala | 6 +- src/Widgets/CalendarRow.vala | 4 +- src/Widgets/DateSwitcher.vala | 6 +- src/Widgets/DeleteDialog.vala | 2 +- src/Widgets/DynamicSpinner.vala | 13 ++-- src/Widgets/SourcePopover.vala | 15 ++-- src/Widgets/SourceRow.vala | 16 ++-- 26 files changed, 181 insertions(+), 218 deletions(-) diff --git a/README.md b/README.md index 311696fd4..d0fb22311 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You'll need the following dependencies: * libgeoclue-2-dev * libglib2.0-dev * libgranite-7-dev >= 7.6.0 -* libgtk-3-dev +* libgtk-4-dev >= 4.12 * libical-dev * libhandy-1-dev >= 0.90.0 * meson diff --git a/meson.build b/meson.build index 7f44ca16f..2fc8faeb8 100644 --- a/meson.build +++ b/meson.build @@ -25,8 +25,8 @@ pkgconfig = import('pkgconfig') adw_dep = dependency('libadwaita-1', version: '>=1.0.0') glib_dep = dependency('glib-2.0') gee_dep = dependency('gee-0.8') -granite_dep = dependency('granite-7', version: '>=7.6.0') -gtk_dep = dependency('gtk4', version: '>=3.22') +granite_dep = dependency('granite-7', version: '>=7.7.0') +gtk_dep = dependency('gtk4', version: '>=4.12') libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.45.1') libedataserverui_dep = dependency('libedataserverui4-1.0', version: '>= 3.46.4') geocode_glib_dep = dependency('geocode-glib-2.0') diff --git a/src/AgendaView.vala b/src/AgendaView.vala index 663636b43..58be09537 100644 --- a/src/AgendaView.vala +++ b/src/AgendaView.vala @@ -21,7 +21,7 @@ public class Maya.View.AgendaView : Gtk.Box { construct { var application_instance = ((Gtk.Application) GLib.Application.get_default ()); - var button_add = new Gtk.Button.from_icon_name ("appointment-new", Gtk.IconSize.LARGE_TOOLBAR) { + var button_add = new Gtk.Button.from_icon_name ("appointment-new") { action_name = Maya.MainWindow.ACTION_PREFIX + Maya.MainWindow.ACTION_NEW_EVENT }; button_add.tooltip_markup = Granite.markup_accel_tooltip ( @@ -33,21 +33,19 @@ public class Maya.View.AgendaView : Gtk.Box { margin_start = 6, xalign = 0 }; - weekday_label.get_style_context ().add_class (Granite.STYLE_CLASS_H2_LABEL); + weekday_label.add_css_class (Granite.STYLE_CLASS_H2_LABEL); - header_bar = new Adw.HeaderBar () { - show_close_button = true - }; + header_bar = new Adw.HeaderBar (); header_bar.pack_start (weekday_label); header_bar.pack_end (button_add); - header_bar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); + header_bar.add_css_class (Granite.STYLE_CLASS_FLAT); day_label = new Gtk.Label ("") { margin_start = 12, margin_end = 12, xalign = 0 }; - day_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL); + day_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); var placeholder_label = new Gtk.Label (_("Your upcoming events will be displayed here when you select a date with events.")) { wrap = true, @@ -56,8 +54,7 @@ public class Maya.View.AgendaView : Gtk.Box { margin_end = 12, justify = CENTER }; - placeholder_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); - placeholder_label.show_all (); + placeholder_label.add_css_class (Granite.CssClass.DIM); selected_date_events_list = new Gtk.ListBox () { activate_on_single_click = false, @@ -103,20 +100,20 @@ public class Maya.View.AgendaView : Gtk.Box { }); var box = new Gtk.Box (VERTICAL, 0); - box.add (day_label); - box.add (selected_date_events_list); - box.add (upcoming_events_list); + box.append (day_label); + box.append (selected_date_events_list); + box.append (upcoming_events_list); - var scrolled_window = new Gtk.ScrolledWindow (null, null) { + var scrolled_window = new Gtk.ScrolledWindow () { hscrollbar_policy = NEVER, child = box, vexpand = true }; orientation = VERTICAL; - add (header_bar); - add (scrolled_window); - get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW); + append (header_bar); + append (scrolled_window); + add_css_class (Granite.STYLE_CLASS_VIEW); // Listen to changes for events var calmodel = Calendar.EventStore.get_default (); @@ -129,7 +126,6 @@ public class Maya.View.AgendaView : Gtk.Box { time_manager.on_update_today.connect (on_today_changed); set_selected_date (Maya.Application.get_selected_datetime ()); - show_all (); selected_date_events_list.row_activated.connect (activate_eventrow); upcoming_events_list.row_activated.connect (activate_eventrow); @@ -303,13 +299,11 @@ public class Maya.View.AgendaView : Gtk.Box { foreach (var event in events) { var row = new AgendaEventRow (source, event, false); row.removed.connect ((event) => (event_removed (event))); - row.show_all (); - selected_date_events_list.add (row); + selected_date_events_list.append (row); var row2 = new AgendaEventRow (source, event, true); row2.removed.connect ((event) => (event_removed (event))); - row2.show_all (); - upcoming_events_list.add (row2); + upcoming_events_list.append (row2); } } diff --git a/src/Application.vala b/src/Application.vala index cdde1d5d3..a5cfde682 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -66,24 +66,6 @@ namespace Maya { Granite.init (); Adw.init (); - var style_provider = new Gtk.CssProvider (); - style_provider.load_from_resource ("/io/elementary/calendar/Application.css"); - - Gtk.StyleContext.add_provider_for_screen ( - Gdk.Screen.get_default (), - style_provider, - Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION - ); - - var granite_settings = Granite.Settings.get_default (); - var gtk_settings = Gtk.Settings.get_default (); - - gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK; - - granite_settings.notify["prefers-color-scheme"].connect (() => { - gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK; - }); - var quit_action = new SimpleAction ("quit", null); quit_action.activate.connect (quit); diff --git a/src/EventEdition/EventDialog.vala b/src/EventEdition/EventDialog.vala index 262e16419..b5df5585d 100644 --- a/src/EventEdition/EventDialog.vala +++ b/src/EventEdition/EventDialog.vala @@ -147,14 +147,14 @@ public class EventDialog : Granite.Dialog { halign = START, hexpand = true }; - delete_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + delete_button.add_css_class (Granite.CssClass.DESTRUCTIVE_ACTION); delete_button.clicked.connect (remove_event); - buttonbox.add (delete_button); + buttonbox.append (delete_button); } var create_button = new Gtk.Button (); - create_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); + create_button.add_css_class (Granite.CssClass.SUGGESTED_ACTION); create_button.clicked.connect (save_dialog); if (date_time != null) { @@ -167,17 +167,17 @@ public class EventDialog : Granite.Dialog { var cancel_button = new Gtk.Button.with_label (_("Cancel")); cancel_button.clicked.connect (() => {this.destroy ();}); - buttonbox.add (cancel_button); - buttonbox.add (create_button); + buttonbox.append (cancel_button); + buttonbox.append (create_button); var button_sizegroup = new Gtk.SizeGroup (HORIZONTAL); button_sizegroup.add_widget (cancel_button); button_sizegroup.add_widget (create_button); var box = new Gtk.Box (VERTICAL, 24); - box.add (stack_switcher); - box.add (stack); - box.add (buttonbox); + box.append (stack_switcher); + box.append (stack); + box.append (buttonbox); box.show_all (); get_content_area ().add (box); diff --git a/src/EventEdition/GuestGrid.vala b/src/EventEdition/GuestGrid.vala index 3d3933b50..c6d2fb8ff 100644 --- a/src/EventEdition/GuestGrid.vala +++ b/src/EventEdition/GuestGrid.vala @@ -47,11 +47,11 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { break; case ICal.ParameterPartstat.DECLINED: status_label.label = _("Declined"); - status_label_context.add_class (Gtk.STYLE_CLASS_ERROR); + status_label_context.add_class (Granite.CssClass.ERROR); break; case ICal.ParameterPartstat.TENTATIVE: status_label.label = _("Maybe"); - status_label_context.add_class (Gtk.STYLE_CLASS_ERROR); + status_label_context.add_class (Granite.CssClass.ERROR); break; default: break; @@ -69,9 +69,10 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { mail_label.hexpand = true; mail_label.xalign = 0; - var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.BUTTON); - remove_button.relief = Gtk.ReliefStyle.NONE; - remove_button.valign = Gtk.Align.CENTER; + var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic") { + has_frame = false, + valign = CENTER + }; get_contact_by_mail.begin (attendee.get_attendee ().replace ("mailto:", "")); diff --git a/src/EventEdition/GuestsPanel.vala b/src/EventEdition/GuestsPanel.vala index ecdde57a8..db2a308f6 100644 --- a/src/EventEdition/GuestsPanel.vala +++ b/src/EventEdition/GuestsPanel.vala @@ -59,7 +59,7 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Grid { unowned Gtk.StyleContext no_guests_context = no_guests_label.get_style_context (); no_guests_context.add_class (Granite.STYLE_CLASS_H3_LABEL); - no_guests_context.add_class (Gtk.STYLE_CLASS_DIM_LABEL); + no_guests_context.add_class (Granite.CssClass.DIM_LABEL); guest_list = new Gtk.ListBox (); guest_list.set_selection_mode (Gtk.SelectionMode.NONE); diff --git a/src/EventEdition/InfoPanel.vala b/src/EventEdition/InfoPanel.vala index 404162368..6a92f4688 100644 --- a/src/EventEdition/InfoPanel.vala +++ b/src/EventEdition/InfoPanel.vala @@ -161,8 +161,8 @@ public class Maya.View.EventEdition.InfoPanel : Gtk.Grid { }; var button_box = new Gtk.Box (HORIZONTAL, 6); - button_box.add (current_calendar_grid); - button_box.add (new Gtk.Image.from_icon_name ("pan-down-symbolic", Gtk.IconSize.MENU)); + button_box.append (current_calendar_grid); + button_box.append (new Gtk.Image.from_icon_name ("pan-down-symbolic")); var calendar_button = new Gtk.MenuButton () { child = button_box, diff --git a/src/EventEdition/ReminderPanel.vala b/src/EventEdition/ReminderPanel.vala index 8b275d07f..e2c122ad1 100644 --- a/src/EventEdition/ReminderPanel.vala +++ b/src/EventEdition/ReminderPanel.vala @@ -23,7 +23,7 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Grid { no_reminder_label.show (); no_reminder_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL); - no_reminder_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + no_reminder_label.get_style_context ().add_class (Granite.CssClass.DIM_LABEL); reminders = new Gee.ArrayList (); reminders_to_remove = new Gee.ArrayList (); @@ -46,21 +46,21 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Grid { }; var add_button_box = new Gtk.Box (HORIZONTAL, 0); - add_button_box.add (new Gtk.Image.from_icon_name ("list-add-symbolic", BUTTON)); - add_button_box.add (new Gtk.Label (_("Add Reminder"))); + add_button_box.append (new Gtk.Image.from_icon_name ("list-add-symbolic", BUTTON)); + add_button_box.append (new Gtk.Label (_("Add Reminder"))); var add_button = new Gtk.Button () { child = add_button_box }; - add_button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); + add_button.get_style_context ().add_class (Granite.CssClass.FLAT); var inline_toolbar = new Gtk.ActionBar (); - inline_toolbar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); + inline_toolbar.get_style_context ().add_class (Granite.CssClass.FLAT); inline_toolbar.add (add_button); var box = new Gtk.Box (VERTICAL, 0); - box.add (scrolled); - box.add (inline_toolbar); + box.append (scrolled); + box.append (inline_toolbar); var frame = new Gtk.Frame (null) { child = box, @@ -190,9 +190,10 @@ public class Maya.View.EventEdition.ReminderGrid : Gtk.ListBoxRow { } }); - var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.BUTTON); - remove_button.relief = Gtk.ReliefStyle.NONE; - remove_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic") { + has_frame = false + }; + remove_button.add_css_class (Granite.CssClass.DESTRUCTIVE); var grid = new Gtk.Grid (); grid.margin = 6; diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index eb459f73f..decfa8f95 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -208,7 +208,7 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { unowned Gtk.StyleContext no_exceptions_context = no_exceptions_label.get_style_context (); no_exceptions_context.add_class (Granite.STYLE_CLASS_H3_LABEL); - no_exceptions_context.add_class (Gtk.STYLE_CLASS_DIM_LABEL); + no_exceptions_context.add_class (Granite.CssClass.DIM_LABEL); exceptions_list = new Gtk.ListBox (); exceptions_list.expand = true; @@ -219,14 +219,15 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { exceptions_scrolled.add (exceptions_list); exceptions_scrolled.expand = true; - var add_button = new Gtk.Button.with_label (_("Add Exception")); + var add_button = new Gtk.Button.with_label (_("Add Exception")) { + has_frame = false + }; add_button.always_show_image = true; add_button.image = new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.BUTTON); add_button.margin = 3; - add_button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); var inline_toolbar = new Gtk.ActionBar (); - inline_toolbar.get_style_context ().add_class (Gtk.STYLE_CLASS_INLINE_TOOLBAR); + inline_toolbar.get_style_context ().add_class (Granite.CssClass.INLINE_TOOLBAR); inline_toolbar.add (add_button); var exceptions_grid = new Gtk.Grid (); @@ -542,71 +543,71 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid { fri_button = new Gtk.ToggleButton.with_label (_("Fri")); sat_button = new Gtk.ToggleButton.with_label (_("Sat")); sun_button = new Gtk.ToggleButton.with_label (_("Sun")); - week_box.get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED); + week_box.get_style_context ().add_class (Granite.CssClass.LINKED); week_box.get_style_context ().add_class ("raised"); switch (Calendar.EventStore.get_default ().week_starts_on) { case GLib.DateWeekday.TUESDAY: - week_box.add (thu_button); - week_box.add (fri_button); - week_box.add (sat_button); - week_box.add (sun_button); - week_box.add (mon_button); - week_box.add (tue_button); - week_box.add (wed_button); + week_box.append (thu_button); + week_box.append (fri_button); + week_box.append (sat_button); + week_box.append (sun_button); + week_box.append (mon_button); + week_box.append (tue_button); + week_box.append (wed_button); break; case GLib.DateWeekday.WEDNESDAY: - week_box.add (wed_button); - week_box.add (thu_button); - week_box.add (fri_button); - week_box.add (sat_button); - week_box.add (sun_button); - week_box.add (mon_button); - week_box.add (tue_button); + week_box.append (wed_button); + week_box.append (thu_button); + week_box.append (fri_button); + week_box.append (sat_button); + week_box.append (sun_button); + week_box.append (mon_button); + week_box.append (tue_button); break; case GLib.DateWeekday.THURSDAY: - week_box.add (thu_button); - week_box.add (fri_button); - week_box.add (sat_button); - week_box.add (sun_button); - week_box.add (mon_button); - week_box.add (tue_button); - week_box.add (wed_button); + week_box.append (thu_button); + week_box.append (fri_button); + week_box.append (sat_button); + week_box.append (sun_button); + week_box.append (mon_button); + week_box.append (tue_button); + week_box.append (wed_button); break; case GLib.DateWeekday.FRIDAY: - week_box.add (fri_button); - week_box.add (sat_button); - week_box.add (sun_button); - week_box.add (mon_button); - week_box.add (tue_button); - week_box.add (wed_button); - week_box.add (thu_button); + week_box.append (fri_button); + week_box.append (sat_button); + week_box.append (sun_button); + week_box.append (mon_button); + week_box.append (tue_button); + week_box.append (wed_button); + week_box.append (thu_button); break; case GLib.DateWeekday.SATURDAY: - week_box.add (sat_button); - week_box.add (sun_button); - week_box.add (mon_button); - week_box.add (tue_button); - week_box.add (wed_button); - week_box.add (thu_button); - week_box.add (fri_button); + week_box.append (sat_button); + week_box.append (sun_button); + week_box.append (mon_button); + week_box.append (tue_button); + week_box.append (wed_button); + week_box.append (thu_button); + week_box.append (fri_button); break; case GLib.DateWeekday.SUNDAY: - week_box.add (sun_button); - week_box.add (mon_button); - week_box.add (tue_button); - week_box.add (wed_button); - week_box.add (thu_button); - week_box.add (fri_button); - week_box.add (sat_button); + week_box.append (sun_button); + week_box.append (mon_button); + week_box.append (tue_button); + week_box.append (wed_button); + week_box.append (thu_button); + week_box.append (fri_button); + week_box.append (sat_button); break; default: - week_box.add (mon_button); - week_box.add (tue_button); - week_box.add (wed_button); - week_box.add (thu_button); - week_box.add (fri_button); - week_box.add (sat_button); - week_box.add (sun_button); + week_box.append (mon_button); + week_box.append (tue_button); + week_box.append (wed_button); + week_box.append (thu_button); + week_box.append (fri_button); + week_box.append (sat_button); + week_box.append (sun_button); break; } } @@ -770,8 +771,9 @@ public class Maya.View.EventEdition.ExceptionGrid : Gtk.ListBoxRow { date.date = dt; date.hexpand = true; - var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.BUTTON); - remove_button.relief = Gtk.ReliefStyle.NONE; + var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic") { + has_frame = false + }; remove_button.clicked.connect (() => {hide (); destroy ();}); var grid = new Gtk.Grid (); diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index 32f730a63..ab650bf69 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -119,7 +119,7 @@ public class Maya.View.CalendarView : Gtk.Box { var application_instance = ((Gtk.Application) GLib.Application.get_default ()); - var button_today = new Gtk.Button.from_icon_name ("calendar-go-today", Gtk.IconSize.LARGE_TOOLBAR) { + var button_today = new Gtk.Button.from_icon_name ("calendar-go-today") { action_name = Maya.MainWindow.ACTION_PREFIX + Maya.MainWindow.ACTION_SHOW_TODAY }; button_today.tooltip_markup = Granite.markup_accel_tooltip ( @@ -148,7 +148,7 @@ public class Maya.View.CalendarView : Gtk.Box { var source_popover = new Calendar.Widgets.SourcePopover (); var menu_button = new Gtk.MenuButton () { - image = new Gtk.Image.from_icon_name ("open-menu", Gtk.IconSize.LARGE_TOOLBAR), + icon_name = "open-menu", popover = source_popover, tooltip_text = _("Manage Calendars") }; @@ -163,7 +163,7 @@ public class Maya.View.CalendarView : Gtk.Box { header_bar.pack_end (contractor); header_bar.pack_end (spinner); - header_bar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); + header_bar.add_css_class (Granite.STYLE_CLASS_FLAT); stack = new Gtk.Stack (); stack.expand = true; @@ -190,17 +190,12 @@ public class Maya.View.CalendarView : Gtk.Box { show_weeks.changed["show-weeks"].connect (on_show_weeks_changed); show_weeks.get_value ("show-weeks"); - events |= Gdk.EventMask.BUTTON_PRESS_MASK; - events |= Gdk.EventMask.KEY_PRESS_MASK; - events |= Gdk.EventMask.SCROLL_MASK; - events |= Gdk.EventMask.SMOOTH_SCROLL_MASK; orientation = VERTICAL; - get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW); - add (header_bar); - add (error_bar); - add (info_bar); - add (stack); - show_all (); + add_css_class (Granite.STYLE_CLASS_VIEW); + append (header_bar); + append (error_bar); + append (info_bar); + append (stack); error_bar.response.connect ((id) => error_bar.set_revealed (false)); @@ -357,7 +352,6 @@ public class Maya.View.CalendarView : Gtk.Box { new_big_grid.attach (header, 1, 0, 1, 1); new_big_grid.attach (days_grid, 1, 1, 1, 1); new_big_grid.attach (weeks, 0, 1, 1, 1); - new_big_grid.show_all (); new_big_grid.expand = true; update_spacer_visible (); diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index 4f82a6226..106787ecd 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -46,7 +46,7 @@ public class Maya.View.EventButton : Gtk.Revealer { grid_style_context.add_class ("event"); var event_box = new Gtk.EventBox (); - event_box.add (internal_grid); + event_box.append (internal_grid); add (event_box); diff --git a/src/Grid/Grid.vala b/src/Grid/Grid.vala index 02147d0d7..733d1e6bc 100644 --- a/src/Grid/Grid.vala +++ b/src/Grid/Grid.vala @@ -171,7 +171,6 @@ public class Grid : Gtk.Grid { } attach (day, col, row); - day.show_all (); } col = (col + 1) % 7; diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 58a4938d6..796c789eb 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -27,9 +27,9 @@ public class Maya.View.GridDay : Granite.Bin { public bool in_current_month { set { if (value) { - get_style_context ().remove_class (Gtk.STYLE_CLASS_DIM_LABEL); + get_style_context ().remove_class (Granite.CssClass.DIM_LABEL); } else { - get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + get_style_context ().add_class (Granite.CssClass.DIM_LABEL); } } } @@ -54,8 +54,8 @@ public class Maya.View.GridDay : Granite.Bin { }; var container_box = new Gtk.Box (VERTICAL, 3); - container_box.add (label); - container_box.add (event_box); + container_box.append (label); + container_box.append (event_box); can_focus = true; child = container_box; @@ -120,8 +120,7 @@ public class Maya.View.GridDay : Granite.Bin { button.unparent (); } - event_box.add (button); - button.show_all (); + event_box.append (button); } public bool update_event (ECal.Component modified_event) { diff --git a/src/Grid/VAutoHider.vala b/src/Grid/VAutoHider.vala index a5f7793fc..accd48f10 100644 --- a/src/Grid/VAutoHider.vala +++ b/src/Grid/VAutoHider.vala @@ -40,7 +40,7 @@ namespace Maya.View { children.sort (compare_children); int index = children.index (widget); - main_box.add (widget); + main_box.append (widget); main_box.reorder_child (widget, index); widget.destroy.connect (() => { diff --git a/src/ImportDialog.vala b/src/ImportDialog.vala index 7f2fda99f..430e1f846 100644 --- a/src/ImportDialog.vala +++ b/src/ImportDialog.vala @@ -54,12 +54,12 @@ public class Maya.View.ImportDialog : Granite.MessageDialog { var frame = new Gtk.Frame (null); frame.add (calchooser); - frame.get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW); + frame.add_css_class (Granite.STYLE_CLASS_VIEW); custom_bin.add (frame); var ok_button = (Gtk.Button) add_button (_("Import"), Gtk.ResponseType.APPLY); - ok_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); + ok_button.add_css_class (Granite.CssClass.SUGGESTED); response.connect ((response_id) => { if (response_id == Gtk.ResponseType.APPLY) { diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 3e5d40913..5c5d2d571 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -55,7 +55,6 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { hpaned.pack2 (sidebar, false, false); child = hpaned; - show_all (); var header_group = new Adw.HeaderGroup (); header_group.add_header_bar (calview.header_bar); diff --git a/src/SourceDialog/SourceDialog.vala b/src/SourceDialog/SourceDialog.vala index e19b08dea..77dec9b2e 100644 --- a/src/SourceDialog/SourceDialog.vala +++ b/src/SourceDialog/SourceDialog.vala @@ -70,8 +70,8 @@ public class Maya.View.SourceDialog : Granite.Dialog { var name_box = new Gtk.Box (VERTICAL, 0) { margin_bottom = 12 }; - name_box.add (name_label); - name_box.add (name_entry); + name_box.append (name_label); + name_box.append (name_entry); list_store = new Gtk.ListStore (2, typeof (string), typeof (Backend)); @@ -80,7 +80,7 @@ public class Maya.View.SourceDialog : Granite.Dialog { type_combobox = new Gtk.ComboBox.with_model (list_store); type_combobox.hexpand = true; type_combobox.pack_start (renderer, true); - type_combobox.add_attribute (renderer, "text", 0); + type_combobox.append_attribute (renderer, "text", 0); type_combobox.changed.connect (() => { GLib.Value backend; @@ -100,8 +100,8 @@ public class Maya.View.SourceDialog : Granite.Dialog { var type_box = new Gtk.Box (VERTICAL, 0) { margin_bottom = 12 }; - type_box.add (type_label); - type_box.add (type_combobox); + type_box.append (type_label); + type_box.append (type_combobox); Gtk.TreeIter iter; var backends_manager = BackendsManager.get_default (); @@ -191,16 +191,16 @@ public class Maya.View.SourceDialog : Granite.Dialog { }; var color_button_box = new Gtk.Box (HORIZONTAL, 6); - color_button_box.add (color_button_blue); - color_button_box.add (color_button_mint); - color_button_box.add (color_button_green); - color_button_box.add (color_button_yellow); - color_button_box.add (color_button_orange); - color_button_box.add (color_button_red); - color_button_box.add (color_button_pink); - color_button_box.add (color_button_purple); - color_button_box.add (color_button_brown); - color_button_box.add (color_button_slate); + color_button_box.append (color_button_blue); + color_button_box.append (color_button_mint); + color_button_box.append (color_button_green); + color_button_box.append (color_button_yellow); + color_button_box.append (color_button_orange); + color_button_box.append (color_button_red); + color_button_box.append (color_button_pink); + color_button_box.append (color_button_purple); + color_button_box.append (color_button_brown); + color_button_box.append (color_button_slate); var color_label = new Granite.HeaderLabel (_("Color")) { mnemonic_widget = color_button_box @@ -209,8 +209,8 @@ public class Maya.View.SourceDialog : Granite.Dialog { var color_box = new Gtk.Box (VERTICAL, 0) { margin_bottom = 12 }; - color_box.add (color_label); - color_box.add (color_button_box); + color_box.append (color_label); + color_box.append (color_button_box); is_default_check = new Gtk.CheckButton.with_label (_("Mark as default calendar")) { margin_bottom = 12 @@ -261,11 +261,10 @@ public class Maya.View.SourceDialog : Granite.Dialog { margin_start = 12, vexpand = true }; - main_box.add (type_box); - main_box.add (name_box); - main_box.add (color_box); - main_box.add (is_default_check); - main_box.show_all (); + main_box.append (type_box); + main_box.append (name_box); + main_box.append (color_box); + main_box.append (is_default_check); get_content_area ().add (main_box); } @@ -373,7 +372,7 @@ public class Maya.View.SourceDialog : Granite.Dialog { widget.widget.margin_bottom = 12; } - main_box.add (widget.widget); + main_box.append (widget.widget); if (widget.needed == true && widget.widget is Gtk.Entry) { var entry = widget.widget as Gtk.Entry; @@ -382,7 +381,6 @@ public class Maya.View.SourceDialog : Granite.Dialog { } } - main_box.show_all (); check_can_validate (); } diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index 1bb2991aa..1833838c4 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -36,8 +36,6 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { public Gtk.Revealer revealer { public get; private set; } - private Gtk.GestureClick click_gesture; - private Gtk.Image event_image; private Gtk.Label name_label; private Gtk.Label datetime_label; @@ -171,7 +169,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { split_keywords ((Category)cat); } - event_image = new Gtk.Image.from_icon_name ("office-calendar-symbolic", Gtk.IconSize.MENU) { + event_image = new Gtk.Image.from_icon_name ("office-calendar-symbolic") { pixel_size = 16, valign = START }; @@ -195,8 +193,8 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { use_markup = true, xalign = 0 }; - datetime_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); - datetime_label.get_style_context ().add_class (Granite.STYLE_CLASS_SMALL_LABEL); + datetime_label.add_css_class (Granite.CssClass.DIM); + datetime_label.add_css_class (Granite.CssClass.SMALL); location_label = new Gtk.Label ("") { margin_top = 6, @@ -207,8 +205,9 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { xalign = 0 }; - var location_revealer = new Gtk.Revealer (); - location_revealer.add (location_label); + var location_revealer = new Gtk.Revealer () { + child = location_label + }; var main_grid = new Gtk.Grid () { column_spacing = 6, @@ -256,7 +255,8 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { revealer.set_reveal_child (false); }); - click_gesture = new Gtk.GestureClick (this) { + //FIXME: long press and proper context menu events + var click_gesture = new Gtk.GestureClick () { button = Gdk.BUTTON_SECONDARY, propagation_phase = BUBBLE }; @@ -264,6 +264,8 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { // Fill in the information update (calevent); + + add_controller (click_gesture); } private void on_button_press (int n_press, double x, double y) { @@ -377,7 +379,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { var provider = new Gtk.CssProvider (); try { var colored_css = EVENT_CSS.printf (background_color.slice (0, 7)); - provider.load_from_data (colored_css, colored_css.length); + provider.load_from_string (colored_css); event_image_context.add_provider (provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); main_grid_context.add_provider (provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); diff --git a/src/Widgets/CalendarChooser.vala b/src/Widgets/CalendarChooser.vala index 5c76f393e..890294973 100644 --- a/src/Widgets/CalendarChooser.vala +++ b/src/Widgets/CalendarChooser.vala @@ -58,7 +58,6 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { _("Try changing search terms."), "" ); - placeholder.show_all (); var list_box = new Gtk.ListBox () { activate_on_single_click = true @@ -76,7 +75,6 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { orientation = VERTICAL; add (search_entry); add (scrolled); - show_all (); list_box.set_filter_func (filter_function); list_box.set_header_func (header_update_func); @@ -141,9 +139,8 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { var row = new Gtk.ListBoxRow () { child = calrow }; - row.show_all (); - list_box.add (row); + list_box.append (row); if (source.dup_uid () == current_source.dup_uid ()) { list_box.select_row (row); @@ -181,7 +178,6 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { row.set_header (header); - header.show_all (); if (before == null) { header.margin_top = 0; } diff --git a/src/Widgets/CalendarRow.vala b/src/Widgets/CalendarRow.vala index b041bc629..6639b05f6 100644 --- a/src/Widgets/CalendarRow.vala +++ b/src/Widgets/CalendarRow.vala @@ -61,7 +61,7 @@ public class CalendarRow : Gtk.Box { xalign = 0 }; - var selection_icon = new Gtk.Image.from_icon_name ("object-select-symbolic", Gtk.IconSize.MENU) { + var selection_icon = new Gtk.Image.from_icon_name ("object-select-symbolic") { no_show_all = true, visible = false }; @@ -84,7 +84,7 @@ public class CalendarRow : Gtk.Box { var style_provider = new Gtk.CssProvider (); try { - style_provider.load_from_data (css_color, css_color.length); + style_provider.load_from_string (css_color); calendar_color_context.add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } catch (Error e) { warning ("Could not create CSS Provider: %s\nStylesheet:\n%s", e.message, css_color); diff --git a/src/Widgets/DateSwitcher.vala b/src/Widgets/DateSwitcher.vala index ff4e8d705..2490a9810 100644 --- a/src/Widgets/DateSwitcher.vala +++ b/src/Widgets/DateSwitcher.vala @@ -38,9 +38,9 @@ public class Calendar.Widgets.DateSwitcher : Gtk.Grid { } construct { - var start_button = new Gtk.Button.from_icon_name ("pan-start-symbolic", Gtk.IconSize.MENU); + var start_button = new Gtk.Button.from_icon_name ("pan-start-symbolic"); - var end_button = new Gtk.Button.from_icon_name ("pan-end-symbolic", Gtk.IconSize.MENU); + var end_button = new Gtk.Button.from_icon_name ("pan-end-symbolic"); label = new Gtk.Label (null) { width_chars = width_chars @@ -49,7 +49,7 @@ public class Calendar.Widgets.DateSwitcher : Gtk.Grid { var center_button = new Gtk.Button (); center_button.add (label); - get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED); + get_style_context ().add_class (Granite.CssClass.LINKED); add (start_button); add (center_button); add (end_button); diff --git a/src/Widgets/DeleteDialog.vala b/src/Widgets/DeleteDialog.vala index 5b259c7b6..6a9cbcf48 100644 --- a/src/Widgets/DeleteDialog.vala +++ b/src/Widgets/DeleteDialog.vala @@ -53,7 +53,7 @@ class Calendar.DeleteEventDialog : Granite.MessageDialog { construct { unowned var trash_button = add_button (delete_button_text, Gtk.ResponseType.YES); - trash_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + trash_button.get_style_context ().add_class (Granite.CssClass.DESTRUCTIVE_ACTION); } public Gtk.ResponseType run_dialog () { diff --git a/src/Widgets/DynamicSpinner.vala b/src/Widgets/DynamicSpinner.vala index 0a1730b53..7a0ed86ad 100644 --- a/src/Widgets/DynamicSpinner.vala +++ b/src/Widgets/DynamicSpinner.vala @@ -42,7 +42,6 @@ public class Maya.View.Widgets.DynamicSpinner : Granite.Bin { }; child = revealer; - show_all (); } public async void add_source (E.Source source, Cancellable cancellable) { @@ -51,8 +50,9 @@ public class Maya.View.Widgets.DynamicSpinner : Granite.Bin { var label = new Gtk.Label (source.get_display_name ()); - var stop_button = new Gtk.Button.from_icon_name ("process-stop-symbolic", Gtk.IconSize.BUTTON); - stop_button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); + var stop_button = new Gtk.Button.from_icon_name ("process-stop-symbolic") { + has_frame = false + }; stop_button.clicked.connect (() => { cancellable.cancel (); @@ -65,15 +65,14 @@ public class Maya.View.Widgets.DynamicSpinner : Granite.Bin { margin_start = 6 }; - box.add (label); - box.add (stop_button); + box.append (label); + box.append (stop_button); lock (children_matcher) { children_matcher.insert (source.dup_uid (), box); } - list_box.add (box); - list_box.show_all (); + list_box.append (box); return false; }); diff --git a/src/Widgets/SourcePopover.vala b/src/Widgets/SourcePopover.vala index 8bcf7e5b7..13c8458ec 100644 --- a/src/Widgets/SourcePopover.vala +++ b/src/Widgets/SourcePopover.vala @@ -56,12 +56,11 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { margin_bottom = 3, }; - main_box.add (scroll); - main_box.add (separator); - main_box.add (add_calendar_button); - main_box.add (import_calendar_button); - main_box.add (accounts_button); - main_box.show_all (); + main_box.append (scroll); + main_box.append (separator); + main_box.append (add_calendar_button); + main_box.append (import_calendar_button); + main_box.append (accounts_button); child = main_box; populate.begin (); @@ -146,7 +145,6 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { var header = new Granite.HeaderLabel (row_location); row.set_header (header); - header.show_all (); } private void source_removed (E.Source source) { @@ -174,8 +172,7 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { source_item.edit_request.connect (edit_source); source_item.remove_request.connect (remove_source); - calendar_box.add (source_item); - calendar_box.show_all (); + calendar_box.append (source_item); src_map.set (source.dup_uid (), source_item); } diff --git a/src/Widgets/SourceRow.vala b/src/Widgets/SourceRow.vala index 73ae1ab0c..3720ef0e9 100644 --- a/src/Widgets/SourceRow.vala +++ b/src/Widgets/SourceRow.vala @@ -75,10 +75,10 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { margin_bottom = 3, margin_start = 12 }; - calendar_box.add (visible_checkbutton); - calendar_box.add (calendar_name_label); - calendar_box.add (delete_button); - calendar_box.add (edit_button); + calendar_box.append (visible_checkbutton); + calendar_box.append (calendar_name_label); + calendar_box.append (delete_button); + calendar_box.append (edit_button); var undo_button = new Gtk.Button.with_label (_("Undo")) { margin_end = 6 @@ -94,9 +94,9 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { }; info_box = new Gtk.Box (HORIZONTAL, 12); - info_box.add (close_button); - info_box.add (message_label); - info_box.add (undo_button); + info_box.append (close_button); + info_box.append (message_label); + info_box.append (undo_button); stack = new Gtk.Stack () { transition_type = OVER_RIGHT_LEFT @@ -130,7 +130,7 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { var style_provider = new Gtk.CssProvider (); try { - style_provider.load_from_data (css_color, css_color.length); + style_provider.load_from_string (css_color); visible_checkbutton.get_style_context ().add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } catch (Error e) { warning ("Could not create CSS Provider: %s\nStylesheet:\n%s", e.message, css_color); From 22b87a91941e215743c70e2607464e82e9a9adf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 20 Jan 2026 10:17:07 -0800 Subject: [PATCH 20/26] Update libgranite and libhandy version requirements --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0fb22311..b6a33357d 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ You'll need the following dependencies: +* libadwaita-1-dev * libchamplain-0.12-dev * libchamplain-gtk-0.12-dev * libclutter-1.0-dev @@ -17,10 +18,9 @@ You'll need the following dependencies: * libgeocode-glib-dev * libgeoclue-2-dev * libglib2.0-dev -* libgranite-7-dev >= 7.6.0 +* libgranite-7-dev >= 7.7.0 * libgtk-4-dev >= 4.12 * libical-dev -* libhandy-1-dev >= 0.90.0 * meson * valac From 831c38aeae24d2912a90846802617ec45b4f3b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 20 Jan 2026 10:18:00 -0800 Subject: [PATCH 21/26] Update dependencies in README.md Removed unnecessary dependencies and added libshumate-dev. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index b6a33357d..332ba14d0 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,6 @@ You'll need the following dependencies: * libadwaita-1-dev -* libchamplain-0.12-dev -* libchamplain-gtk-0.12-dev -* libclutter-1.0-dev * libecal1.2-dev * libedataserverui1.2-dev >=3.46 * libfolks-dev @@ -21,6 +18,7 @@ You'll need the following dependencies: * libgranite-7-dev >= 7.7.0 * libgtk-4-dev >= 4.12 * libical-dev +* libshumate-dev * meson * valac From ad5ed73472517f3337724db5099d91dfdd7226e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 20 Jan 2026 13:17:56 -0800 Subject: [PATCH 22/26] more syntax fixes --- src/Application.vala | 1 - src/Grid/CalendarView.vala | 6 +-- src/ImportDialog.vala | 7 ++-- src/SourceDialog/SourceDialog.vala | 64 +++++++++++++++--------------- src/Widgets/AgendaEventRow.vala | 8 +--- src/Widgets/SourcePopover.vala | 2 +- src/Widgets/SourceRow.vala | 10 ++--- 7 files changed, 47 insertions(+), 51 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index a5cfde682..d00b35668 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -214,7 +214,6 @@ namespace Maya { warning (e.message); } - GtkClutter.init (ref args); var app = new Application (); int res = app.run (args); diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index ab650bf69..2d3aaaf79 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -140,8 +140,8 @@ public class Maya.View.CalendarView : Gtk.Box { var spinner = new Maya.View.Widgets.DynamicSpinner (); var contractor = new Gtk.MenuButton () { - image = new Gtk.Image.from_icon_name ("document-export", LARGE_TOOLBAR), - popup = new Gtk.Menu.from_model (contractor_menu), + icon_name = "document-export", + menu_model = contractor_menu, tooltip_text = _("Export or Share the default Calendar") }; @@ -333,7 +333,7 @@ public class Maya.View.CalendarView : Gtk.Box { Gtk.Grid create_big_grid () { spacer = new Gtk.Label (""); spacer.no_show_all = true; - spacer.get_style_context ().add_class ("weeks"); + spacer.add_css_class ("weeks"); weeks = new WeekLabels (); diff --git a/src/ImportDialog.vala b/src/ImportDialog.vala index 430e1f846..ce3b15792 100644 --- a/src/ImportDialog.vala +++ b/src/ImportDialog.vala @@ -52,11 +52,12 @@ public class Maya.View.ImportDialog : Granite.MessageDialog { calchooser = new Widgets.CalendarChooser (); - var frame = new Gtk.Frame (null); - frame.add (calchooser); + var frame = new Gtk.Frame (null) { + child = calchooser + }; frame.add_css_class (Granite.STYLE_CLASS_VIEW); - custom_bin.add (frame); + custom_bin.append (frame); var ok_button = (Gtk.Button) add_button (_("Import"), Gtk.ResponseType.APPLY); ok_button.add_css_class (Granite.CssClass.SUGGESTED); diff --git a/src/SourceDialog/SourceDialog.vala b/src/SourceDialog/SourceDialog.vala index 77dec9b2e..4c193073e 100644 --- a/src/SourceDialog/SourceDialog.vala +++ b/src/SourceDialog/SourceDialog.vala @@ -117,76 +117,76 @@ public class Maya.View.SourceDialog : Granite.Dialog { type_combobox.set_active (0); - color_button_blue = new Gtk.CheckButton (null) { + color_button_blue = new Gtk.CheckButton () { tooltip_text = _("Blueberry") }; - color_button_blue.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_blue.get_style_context ().add_class ("blue"); + color_button_blue.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_blue.add_css_class ("blue"); - color_button_mint = new Gtk.CheckButton (null) { + color_button_mint = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Mint") }; - color_button_mint.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_mint.get_style_context ().add_class ("mint"); + color_button_mint.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_mint.add_css_class ("mint"); - color_button_green = new Gtk.CheckButton (null) { + color_button_green = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Lime") }; - color_button_green.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_green.get_style_context ().add_class ("green"); + color_button_green.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_green.add_css_class ("green"); - color_button_yellow = new Gtk.CheckButton (null) { + color_button_yellow = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Banana") }; - color_button_yellow.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_yellow.get_style_context ().add_class ("yellow"); + color_button_yellow.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_yellow.add_css_class ("yellow"); - color_button_orange = new Gtk.CheckButton (null) { + color_button_orange = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Orange") }; - color_button_orange.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_orange.get_style_context ().add_class ("orange"); + color_button_orange.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_orange.add_css_class ("orange"); - color_button_red = new Gtk.CheckButton (null) { + color_button_red = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Strawberry") }; - color_button_red.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_red.get_style_context ().add_class ("red"); + color_button_red.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_red.add_css_class ("red"); - color_button_pink = new Gtk.CheckButton (null) { + color_button_pink = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Bubblegum") }; - color_button_pink.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_pink.get_style_context ().add_class ("pink"); + color_button_pink.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_pink.add_css_class ("pink"); - color_button_purple = new Gtk.CheckButton (null) { + color_button_purple = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Grape") }; - color_button_purple.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_purple.get_style_context ().add_class ("purple"); + color_button_purple.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_purple.add_css_class ("purple"); - color_button_brown = new Gtk.CheckButton (null) { + color_button_brown = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Cocoa") }; - color_button_brown.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_brown.get_style_context ().add_class ("brown"); + color_button_brown.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_brown.add_css_class ("brown"); - color_button_slate = new Gtk.CheckButton (null) { + color_button_slate = new Gtk.CheckButton () { group = color_button_blue, tooltip_text = _("Slate") }; - color_button_slate.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON); - color_button_slate.get_style_context ().add_class ("slate"); + color_button_slate.add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON); + color_button_slate.add_css_class ("slate"); - color_button_none = new Gtk.CheckButton (null) { + color_button_none = new Gtk.CheckButton () { group = color_button_blue }; @@ -266,7 +266,7 @@ public class Maya.View.SourceDialog : Granite.Dialog { main_box.append (color_box); main_box.append (is_default_check); - get_content_area ().add (main_box); + get_content_area ().append (main_box); } public void set_source (E.Source? source = null) { diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index 1833838c4..6a9346248 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -222,14 +222,10 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { main_grid.attach (location_revealer, 1, 2); main_grid_context = main_grid.get_style_context (); - main_grid_context.add_class ("event"); - - var event_box = new Gtk.EventBox () { - child = main_grid - }; + main_grid.add_css_class ("event"); revealer = new Gtk.Revealer () { - child = event_box, + child = main_grid, transition_type = SLIDE_DOWN }; diff --git a/src/Widgets/SourcePopover.vala b/src/Widgets/SourcePopover.vala index 13c8458ec..1abbdd385 100644 --- a/src/Widgets/SourcePopover.vala +++ b/src/Widgets/SourcePopover.vala @@ -26,7 +26,7 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { } }); - var scroll = new Gtk.ScrolledWindow (null, null) { + var scroll = new Gtk.ScrolledWindow () { child = calendar_box, hscrollbar_policy = NEVER, max_content_height = 300, diff --git a/src/Widgets/SourceRow.vala b/src/Widgets/SourceRow.vala index 3720ef0e9..8e369f138 100644 --- a/src/Widgets/SourceRow.vala +++ b/src/Widgets/SourceRow.vala @@ -59,12 +59,12 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { style_calendar_color (cal.dup_color ()); - delete_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", MENU) { + delete_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic") { sensitive = source.removable, tooltip_text = source.removable ? _("Remove") : _("Not Removable") }; - edit_button = new Gtk.Button.from_icon_name ("edit-symbolic", MENU) { + edit_button = new Gtk.Button.from_icon_name ("edit-symbolic") { sensitive = source.writable, tooltip_text = source.writable ? _("Edit…"): _("Not Editable") }; @@ -84,8 +84,8 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { margin_end = 6 }; - var close_button = new Gtk.Button.from_icon_name ("process-stop-symbolic", SMALL_TOOLBAR) { - relief = NONE + var close_button = new Gtk.Button.from_icon_name ("process-stop-symbolic") { + has_frame = false }; message_label = new Gtk.Label (_("\"%s\" removed").printf (source.display_name)) { @@ -105,7 +105,7 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { stack.add (info_box); stack.visible_child = calendar_box; - add (stack); + child = stack; close_button.clicked.connect (() => { hide (); From 7a1d0ad8bd6f9340267ef8d64b88f81d6284b56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 2 Feb 2026 12:21:14 -0800 Subject: [PATCH 23/26] Remove all --- src/AgendaView.vala | 9 ++------- src/Grid/EventButton.vala | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/AgendaView.vala b/src/AgendaView.vala index 565402740..e9cc19053 100644 --- a/src/AgendaView.vala +++ b/src/AgendaView.vala @@ -366,13 +366,8 @@ public class Maya.View.AgendaView : Gtk.Box { * Calendar model parameters have been updated. */ private void on_model_parameters_changed () { - foreach (unowned var row in selected_date_events_list.get_children ()) { - row.destroy (); - } - - foreach (unowned var row in upcoming_events_list.get_children ()) { - row.destroy (); - } + selected_date_events_list.remove_all (); + upcoming_events_list.remove_all (); } private void on_today_changed () { diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index b63b9f6f9..02f81b3be 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -6,7 +6,7 @@ * Corentin Noël */ -public class Maya.View.EventButton : Gtk.Bin { +public class Maya.View.EventButton : Granite.Bin { public ECal.Component comp { get; construct set; } private Gtk.Revealer revealer; From c5985e7fdb1144ac2c7d4166e7cef54589ad690e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 2 Feb 2026 12:32:50 -0800 Subject: [PATCH 24/26] More syntax --- core/GesturesUtils.vala | 12 +++++++----- src/Application.vala | 8 ++++---- src/Grid/CalendarView.vala | 10 +++++----- src/MainWindow.vala | 15 ++++++++++----- src/Widgets/SourceRow.vala | 4 ++-- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/core/GesturesUtils.vala b/core/GesturesUtils.vala index 5097bb938..48adba0b9 100644 --- a/core/GesturesUtils.vala +++ b/core/GesturesUtils.vala @@ -23,7 +23,7 @@ namespace Maya.GesturesUtils { static bool has_scrolled = false; const uint INTERVAL = 500; - public void on_scroll (Gtk.EventControllerScroll scroll_controller, double delta_x, double delta_y) { + public bool on_scroll (Gtk.EventControllerScroll scroll_controller, double delta_x, double delta_y) { double choice = delta_x; if (((int)delta_x).abs () < ((int)delta_y).abs ()) { choice = delta_y; @@ -33,27 +33,29 @@ namespace Maya.GesturesUtils { if (choice == 1 || choice == -1) { Calendar.EventStore.get_default ().change_month ((int) choice); scroll_controller.reset (); - return; + return true; } if (has_scrolled == true) { scroll_controller.reset (); - return; + return true; } if (choice > 0.3) { reset_timer.begin (); Calendar.EventStore.get_default ().change_month (1); scroll_controller.reset (); - return; + return true; } if (choice < -0.3) { reset_timer.begin (); Calendar.EventStore.get_default ().change_month (-1); scroll_controller.reset (); - return; + return true; } + + return false; } public async void reset_timer () { diff --git a/src/Application.vala b/src/Application.vala index d00b35668..df0ba5222 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -150,14 +150,14 @@ namespace Maya { * Set maximize after height/width else window is min size on unmaximize * Bind maximize as SET else get get bad sizes */ - settings.bind ("window-height", window, "default-height", SettingsBindFlags.DEFAULT); - settings.bind ("window-width", window, "default-width", SettingsBindFlags.DEFAULT); + saved_state.bind ("window-height", window, "default-height", SettingsBindFlags.DEFAULT); + saved_state.bind ("window-width", window, "default-width", SettingsBindFlags.DEFAULT); - if (settings.get_boolean ("window-maximized")) { + if (saved_state.get_boolean ("window-maximized")) { window.maximize (); } - settings.bind ("window-maximized", main_window, "maximized", SettingsBindFlags.SET); + saved_state.bind ("window-maximized", window, "maximized", SettingsBindFlags.SET); window.destroy.connect (on_quit); } diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index d6c3b3c42..b53114db3 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -26,7 +26,6 @@ public class Maya.View.CalendarView : Gtk.Box { private Calendar.Widgets.DateSwitcher month_switcher; private Calendar.Widgets.DateSwitcher year_switcher; private Grid days_grid; - private Gtk.EventControllerScroll scroll_controller; private Gtk.Stack stack; private WeekLabels weeks; @@ -91,14 +90,13 @@ public class Maya.View.CalendarView : Gtk.Box { selected_date = Maya.Application.get_selected_datetime (); var error_label = new Gtk.Label (null); - error_label.show (); var error_bar = new Gtk.InfoBar () { message_type = Gtk.MessageType.ERROR, revealed = false, show_close_button = true }; - error_bar.get_content_area ().add (error_label); + error_bar.add_child (error_label); var info_bar = new Calendar.Widgets.ConnectivityInfoBar (); @@ -139,7 +137,7 @@ public class Maya.View.CalendarView : Gtk.Box { }; header_bar = new Adw.HeaderBar () { - show_close_button = true + show_start_title_buttons = true }; header_bar.pack_start (month_switcher); header_bar.pack_start (year_switcher); @@ -204,8 +202,10 @@ public class Maya.View.CalendarView : Gtk.Box { set_switcher_date (calmodel.month_start); }); - scroll_controller = new Gtk.EventControllerScroll (this, Gtk.EventControllerScrollFlags.BOTH_AXES); + var scroll_controller = new Gtk.EventControllerScroll (Gtk.EventControllerScrollFlags.BOTH_AXES); scroll_controller.scroll.connect (GesturesUtils.on_scroll); + + add_controller (scroll_controller); } private void action_export () { diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 5c5d2d571..a45960996 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -50,9 +50,14 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { width_request = 160 }; - var hpaned = new Gtk.Paned (HORIZONTAL); - hpaned.pack1 (calview, true, false); - hpaned.pack2 (sidebar, false, false); + var hpaned = new Gtk.Paned (HORIZONTAL) { + start_child = calview, + resize_start_child = true, + shrink_start_child = false, + end_child = sidebar, + resize_end_child = false, + shrink_end_child = false + }; child = hpaned; @@ -95,7 +100,7 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { var dialog = new Maya.View.EventDialog (comp, null, this); dialog.present (); } else { - Gdk.beep (); + Gdk.Display.get_default ().beep (); } } @@ -111,7 +116,7 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { }; dialog.present (); } else { - Gdk.beep (); + Gdk.Display.get_default ().beep (); } } diff --git a/src/Widgets/SourceRow.vala b/src/Widgets/SourceRow.vala index 8e369f138..b13742a34 100644 --- a/src/Widgets/SourceRow.vala +++ b/src/Widgets/SourceRow.vala @@ -101,8 +101,8 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { stack = new Gtk.Stack () { transition_type = OVER_RIGHT_LEFT }; - stack.add (calendar_box); - stack.add (info_box); + stack.add_child (calendar_box); + stack.add_child (info_box); stack.visible_child = calendar_box; child = stack; From 35c187433e2f5ea00479f500412741a83a99b55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 3 Feb 2026 09:17:22 -0800 Subject: [PATCH 25/26] Fix bad merge --- src/EventEdition/EventDialog.vala | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/EventEdition/EventDialog.vala b/src/EventEdition/EventDialog.vala index d9e7f6ecd..928eb0f2b 100644 --- a/src/EventEdition/EventDialog.vala +++ b/src/EventEdition/EventDialog.vala @@ -147,14 +147,14 @@ public class EventDialog : Granite.Dialog { halign = START, hexpand = true }; - delete_button.add_css_class (Granite.CssClass.DESTRUCTIVE_ACTION); + delete_button.add_css_class (Granite.CssClass.DESTRUCTIVE); delete_button.clicked.connect (remove_event); buttonbox.append (delete_button); } var create_button = new Gtk.Button (); - create_button.add_css_class (Granite.CssClass.SUGGESTED_ACTION); + create_button.add_css_class (Granite.CssClass.SUGGESTED); create_button.clicked.connect (save_dialog); if (date_time != null) { @@ -221,6 +221,13 @@ public class EventDialog : Granite.Dialog { modal = true, transient_for = this }; + + delete_dialog.response.connect ((response) => { + if (response == Gtk.ResponseType.YES) { + close (); + } + }); + delete_dialog.present (); } From de890cf83d2744e5fed7a1f1f5bd22234bfa8642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 3 Feb 2026 09:27:46 -0800 Subject: [PATCH 26/26] More minor syntax --- src/EventEdition/EventDialog.vala | 5 ++--- src/EventEdition/GuestGrid.vala | 6 +++--- src/Grid/CalendarView.vala | 2 +- src/Grid/Grid.vala | 4 +--- src/Grid/GridDay.vala | 9 +++++---- src/Grid/Header.vala | 2 +- src/Grid/WeekLabels.vala | 8 ++++---- 7 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/EventEdition/EventDialog.vala b/src/EventEdition/EventDialog.vala index 928eb0f2b..efad108ff 100644 --- a/src/EventEdition/EventDialog.vala +++ b/src/EventEdition/EventDialog.vala @@ -174,13 +174,12 @@ public class EventDialog : Granite.Dialog { button_sizegroup.add_widget (cancel_button); button_sizegroup.add_widget (create_button); - var box = new Gtk.Box (VERTICAL, 24); + var box = new Granite.Box (VERTICAL, DOUBLE); box.append (stack_switcher); box.append (stack); box.append (buttonbox); - box.show_all (); - get_content_area ().add (box); + get_content_area ().append (box); info_panel.valid_event.connect ((is_valid) => { create_button.sensitive = is_valid; diff --git a/src/EventEdition/GuestGrid.vala b/src/EventEdition/GuestGrid.vala index b06b3f6e1..e56152c6c 100644 --- a/src/EventEdition/GuestGrid.vala +++ b/src/EventEdition/GuestGrid.vala @@ -61,15 +61,15 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { switch (parameter.get_partstat ()) { case ICal.ParameterPartstat.ACCEPTED: status_label.label = _("Accepted"); - status_label.add_css_class ("success"); + status_label.add_css_class (Granite.CssClass.SUCCESS); break; case ICal.ParameterPartstat.DECLINED: status_label.label = _("Declined"); - status_label.add_css_class (Gtk.STYLE_CLASS_ERROR); + status_label.add_css_class (Granite.CssClass.ERROR); break; case ICal.ParameterPartstat.TENTATIVE: status_label.label = _("Maybe"); - status_label.add_css_class (Gtk.STYLE_CLASS_ERROR); + status_label.add_css_class (Granite.CssClass.WARNING); break; default: break; diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index d2ad7b127..349a38f79 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -305,7 +305,7 @@ public class Maya.View.CalendarView : Gtk.Box { settings.bind ("show-weeks", spacer_revealer, "reveal-child", SettingsBindFlags.GET); - stack.add (big_grid); + stack.add_child (big_grid); header.update_columns (model.week_starts_on); weeks.update (model.data_range.first_dt, model.num_weeks); diff --git a/src/Grid/Grid.vala b/src/Grid/Grid.vala index 2764416d2..a0fec0a15 100644 --- a/src/Grid/Grid.vala +++ b/src/Grid/Grid.vala @@ -49,8 +49,6 @@ public class Grid : Gtk.Grid { row_spacing = 0; data = new Gee.HashMap (); - events |= Gdk.EventMask.SCROLL_MASK; - events |= Gdk.EventMask.SMOOTH_SCROLL_MASK; unowned var time_manager = Calendar.TimeManager.get_default (); time_manager.on_update_today.connect (callback_update_today); @@ -167,7 +165,7 @@ public class Grid : Gtk.Grid { }); if (col == 0) { - day.get_style_context ().add_class ("firstcol"); + day.add_css_class ("firstcol"); } attach (day, col, row); diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index c3667c501..8a345ed00 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -21,8 +21,6 @@ public class Maya.View.GridDay : Granite.Bin { public bool draw_left_border = true; private VAutoHider event_box; private GLib.HashTable event_buttons; - private Gtk.EventControllerKey key_controller; - private Gtk.GestureClick click_gesture; public bool in_current_month { set { @@ -62,17 +60,20 @@ public class Maya.View.GridDay : Granite.Bin { events |= Gdk.EventMask.SMOOTH_SCROLL_MASK; get_style_context ().add_class ("cell"); - click_gesture = new Gtk.GestureClick (this) { + var click_gesture = new Gtk.GestureClick () { button = Gdk.BUTTON_PRIMARY, propagation_phase = BUBBLE }; click_gesture.released.connect (on_button_press); - key_controller = new Gtk.EventControllerKey (this) { + var key_controller = new Gtk.EventControllerKey () { propagation_phase = BUBBLE }; key_controller.key_pressed.connect (on_key_press); + add_controller (click_gesture); + add_controller (key_controller); + // Gtk.TargetEntry dnd = {"binary/calendar", 0, 0}; // Gtk.drag_dest_set (this, Gtk.DestDefaults.MOTION, {dnd}, Gdk.DragAction.MOVE); diff --git a/src/Grid/Header.vala b/src/Grid/Header.vala index 63854fdce..d215ffc0a 100644 --- a/src/Grid/Header.vala +++ b/src/Grid/Header.vala @@ -70,7 +70,7 @@ public class Header : Granite.Bin { var menu = new GLib.Menu (); menu.append (_("Show Week Numbers"), "header.show-weeks"); - var gtk_menu = new Gtk.Menu.from_model (menu) { + var gtk_menu = new Gtk.PopoverMenu.from_model (menu) { attach_widget = this }; diff --git a/src/Grid/WeekLabels.vala b/src/Grid/WeekLabels.vala index 77ed29aa9..47a6ee5ce 100644 --- a/src/Grid/WeekLabels.vala +++ b/src/Grid/WeekLabels.vala @@ -40,7 +40,7 @@ public class Maya.View.WeekLabels : Granite.Bin { day_grid = new Gtk.Grid () { row_homogeneous = true }; - day_grid.get_style_context ().add_class ("weeks"); + day_grid.add_css_class ("weeks"); set_nr_of_weeks (5); day_grid.insert_row (1); @@ -65,11 +65,11 @@ public class Maya.View.WeekLabels : Granite.Bin { var menu = new GLib.Menu (); menu.append (_("Show Week Numbers"), "week-labels.show-weeks"); - var gtk_menu = new Gtk.Menu.from_model (menu) { + var gtk_menu = new Gtk.PopoverMenu.from_model (menu) { attach_widget = this }; - var click_gesture = new Gtk.GestureMultiPress () { + var click_gesture = new Gtk.GestureClick () { button = 0 }; click_gesture.pressed.connect ((n_press, x, y) => { @@ -115,7 +115,7 @@ public class Maya.View.WeekLabels : Granite.Bin { valign = START, width_chars = 2 }; - labels[c].get_style_context ().add_class ("weeklabel"); + labels[c].add_css_class ("weeklabel"); day_grid.attach (labels[c], 0, c); labels[c].show ();