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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] =?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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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/64] 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 (); From 77e1fb32838557a8405c9d69f84345ba93b4dd42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 16 Feb 2026 13:03:38 -0800 Subject: [PATCH 27/64] more tiny fixes --- src/EventEdition/RepeatPanel.vala | 23 +++++++++++------------ src/Grid/CalendarView.vala | 2 +- src/Grid/GridDay.vala | 6 +++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index f75bd20a3..2ac4e6f3a 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -181,20 +181,20 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { exceptions_box.add (inline_toolbar); exceptions_box.get_style_context ().add_class (Granite.STYLE_CLASS_CARD); - var main_box = new Gtk.Box (VERTICAL, 6) { + var main_box = new Granite.Box (VERTICAL, HALF) { margin_start = 12, margin_end = 12 }; - main_box.add (reminder_label); - main_box.add (repeat_box); - main_box.add (every_label); - main_box.add (every_box); - main_box.add (weekday_revealer); - main_box.add (monthly_revealer); - main_box.add (ends_label); - main_box.add (ends_grid); - main_box.add (exceptions_label); - main_box.add (exceptions_box); + main_box.append (reminder_label); + main_box.append (repeat_box); + main_box.append (every_label); + main_box.append (every_box); + main_box.append (weekday_revealer); + main_box.append (monthly_revealer); + main_box.append (ends_label); + main_box.append (ends_grid); + main_box.append (exceptions_label); + main_box.append (exceptions_box); var scrolled = new Gtk.ScrolledWindow (null, null) { child = main_box @@ -207,7 +207,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { add_button.clicked.connect (() => { var exception_grid = new ExceptionGrid (new GLib.DateTime.now_local ()); - exception_grid.show_all (); exceptions_list.add (exception_grid); }); diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index b31c0d28c..2c075c788 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -71,7 +71,7 @@ public class Maya.View.CalendarView : Gtk.Box { message_type = WARNING, revealed = false }; - info_bar.get_content_area ().add (info_label); + info_bar.add_child (info_label); info_bar.add_button (_("Network Settings…"), Gtk.ResponseType.ACCEPT); var application_instance = ((Gtk.Application) GLib.Application.get_default ()); diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 8a345ed00..f2c9b3e79 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -25,9 +25,9 @@ public class Maya.View.GridDay : Granite.Bin { public bool in_current_month { set { if (value) { - get_style_context ().remove_class (Granite.CssClass.DIM_LABEL); + remove_css_class (Granite.CssClass.DIM); } else { - get_style_context ().add_class (Granite.CssClass.DIM_LABEL); + add_css_class (Granite.CssClass.DIM); } } } @@ -58,7 +58,7 @@ public class Maya.View.GridDay : Granite.Bin { can_focus = true; child = container_box; events |= Gdk.EventMask.SMOOTH_SCROLL_MASK; - get_style_context ().add_class ("cell"); + add_css_class ("cell"); var click_gesture = new Gtk.GestureClick () { button = Gdk.BUTTON_PRIMARY, From cc76bae9ae49029cf44a351b79217e98a3b432b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 16 Feb 2026 13:16:34 -0800 Subject: [PATCH 28/64] Start replacing file dialog --- src/Grid/CalendarView.vala | 50 ++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index 2c075c788..f00261850 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -197,32 +197,34 @@ public class Maya.View.CalendarView : Gtk.Box { var filter = new Gtk.FileFilter (); filter.add_mime_type ("text/calendar"); - var filechooser = new Gtk.FileChooserNative ( - _("Export Calendar…"), - null, - Gtk.FileChooserAction.SAVE, - _("Save"), - _("Cancel") - ); - filechooser.do_overwrite_confirmation = true; - filechooser.filter = filter; - filechooser.set_current_name (_("calendar.ics")); - - if (filechooser.run () == Gtk.ResponseType.ACCEPT) { - var destination = filechooser.get_filename (); - if (destination == null) { - destination = filechooser.get_current_folder (); - } else if (!destination.has_suffix (".ics")) { - destination += ".ics"; - } - try { - GLib.Process.spawn_command_line_async ("mv " + GLib.Environment.get_tmp_dir () + "/calendar.ics " + destination); - } catch (SpawnError e) { - warning (e.message); - } + var file_dialog = new Gtk.FileDialog () { + title = _("Export Calendar…"), + accept_label = _("Save"), + default_filter = filter, + initial_name = _("calendar.ics") } - filechooser.destroy (); + file_dialog.save.begin (window, null, (obj, res) => { + try { + var file = file_dialog.save.end (res); + + // var destination = filechooser.get_filename (); + // if (destination == null) { + // destination = filechooser.get_current_folder (); + // } else if (!destination.has_suffix (".ics")) { + // destination += ".ics"; + // } + + // GLib.Process.spawn_command_line_async ("mv " + GLib.Environment.get_tmp_dir () + "/calendar.ics " + destination); + + } catch (Error e) { + if (e.matches (Gtk.DialogError.quark (), Gtk.DialogError.DISMISSED)) { + return; + } + + critical (e.message); + } + }); } private void set_switcher_date (DateTime date) { From e4a6bc52b8c19dbffd6851ec67cf2f90b52a41bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 16 Feb 2026 15:59:59 -0800 Subject: [PATCH 29/64] finish filedialog --- core/Utils.vala | 24 ------------------------ src/Grid/CalendarView.vala | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 35 deletions(-) diff --git a/core/Utils.vala b/core/Utils.vala index d3dcb2a83..b7b94e345 100644 --- a/core/Utils.vala +++ b/core/Utils.vala @@ -60,30 +60,6 @@ namespace Maya.Util { return _("On this computer"); } - /* - * ical Exportation - */ - - public void save_temp_selected_calendars () { - var calmodel = Calendar.EventStore.get_default (); - var events = calmodel.get_events (); - var builder = new StringBuilder (); - builder.append ("BEGIN:VCALENDAR\n"); - builder.append ("VERSION:2.0\n"); - foreach (ECal.Component event in events) { - builder.append (event.get_as_string ()); - } - builder.append ("END:VCALENDAR"); - - string file_path = GLib.Environment.get_tmp_dir () + "/calendar.ics"; - try { - var file = File.new_for_path (file_path); - file.replace_contents (builder.data, null, false, FileCreateFlags.REPLACE_DESTINATION, null); - } catch (Error e) { - warning ("%s\n", e.message); - } - } - public ECal.Component? copy_ecal_component (ECal.Component? original) { if (original == null) { return null; diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index f00261850..e90eb21e1 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -202,21 +202,21 @@ public class Maya.View.CalendarView : Gtk.Box { accept_label = _("Save"), default_filter = filter, initial_name = _("calendar.ics") - } + }; file_dialog.save.begin (window, null, (obj, res) => { try { - var file = file_dialog.save.end (res); - - // var destination = filechooser.get_filename (); - // if (destination == null) { - // destination = filechooser.get_current_folder (); - // } else if (!destination.has_suffix (".ics")) { - // destination += ".ics"; - // } - - // GLib.Process.spawn_command_line_async ("mv " + GLib.Environment.get_tmp_dir () + "/calendar.ics " + destination); + var events = Calendar.EventStore.get_default ().get_events (); + var builder = new StringBuilder (); + builder.append ("BEGIN:VCALENDAR\n"); + builder.append ("VERSION:2.0\n"); + foreach (ECal.Component event in events) { + builder.append (event.get_as_string ()); + } + builder.append ("END:VCALENDAR"); + var file = file_dialog.save.end (res); + file.replace_contents (builder.data, null, false, FileCreateFlags.REPLACE_DESTINATION, null); } catch (Error e) { if (e.matches (Gtk.DialogError.quark (), Gtk.DialogError.DISMISSED)) { return; From 9d9a091f0678dd4c8fa7d64d460fa03e345909bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 16 Feb 2026 16:10:10 -0800 Subject: [PATCH 30/64] More syntax fixes --- src/EventEdition/GuestGrid.vala | 2 +- src/EventEdition/GuestsPanel.vala | 16 ++++---- src/EventEdition/InfoPanel.vala | 4 +- src/EventEdition/ReminderPanel.vala | 16 ++++---- src/EventEdition/RepeatPanel.vala | 62 +++++++++++++++-------------- src/Grid/EventButton.vala | 2 +- src/MainWindow.vala | 4 -- src/Widgets/CalendarChooser.vala | 6 +-- 8 files changed, 53 insertions(+), 59 deletions(-) diff --git a/src/EventEdition/GuestGrid.vala b/src/EventEdition/GuestGrid.vala index e56152c6c..b34c01542 100644 --- a/src/EventEdition/GuestGrid.vala +++ b/src/EventEdition/GuestGrid.vala @@ -40,7 +40,7 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { }; var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic") { - relief = NONE, + has_frame = false, valign = CENTER }; diff --git a/src/EventEdition/GuestsPanel.vala b/src/EventEdition/GuestsPanel.vala index ae4d2bb4f..c41707a94 100644 --- a/src/EventEdition/GuestsPanel.vala +++ b/src/EventEdition/GuestsPanel.vala @@ -18,7 +18,7 @@ * Authored by: Jaap Broekhuizen */ -public class Maya.View.EventEdition.GuestsPanel : Gtk.Grid { +public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { private EventDialog parent_dialog; private Gtk.Entry guest_entry; private Gtk.EntryCompletion guest_completion; @@ -46,7 +46,7 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Grid { margin_end = 12; row_spacing = 6; set_sensitive (parent_dialog.can_edit); - orientation = Gtk.Orientation.VERTICAL; + orientation = VERTICAL; guest_store = new Gtk.ListStore (2, typeof (string), typeof (string)); @@ -59,13 +59,13 @@ 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 (Granite.CssClass.DIM_LABEL); + no_guests_context.add_class (Granite.CssClass.DIM); guest_list = new Gtk.ListBox (); guest_list.set_selection_mode (Gtk.SelectionMode.NONE); guest_list.set_placeholder (no_guests_label); - var guest_scrolledwindow = new Gtk.ScrolledWindow (null, null) { + var guest_scrolledwindow = new Gtk.ScrolledWindow () { child = guest_list }; guest_scrolledwindow.expand = true; @@ -105,9 +105,9 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Grid { guest_entry.delete_text (0, -1); }); - add (guest_label); - add (guest_entry); - add (frame); + append (guest_label); + append (guest_entry); + append (frame); if (parent_dialog.ecal != null) { unowned ICal.Component comp = parent_dialog.ecal.get_icalcomponent (); @@ -123,8 +123,6 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Grid { property = comp.get_next_property (ICal.PropertyKind.ATTENDEE_PROPERTY); } } - - show_all (); } /** diff --git a/src/EventEdition/InfoPanel.vala b/src/EventEdition/InfoPanel.vala index 6a92f4688..34b3cf6f9 100644 --- a/src/EventEdition/InfoPanel.vala +++ b/src/EventEdition/InfoPanel.vala @@ -150,7 +150,7 @@ public class Maya.View.EventEdition.InfoPanel : Gtk.Grid { margin_bottom = 6 }; - var popover = new Gtk.Popover (null) { + var popover = new Gtk.Popover () { child = calchooser, width_request = 310 }; @@ -190,7 +190,7 @@ public class Maya.View.EventEdition.InfoPanel : Gtk.Grid { mnemonic_widget = comment_textview }; - var scrolled = new Gtk.ScrolledWindow (null, null) { + var scrolled = new Gtk.ScrolledWindow () { child = comment_textview, height_request = 100, hexpand = true, diff --git a/src/EventEdition/ReminderPanel.vala b/src/EventEdition/ReminderPanel.vala index c9bb100db..ce3a83fe9 100644 --- a/src/EventEdition/ReminderPanel.vala +++ b/src/EventEdition/ReminderPanel.vala @@ -15,10 +15,8 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Box { this.parent_dialog = parent_dialog; var no_reminder_label = new Gtk.Label (_("No Reminders")); - no_reminder_label.show (); - no_reminder_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); - no_reminder_label.add_css_class (Granite.CssClass.DIM_LABEL); + no_reminder_label.add_css_class (Granite.CssClass.DIM); reminders = new Gee.ArrayList (); reminders_to_remove = new Gee.ArrayList (); @@ -34,14 +32,14 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Box { mnemonic_widget = reminder_list }; - var scrolled = new Gtk.ScrolledWindow (null, null) { + var scrolled = new Gtk.ScrolledWindow () { child = reminder_list, hexpand = true, vexpand = true, }; var add_button_box = new Gtk.Box (HORIZONTAL, 0); - add_button_box.append (new Gtk.Image.from_icon_name ("list-add-symbolic", BUTTON)); + add_button_box.append (new Gtk.Image.from_icon_name ("list-add-symbolic")); add_button_box.append (new Gtk.Label (_("Add Reminder"))); var add_button = new Gtk.Button () { @@ -50,7 +48,7 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Box { }; var inline_toolbar = new Gtk.ActionBar (); - inline_toolbar.add_css_class (Granite.CssClass.FLAT); + inline_toolbar.add_css_class (Granite.STYLE_CLASS_FLAT); inline_toolbar.pack_start (add_button); var box = new Gtk.Box (VERTICAL, 0); @@ -65,8 +63,8 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Box { margin_start = margin_end = 12; orientation = VERTICAL; sensitive = parent_dialog.can_edit; - add (reminder_label); - add (frame); + append (reminder_label); + append (frame); load (); @@ -190,7 +188,7 @@ public class Maya.View.EventEdition.ReminderGrid : Gtk.ListBoxRow { }); var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic") { - relief = NONE + has_frame = false }; remove_button.add_css_class (Granite.CssClass.DESTRUCTIVE); diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index 2ac4e6f3a..44ca275c6 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -48,8 +48,8 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { repeat_combobox.active = 1; var repeat_box = new Gtk.Box (HORIZONTAL, 12); - repeat_box.add (repeat_switch); - repeat_box.add (repeat_combobox); + repeat_box.append (repeat_switch); + repeat_box.append (repeat_combobox); var every_label = new Granite.HeaderLabel (_("Every:")); @@ -62,8 +62,8 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { var every_box = new Gtk.Box (HORIZONTAL, 12) { sensitive = false }; - every_box.add (every_entry); - every_box.add (every_unit_label); + every_box.append (every_entry); + every_box.append (every_unit_label); var ends_label = new Granite.HeaderLabel (_("Ends:")); @@ -85,8 +85,8 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { var repeats_label = new Gtk.Label (ngettext ("Repeat", "Repeats", 1)); var end_repeat_box = new Gtk.Box (HORIZONTAL, 12); - end_repeat_box.add (repeats_spinbutton); - end_repeat_box.add (repeats_label); + end_repeat_box.append (repeats_spinbutton); + end_repeat_box.append (repeats_label); var end_repeat_revealer = new Gtk.Revealer () { child = end_repeat_box @@ -100,12 +100,12 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { child = end_datepicker }; - var ends_grid = new Gtk.Box (VERTICAL, 6) { + var ends_box = new Granite.Box (VERTICAL, HALF) { sensitive = false }; - ends_grid.add (ends_combobox); - ends_grid.add (end_date_revealer); - ends_grid.add (end_repeat_revealer); + ends_box.append (ends_combobox); + ends_box.append (end_date_revealer); + ends_box.append (end_repeat_revealer); mon_button = new Gtk.ToggleButton.with_label (_("Mon")); tue_button = new Gtk.ToggleButton.with_label (_("Tue")); @@ -119,26 +119,28 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { homogeneous = true, sensitive = false }; - 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); var weekday_revealer = new Gtk.Revealer () { child = week_box }; - 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 (_("The same day every month")); + every_radiobutton = new Gtk.CheckButton () { + group = same_radiobutton + }; var monthly_box = new Gtk.Box (VERTICAL, 6) { sensitive = false }; - monthly_box.add (same_radiobutton); - monthly_box.add (every_radiobutton); + monthly_box.append (same_radiobutton); + monthly_box.append (every_radiobutton); var monthly_revealer = new Gtk.Revealer () { child = monthly_box @@ -161,25 +163,25 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { exceptions_list.set_placeholder (no_exceptions_label); 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 Exception"))); + add_button_box.append (new Gtk.Image.from_icon_name ("list-add-symbolic")); + add_button_box.append (new Gtk.Label (_("Add Exception"))); var add_button = new Gtk.Button () { child = add_button_box, - relief = NONE + has_frame = false }; var inline_toolbar = new Gtk.ActionBar (); - inline_toolbar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); + inline_toolbar.add_css_class (Granite.STYLE_CLASS_FLAT); inline_toolbar.add (add_button); var exceptions_box = new Gtk.Box (VERTICAL, 0) { margin_bottom = 12, sensitive = false }; - exceptions_box.add (exceptions_list); - exceptions_box.add (inline_toolbar); - exceptions_box.get_style_context ().add_class (Granite.STYLE_CLASS_CARD); + exceptions_box.append (exceptions_list); + exceptions_box.append (inline_toolbar); + exceptions_box.add_css_class (Granite.CssClass.CARD); var main_box = new Granite.Box (VERTICAL, HALF) { margin_start = 12, @@ -192,11 +194,11 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { main_box.append (weekday_revealer); main_box.append (monthly_revealer); main_box.append (ends_label); - main_box.append (ends_grid); + main_box.append (ends_box); main_box.append (exceptions_label); main_box.append (exceptions_box); - var scrolled = new Gtk.ScrolledWindow (null, null) { + var scrolled = new Gtk.ScrolledWindow () { child = main_box }; diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index 02f81b3be..5a47013d3 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -127,7 +127,7 @@ public class Maya.View.EventButton : Granite.Bin { 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); grid_style_context.add_provider (provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } catch (GLib.Error e) { diff --git a/src/MainWindow.vala b/src/MainWindow.vala index cd5d43e09..c9ccb1dc0 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -61,10 +61,6 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { child = hpaned; - var header_group = new Adw.HeaderGroup (); - header_group.add_header_bar (calview.header_bar); - header_group.add_header_bar (sidebar.header_bar); - var size_group = new Gtk.SizeGroup (VERTICAL); size_group.add_widget (calview.header_bar); size_group.add_widget (sidebar.header_bar); diff --git a/src/Widgets/CalendarChooser.vala b/src/Widgets/CalendarChooser.vala index 56bd88b63..12ac40507 100644 --- a/src/Widgets/CalendarChooser.vala +++ b/src/Widgets/CalendarChooser.vala @@ -64,7 +64,7 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { }; list_box.set_placeholder (placeholder); - var scrolled = new Gtk.ScrolledWindow (null, null) { + var scrolled = new Gtk.ScrolledWindow () { child = list_box, hscrollbar_policy = NEVER, max_content_height = 300, @@ -73,8 +73,8 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { margin_bottom = 6; orientation = VERTICAL; - add (search_entry); - add (scrolled); + append (search_entry); + append (scrolled); list_box.set_filter_func (filter_function); list_box.set_header_func (header_update_func); From afebfcbd67ebf93f37a4a9d6ac0111383fb0b926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 08:39:52 -0800 Subject: [PATCH 31/64] Reorder after --- src/EventEdition/RepeatPanel.vala | 98 +++++++++++++++---------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index 44ca275c6..aa6d06bfa 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -549,67 +549,67 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { private void reorder_week_box () { switch (Calendar.EventStore.get_default ().week_starts_on) { case MONDAY: - week_box.reorder_child (mon_button, 0); - week_box.reorder_child (tue_button, 1); - week_box.reorder_child (wed_button, 2); - week_box.reorder_child (thu_button, 3); - week_box.reorder_child (fri_button, 4); - week_box.reorder_child (sat_button, 5); - week_box.reorder_child (sun_button, 6); + // week_box.reorder_child (mon_button, 0); + week_box.reorder_child_after (tue_button, mon_button); + week_box.reorder_child_after (wed_button, tue_button); + week_box.reorder_child_after (thu_button, wed_button); + week_box.reorder_child_after (fri_button, thu_button); + week_box.reorder_child_after (sat_button, fri_button); + week_box.reorder_child_after (sun_button, sat_button); break; case TUESDAY: - week_box.reorder_child (tue_button, 0); - week_box.reorder_child (wed_button, 1); - week_box.reorder_child (thu_button, 2); - week_box.reorder_child (fri_button, 3); - week_box.reorder_child (sat_button, 4); - week_box.reorder_child (sun_button, 5); - week_box.reorder_child (mon_button, 6); + // week_box.reorder_child (tue_button, 0); + week_box.reorder_child_after (wed_button, tue_button); + week_box.reorder_child_after (thu_button, wed_button); + week_box.reorder_child_after (fri_button, thu_button); + week_box.reorder_child_after (sat_button, fri_button); + week_box.reorder_child_after (sun_button, sat_button); + week_box.reorder_child_after (mon_button, sun_button); break; case WEDNESDAY: - week_box.reorder_child (wed_button, 0); - week_box.reorder_child (thu_button, 1); - week_box.reorder_child (fri_button, 2); - week_box.reorder_child (sat_button, 3); - week_box.reorder_child (sun_button, 4); - week_box.reorder_child (mon_button, 5); - week_box.reorder_child (tue_button, 6); + // week_box.reorder_child (wed_button, 0); + week_box.reorder_child_after (thu_button, wed_button); + week_box.reorder_child_after (fri_button, thu_button); + week_box.reorder_child_after (sat_button, fri_button); + week_box.reorder_child_after (sun_button, sat_button); + week_box.reorder_child_after (mon_button, sun_button); + week_box.reorder_child_after (tue_button, mon_button); break; case THURSDAY: - week_box.reorder_child (thu_button, 0); - week_box.reorder_child (fri_button, 1); - week_box.reorder_child (sat_button, 2); - week_box.reorder_child (sun_button, 3); - week_box.reorder_child (mon_button, 4); - week_box.reorder_child (tue_button, 5); - week_box.reorder_child (wed_button, 6); + // week_box.reorder_child (thu_button, 0); + week_box.reorder_child_after (fri_button, thu_button); + week_box.reorder_child_after (sat_button, fri_button); + week_box.reorder_child_after (sun_button, sat_button); + week_box.reorder_child_after (mon_button, sun_button); + week_box.reorder_child_after (tue_button, mon_button); + week_box.reorder_child_after (wed_button, tue_button); break; case FRIDAY: - week_box.reorder_child (fri_button, 0); - week_box.reorder_child (sat_button, 1); - week_box.reorder_child (sun_button, 2); - week_box.reorder_child (mon_button, 3); - week_box.reorder_child (tue_button, 4); - week_box.reorder_child (wed_button, 5); - week_box.reorder_child (thu_button, 6); + // week_box.reorder_child (fri_button, 0); + week_box.reorder_child_after (sat_button, fri_button); + week_box.reorder_child_after (sun_button, sat_button); + week_box.reorder_child_after (mon_button, sun_button); + week_box.reorder_child_after (tue_button, mon_button); + week_box.reorder_child_after (wed_button, tue_button); + week_box.reorder_child_after (thu_button, wed_button); break; case SATURDAY: - week_box.reorder_child (sat_button, 0); - week_box.reorder_child (sun_button, 1); - week_box.reorder_child (mon_button, 2); - week_box.reorder_child (tue_button, 3); - week_box.reorder_child (wed_button, 4); - week_box.reorder_child (thu_button, 5); - week_box.reorder_child (fri_button, 6); + // week_box.reorder_child (sat_button, 0); + week_box.reorder_child_after (sun_button, sat_button); + week_box.reorder_child_after (mon_button, sun_button); + week_box.reorder_child_after (tue_button, mon_button); + week_box.reorder_child_after (wed_button, tue_button); + week_box.reorder_child_after (thu_button, wed_button); + week_box.reorder_child_after (fri_button, thu_button); break; case SUNDAY: - week_box.reorder_child (sun_button, 0); - week_box.reorder_child (mon_button, 1); - week_box.reorder_child (tue_button, 2); - week_box.reorder_child (wed_button, 3); - week_box.reorder_child (thu_button, 4); - week_box.reorder_child (fri_button, 5); - week_box.reorder_child (sat_button, 6); + // week_box.reorder_child (sun_button, 0); + week_box.reorder_child_after (mon_button, sun_button); + week_box.reorder_child_after (tue_button, mon_button); + week_box.reorder_child_after (wed_button, tue_button); + week_box.reorder_child_after (thu_button, wed_button); + week_box.reorder_child_after (fri_button, thu_button); + week_box.reorder_child_after (sat_button, fri_button); break; case BAD_WEEKDAY: break; From 8834f3fac24c4f0ce5b5c2af62672452b2b8f6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 08:47:19 -0800 Subject: [PATCH 32/64] PopoverMenuItem --- src/Grid/EventButton.vala | 9 +++------ src/Widgets/AgendaEventRow.vala | 2 +- src/Widgets/DateSwitcher.vala | 15 +++++++------- src/Widgets/SourcePopover.vala | 35 +++++++++++++++++++++++++++++---- 4 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index 5a47013d3..efdddc44b 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -28,23 +28,20 @@ public class Maya.View.EventButton : Granite.Bin { label.show (); var internal_grid = new Gtk.Grid (); - internal_grid.add (label); + internal_grid.attach (label, 0, 0); grid_style_context = internal_grid.get_style_context (); grid_style_context.add_class ("event"); - var event_box = new Gtk.EventBox (); - event_box.append (internal_grid); - revealer = new Gtk.Revealer () { - child = event_box, + child = internal_grid, transition_type = CROSSFADE }; child = revealer; var context_menu = Maya.EventMenu.build (comp); - context_menu.attach_to_widget (this, null); + context_menu.set_parent (this); var click_gesture = new Gtk.GestureClick () { button = 0 diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index cefd4e5a1..1bb63c69b 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -233,7 +233,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { child = revealer; var context_menu = Maya.EventMenu.build (calevent); - context_menu.attach_to_widget (this, null); + context_menu.set_parent (this); var cal = (E.SourceCalendar)source.get_extension (E.SOURCE_EXTENSION_CALENDAR); diff --git a/src/Widgets/DateSwitcher.vala b/src/Widgets/DateSwitcher.vala index 2490a9810..4be436dc1 100644 --- a/src/Widgets/DateSwitcher.vala +++ b/src/Widgets/DateSwitcher.vala @@ -17,7 +17,7 @@ * Authored by: Maxwell Barvian */ -public class Calendar.Widgets.DateSwitcher : Gtk.Grid { +public class Calendar.Widgets.DateSwitcher : Granite.Box { public signal void left_clicked (); public signal void right_clicked (); @@ -46,13 +46,14 @@ public class Calendar.Widgets.DateSwitcher : Gtk.Grid { width_chars = width_chars }; - var center_button = new Gtk.Button (); - center_button.add (label); + var center_button = new Gtk.Button () { + child = label + }; - get_style_context ().add_class (Granite.CssClass.LINKED); - add (start_button); - add (center_button); - add (end_button); + child_spacing = LINKED; + append (start_button); + append (center_button); + append (end_button); start_button.clicked.connect (() => left_clicked ()); end_button.clicked.connect (() => right_clicked ()); diff --git a/src/Widgets/SourcePopover.vala b/src/Widgets/SourcePopover.vala index bc593178b..83a728683 100644 --- a/src/Widgets/SourcePopover.vala +++ b/src/Widgets/SourcePopover.vala @@ -40,20 +40,20 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { margin_bottom = 3 }; - var add_calendar_button = new Gtk.ModelButton () { + var add_calendar_button = new PopoverMenuitem () { text = _("Add New Calendar…") }; - var import_calendar_button = new Gtk.ModelButton () { + var import_calendar_button = new PopoverMenuitem () { text = _("Import iCalendar File…") }; - var export_calendar_button = new Gtk.ModelButton () { + var export_calendar_button = new PopoverMenuitem () { action_name = "calendar.export", text = _("Export Calendar…") }; - var accounts_button = new Gtk.ModelButton () { + var accounts_button = new PopoverMenuitem () { text = _("Online Accounts Settings…") }; @@ -205,4 +205,31 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { src_dialog.set_source (source); src_dialog.present (); } + + private class PopoverMenuitem : Gtk.Button { + public string text { + set { + child = new Granite.AccelLabel (value) { + action_name = this.action_name + }; + + update_property (Gtk.AccessibleProperty.LABEL, value, -1); + } + } + + class construct { + set_css_name ("modelbutton"); + } + + construct { + accessible_role = MENU_ITEM; + + clicked.connect (() => { + var popover = (Gtk.Popover) get_ancestor (typeof (Gtk.Popover)); + if (popover != null) { + popover.popdown (); + } + }); + } + } } From 8e52631e3324ac7eb70eb958fc0977c4c0f3a5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 08:56:49 -0800 Subject: [PATCH 33/64] more syntax stuff --- src/EventEdition/EventDialog.vala | 3 ++- src/EventEdition/GuestsPanel.vala | 2 -- src/EventEdition/LocationPanel.vala | 6 +++--- src/EventEdition/ReminderPanel.vala | 1 - src/EventEdition/RepeatPanel.vala | 17 +++++++---------- src/Grid/GridDay.vala | 1 - src/Grid/Header.vala | 5 ++--- src/Grid/WeekLabels.vala | 5 ++--- src/Widgets/CalendarChooser.vala | 8 +++----- 9 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/EventEdition/EventDialog.vala b/src/EventEdition/EventDialog.vala index 0e94dfda6..fbb9dae74 100644 --- a/src/EventEdition/EventDialog.vala +++ b/src/EventEdition/EventDialog.vala @@ -126,11 +126,12 @@ public class EventDialog : Granite.Dialog { stack.child_set_property (repeat_panel, "icon-name", "media-playlist-repeat-symbolic"); var stack_switcher = new Gtk.StackSwitcher () { - homogeneous = true, + margin_end = 12, margin_start = 12, stack = stack }; + ((Gtk.BoxLayout) stack_switcher.layout_manager).homogeneous = true; var buttonbox = new Gtk.Box (HORIZONTAL, 6) { baseline_position = CENTER, diff --git a/src/EventEdition/GuestsPanel.vala b/src/EventEdition/GuestsPanel.vala index c41707a94..6e3753ccc 100644 --- a/src/EventEdition/GuestsPanel.vala +++ b/src/EventEdition/GuestsPanel.vala @@ -188,8 +188,6 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { guest_element.removed.connect (() => { attendees.remove (guest_element.attendee); }); - - row.show_all (); } private bool suggestion_selected (Gtk.TreeModel model, Gtk.TreeIter iter) { diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index 82b9946d5..24a36cceb 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -97,9 +97,9 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { orientation = VERTICAL; spacing = 6; sensitive = parent_dialog.can_edit; - add (location_label); - add (location_entry); - add (frame); + append (location_label); + append (location_entry); + append (frame); // Load the location if (parent_dialog.ecal != null) { diff --git a/src/EventEdition/ReminderPanel.vala b/src/EventEdition/ReminderPanel.vala index ce3a83fe9..f533faecb 100644 --- a/src/EventEdition/ReminderPanel.vala +++ b/src/EventEdition/ReminderPanel.vala @@ -75,7 +75,6 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Box { private ReminderGrid add_reminder (string uid) { var reminder = new ReminderGrid (uid); - reminder.show_all (); reminder_list.add (reminder); diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index aa6d06bfa..888a443f1 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -94,7 +94,7 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { 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); var end_date_revealer = new Gtk.Revealer () { child = end_datepicker @@ -152,10 +152,8 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { margin_top = 12, margin_bottom = 12 }; - no_exceptions_label.show (); - - no_exceptions_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL); - no_exceptions_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); + no_exceptions_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); + no_exceptions_label.add_css_class (Granite.CssClass.DIM); exceptions_list = new Gtk.ListBox () { selection_mode = NONE @@ -173,7 +171,7 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { var inline_toolbar = new Gtk.ActionBar (); inline_toolbar.add_css_class (Granite.STYLE_CLASS_FLAT); - inline_toolbar.add (add_button); + inline_toolbar.pack_start (add_button); var exceptions_box = new Gtk.Box (VERTICAL, 0) { margin_bottom = 12, @@ -209,7 +207,7 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { add_button.clicked.connect (() => { var exception_grid = new ExceptionGrid (new GLib.DateTime.now_local ()); - exceptions_list.add (exception_grid); + exceptions_list.append (exception_grid); }); repeat_switch.notify["active"].connect (() => { @@ -218,7 +216,7 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { every_box.sensitive = active; week_box.sensitive = active; monthly_box.sensitive = active; - ends_grid.sensitive = active; + ends_box.sensitive = active; exceptions_box.sensitive = active; }); repeat_switch.active = false; @@ -379,7 +377,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { while (property != null) { var exdate = property.get_exdate (); var exception_grid = new ExceptionGrid (Calendar.Util.icaltime_to_datetime (exdate)); - exception_grid.show_all (); exceptions_list.add (exception_grid); property = comp.get_next_property (ICal.PropertyKind.EXDATE_PROPERTY); } @@ -766,7 +763,7 @@ public class Maya.View.EventEdition.ExceptionGrid : Gtk.ListBoxRow { private Granite.DatePicker date; public ExceptionGrid (GLib.DateTime dt) { - date = new Granite.Widgets.DatePicker () { + date = new Granite.DatePicker () { date = dt, hexpand = true }; diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index f2c9b3e79..3821a6d0f 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -57,7 +57,6 @@ public class Maya.View.GridDay : Granite.Bin { can_focus = true; child = container_box; - events |= Gdk.EventMask.SMOOTH_SCROLL_MASK; add_css_class ("cell"); var click_gesture = new Gtk.GestureClick () { diff --git a/src/Grid/Header.vala b/src/Grid/Header.vala index d215ffc0a..130c53e32 100644 --- a/src/Grid/Header.vala +++ b/src/Grid/Header.vala @@ -70,9 +70,8 @@ public class Header : Granite.Bin { var menu = new GLib.Menu (); menu.append (_("Show Week Numbers"), "header.show-weeks"); - var gtk_menu = new Gtk.PopoverMenu.from_model (menu) { - attach_widget = this - }; + var gtk_menu = new Gtk.PopoverMenu.from_model (menu); + gtk_menu.set_parent (this); var click_gesture = new Gtk.GestureClick () { button = 0 diff --git a/src/Grid/WeekLabels.vala b/src/Grid/WeekLabels.vala index 47a6ee5ce..af8740969 100644 --- a/src/Grid/WeekLabels.vala +++ b/src/Grid/WeekLabels.vala @@ -65,9 +65,8 @@ 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.PopoverMenu.from_model (menu) { - attach_widget = this - }; + var gtk_menu = new Gtk.PopoverMenu.from_model (menu); + gtk_menu.set_parent (this); var click_gesture = new Gtk.GestureClick () { button = 0 diff --git a/src/Widgets/CalendarChooser.vala b/src/Widgets/CalendarChooser.vala index 12ac40507..302fd28bd 100644 --- a/src/Widgets/CalendarChooser.vala +++ b/src/Widgets/CalendarChooser.vala @@ -53,11 +53,9 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { placeholder_text = _("Search Calendars") }; - var placeholder = new Granite.Widgets.AlertView ( - _("No Results"), - _("Try changing search terms."), - "" - ); + var placeholder = new Granite.Placeholder (_("No Results")) { + description = _("Try changing search terms.") + }; var list_box = new Gtk.ListBox () { activate_on_single_click = true From dbf356e5c8eba7ecbc8960bde738cd2c88c4cc1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 11:34:35 -0800 Subject: [PATCH 34/64] More menu stuff --- src/EventEdition/ReminderPanel.vala | 2 +- src/EventEdition/RepeatPanel.vala | 2 +- src/Grid/EventButton.vala | 7 ++----- src/Grid/Header.vala | 7 ++----- src/Grid/WeekLabels.vala | 7 ++----- src/Widgets/AgendaEventRow.vala | 7 ++----- src/Widgets/EventMenu.vala | 21 ++++++++++++++------- src/Widgets/SourcePopover.vala | 7 ++----- 8 files changed, 26 insertions(+), 34 deletions(-) diff --git a/src/EventEdition/ReminderPanel.vala b/src/EventEdition/ReminderPanel.vala index f533faecb..980da6287 100644 --- a/src/EventEdition/ReminderPanel.vala +++ b/src/EventEdition/ReminderPanel.vala @@ -76,7 +76,7 @@ public class Maya.View.EventEdition.ReminderPanel : Gtk.Box { private ReminderGrid add_reminder (string uid) { var reminder = new ReminderGrid (uid); - reminder_list.add (reminder); + reminder_list.append (reminder); reminders.add (reminder); diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index 888a443f1..f03c9b32f 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -377,7 +377,7 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { while (property != null) { var exdate = property.get_exdate (); var exception_grid = new ExceptionGrid (Calendar.Util.icaltime_to_datetime (exdate)); - exceptions_list.add (exception_grid); + exceptions_list.append (exception_grid); property = comp.get_next_property (ICal.PropertyKind.EXDATE_PROPERTY); } } diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index efdddc44b..482b63b51 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -58,7 +58,7 @@ public class Maya.View.EventButton : Granite.Bin { } if (event.triggers_context_menu ()) { - context_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (context_menu, x, y); click_gesture.set_state (CLAIMED); click_gesture.reset (); @@ -69,10 +69,7 @@ public class Maya.View.EventButton : Granite.Bin { touch_only = true }; long_press_gesture.pressed.connect ((x, y) => { - var sequence = long_press_gesture.get_current_sequence (); - var event = long_press_gesture.get_last_event (sequence); - - context_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (context_menu, x, y); long_press_gesture.set_state (CLAIMED); long_press_gesture.reset (); diff --git a/src/Grid/Header.vala b/src/Grid/Header.vala index 130c53e32..cb8737f09 100644 --- a/src/Grid/Header.vala +++ b/src/Grid/Header.vala @@ -81,7 +81,7 @@ public class Header : Granite.Bin { var event = click_gesture.get_last_event (sequence); if (event.triggers_context_menu ()) { - gtk_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (gtk_menu, x, y); click_gesture.set_state (CLAIMED); click_gesture.reset (); @@ -92,10 +92,7 @@ public class Header : Granite.Bin { touch_only = true }; long_press_gesture.pressed.connect ((x, y) => { - var sequence = long_press_gesture.get_current_sequence (); - var event = long_press_gesture.get_last_event (sequence); - - gtk_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (gtk_menu, x, y); long_press_gesture.set_state (CLAIMED); long_press_gesture.reset (); diff --git a/src/Grid/WeekLabels.vala b/src/Grid/WeekLabels.vala index af8740969..6b7c38766 100644 --- a/src/Grid/WeekLabels.vala +++ b/src/Grid/WeekLabels.vala @@ -76,7 +76,7 @@ public class Maya.View.WeekLabels : Granite.Bin { var event = click_gesture.get_last_event (sequence); if (event.triggers_context_menu ()) { - gtk_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (gtk_menu, x, y); click_gesture.set_state (CLAIMED); click_gesture.reset (); @@ -87,10 +87,7 @@ public class Maya.View.WeekLabels : Granite.Bin { touch_only = true }; long_press_gesture.pressed.connect ((x, y) => { - var sequence = long_press_gesture.get_current_sequence (); - var event = long_press_gesture.get_last_event (sequence); - - gtk_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (gtk_menu, x, y); long_press_gesture.set_state (CLAIMED); long_press_gesture.reset (); diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index 1bb63c69b..1c919fdeb 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -263,7 +263,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { var event = click_gesture.get_last_event (sequence); if (event.triggers_context_menu ()) { - context_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (context_menu, x, y); click_gesture.set_state (CLAIMED); click_gesture.reset (); @@ -274,10 +274,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { touch_only = true }; long_press_gesture.pressed.connect ((x, y) => { - var sequence = long_press_gesture.get_current_sequence (); - var event = long_press_gesture.get_last_event (sequence); - - context_menu.popup_at_pointer (event); + Maya.EventMenu.popup_at_pointer (context_menu, x, y); long_press_gesture.set_state (CLAIMED); long_press_gesture.reset (); diff --git a/src/Widgets/EventMenu.vala b/src/Widgets/EventMenu.vala index 3c15698cf..7ae0ed80d 100644 --- a/src/Widgets/EventMenu.vala +++ b/src/Widgets/EventMenu.vala @@ -45,18 +45,25 @@ namespace Maya.EventMenu { menu.insert_action_group ("event", action_group); E.Source src = comp.get_data ("source"); - menu.popped_up.connect (() => { - var sensitive = src.writable && !Calendar.EventStore.get_default ().calclient_is_readonly (src); - action_edit.set_enabled (sensitive); - action_duplicate.set_enabled (sensitive); - action_remove.set_enabled (sensitive); - action_add_exception.set_enabled (sensitive); - }); + var sensitive = src.writable && !Calendar.EventStore.get_default ().calclient_is_readonly (src); + action_edit.set_enabled (sensitive); + action_duplicate.set_enabled (sensitive); + action_remove.set_enabled (sensitive); + action_add_exception.set_enabled (sensitive); return menu; } + private static void popup_at_pointer (Gtk.PopoverMenu popover, double x, double y) { + var rect = Gdk.Rectangle () { + x = (int) x, + y = (int) y + }; + popover.pointing_to = rect; + popover.popup (); + } + private static void remove_event (ECal.Component comp) { var application = (Gtk.Application) GLib.Application.get_default (); var source = comp.get_data ("source"); diff --git a/src/Widgets/SourcePopover.vala b/src/Widgets/SourcePopover.vala index 83a728683..285b4c67b 100644 --- a/src/Widgets/SourcePopover.vala +++ b/src/Widgets/SourcePopover.vala @@ -71,12 +71,11 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { child = main_box; populate.begin (); - add_calendar_button.button_release_event.connect (() => { + add_calendar_button.clicked.connect (() => { edit_source (); - return Gdk.EVENT_STOP; }); - import_calendar_button.button_release_event.connect (() => { + import_calendar_button.clicked.connect (() => { var ics_filter = new Gtk.FileFilter (); ics_filter.add_mime_type ("application/ics"); @@ -109,8 +108,6 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { dialog.present (); } }); - - return Gdk.EVENT_STOP; }); accounts_button.clicked.connect (() => { From 5de5470fc30ca166bd00270c4f626d4a3db9e164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 13:50:30 -0800 Subject: [PATCH 35/64] File chooser stuff --- src/Widgets/SourcePopover.vala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Widgets/SourcePopover.vala b/src/Widgets/SourcePopover.vala index 285b4c67b..7babc61d7 100644 --- a/src/Widgets/SourcePopover.vala +++ b/src/Widgets/SourcePopover.vala @@ -86,8 +86,6 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { _("Open"), _("Cancel") ); - - file_chooser.set_local_only (true); file_chooser.set_select_multiple (true); file_chooser.set_filter (ics_filter); @@ -98,8 +96,9 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { GLib.File[] files = null; if (response_id == Gtk.ResponseType.ACCEPT) { - foreach (unowned GLib.File selected_file in file_chooser.get_files ()) { - files += selected_file; + var file_list = file_chooser.get_files (); + for (int i; i < file_list.get_n_items (); i++) { + files += (File) file_list.get_item (i); } } From 1886bbd78243c70c43e857a276c5eafa9904a3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 13:57:05 -0800 Subject: [PATCH 36/64] theoretically focus --- src/Grid/CalendarView.vala | 8 ++++++-- src/Grid/Grid.vala | 9 ++++++--- src/Grid/GridDay.vala | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index d564ae4e4..159bf4d46 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -130,11 +130,15 @@ public class Maya.View.CalendarView : Gtk.Box { stack.notify["transition-running"].connect (() => { if (stack.transition_running == false) { - stack.get_children ().foreach ((child) => { + var child = stack.get_first_child (); + while (child != null) { if (child != stack.visible_child) { child.destroy (); + child = stack.get_first_child (); + } else { + child = child.get_next_sibling (); } - }); + } } }); diff --git a/src/Grid/Grid.vala b/src/Grid/Grid.vala index a0fec0a15..9a5a73b73 100644 --- a/src/Grid/Grid.vala +++ b/src/Grid/Grid.vala @@ -158,12 +158,15 @@ public class Grid : Gtk.Grid { // Still update_day to get the color of etc. right day = update_day (new GridDay (new_date), new_date, today, month_start); day.on_event_add.connect ((date) => on_event_add (date)); - day.scroll_event.connect ((event) => {scroll_event (event); return false;}); - day.focus_in_event.connect ((event) => { + // day.scroll_event.connect ((event) => {scroll_event (event); return false;}); + + var focus_controller = new Gtk.EventControllerFocus (); + focus_controller.enter.connect (() => { on_day_focus_in (day); - return false; }); + day.add_controller (focus_controller); + if (col == 0) { day.add_css_class ("firstcol"); } diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 3821a6d0f..22b2cfd75 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -122,7 +122,7 @@ public class Maya.View.GridDay : Granite.Bin { button.unparent (); } - event_box.append (button); + event_box.add (button); } public bool update_event (ECal.Component modified_event) { From 926aab9b6db53432322ed14df7d71ca32f06a4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 14:20:03 -0800 Subject: [PATCH 37/64] Most of the rest of the owl --- src/EventEdition/EventDialog.vala | 11 ++++----- src/EventEdition/GuestGrid.vala | 17 ++++++++++++-- src/EventEdition/GuestsPanel.vala | 23 +++++++++++-------- src/EventEdition/InfoPanel.vala | 15 +++++++------ src/EventEdition/LocationPanel.vala | 35 +++++++++++++++++------------ src/Widgets/CalendarRow.vala | 6 ++--- 6 files changed, 67 insertions(+), 40 deletions(-) diff --git a/src/EventEdition/EventDialog.vala b/src/EventEdition/EventDialog.vala index fbb9dae74..de7b33ffc 100644 --- a/src/EventEdition/EventDialog.vala +++ b/src/EventEdition/EventDialog.vala @@ -119,11 +119,12 @@ public class EventDialog : Granite.Dialog { stack.add_titled (reminder_panel, "reminderpanel", _("Reminders")); ///Translators: The name of the repeat panel tab stack.add_titled (repeat_panel, "repeatpanel", C_("Section Header", "Repeat")); //vala-lint=space-before-paren - stack.child_set_property (info_panel, "icon-name", "office-calendar-symbolic"); - stack.child_set_property (location_panel, "icon-name", "mark-location-symbolic"); - stack.child_set_property (guests_panel, "icon-name", "system-users-symbolic"); - stack.child_set_property (reminder_panel, "icon-name", "alarm-symbolic"); - stack.child_set_property (repeat_panel, "icon-name", "media-playlist-repeat-symbolic"); + + stack.get_page (info_panel).set_property ("icon-name", "office-calendar-symbolic"); + location_panel.set_property ("icon-name", "mark-location-symbolic"); + guests_panel.set_property ("icon-name", "system-users-symbolic"); + reminder_panel.set_property ("icon-name", "alarm-symbolic"); + repeat_panel.set_property ("icon-name", "media-playlist-repeat-symbolic"); var stack_switcher = new Gtk.StackSwitcher () { diff --git a/src/EventEdition/GuestGrid.vala b/src/EventEdition/GuestGrid.vala index b34c01542..54715d883 100644 --- a/src/EventEdition/GuestGrid.vala +++ b/src/EventEdition/GuestGrid.vala @@ -47,7 +47,10 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { avatar = new Adw.Avatar (ICON_SIZE, name_label.label, true); column_spacing = 12; - margin = 6; + margin_top = 6; + margin_end = 6; + margin_bottom = 6; + margin_start = 6; attach (avatar, 0, 0, 1, 4); attach (name_label, 1, 1); attach (mail_label, 1, 2); @@ -114,7 +117,17 @@ public class Maya.View.EventEdition.GuestGrid : Gtk.Grid { avatar.text = individual.display_name; if (individual.avatar != null) { - avatar.set_loadable_icon (individual.avatar); + try { + individual.avatar.load (ICON_SIZE, null); + var avatar_image = new Gtk.Image.from_file (individual.avatar.to_string ()) { + width_request = avatar.size, + height_request = avatar.size + }; + + avatar.set_custom_image (new Gtk.WidgetPaintable (avatar_image)); + } catch (Error e) { + critical (e.message); + } } if (individual.full_name != null && individual.full_name != "") { diff --git a/src/EventEdition/GuestsPanel.vala b/src/EventEdition/GuestsPanel.vala index 6e3753ccc..80cfbd168 100644 --- a/src/EventEdition/GuestsPanel.vala +++ b/src/EventEdition/GuestsPanel.vala @@ -20,7 +20,7 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { private EventDialog parent_dialog; - private Gtk.Entry guest_entry; + private Gtk.SearchEntry guest_entry; private Gtk.EntryCompletion guest_completion; private Gtk.ListBox guest_list; private Gee.ArrayList attendees; @@ -44,7 +44,7 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { margin_start = 12; margin_end = 12; - row_spacing = 6; + spacing = 6; set_sensitive (parent_dialog.can_edit); orientation = VERTICAL; @@ -61,14 +61,16 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { no_guests_context.add_class (Granite.STYLE_CLASS_H3_LABEL); no_guests_context.add_class (Granite.CssClass.DIM); - guest_list = new Gtk.ListBox (); - guest_list.set_selection_mode (Gtk.SelectionMode.NONE); + guest_list = new Gtk.ListBox () { + hexpand = true, + vexpand = true, + selection_mode = NONE + }; guest_list.set_placeholder (no_guests_label); var guest_scrolledwindow = new Gtk.ScrolledWindow () { child = guest_list }; - guest_scrolledwindow.expand = true; var frame = new Gtk.Frame (null) { child = guest_scrolledwindow @@ -97,7 +99,7 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { guest_entry = new Gtk.SearchEntry (); guest_entry.placeholder_text = _("Invite"); guest_entry.hexpand = true; - guest_entry.set_completion (guest_completion); + // guest_entry.set_completion (guest_completion); guest_entry.activate.connect (() => { var attendee = new ICal.Property (ICal.PropertyKind.ATTENDEE_PROPERTY); attendee.set_attendee (guest_entry.text); @@ -179,10 +181,13 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { } private void add_guest (ICal.Property attendee) { - var row = new Gtk.ListBoxRow (); var guest_element = new GuestGrid (attendee); - row.add (guest_element); - guest_list.add (row); + + var row = new Gtk.ListBoxRow () { + child = guest_element + }; + + guest_list.append (row); attendees.add (guest_element.attendee); guest_element.removed.connect (() => { diff --git a/src/EventEdition/InfoPanel.vala b/src/EventEdition/InfoPanel.vala index 34b3cf6f9..a173edd00 100644 --- a/src/EventEdition/InfoPanel.vala +++ b/src/EventEdition/InfoPanel.vala @@ -178,13 +178,14 @@ public class Maya.View.EventEdition.InfoPanel : Gtk.Grid { parent_dialog.source = calchooser.current_source; } - comment_textview = new Granite.HyperTextView (); - comment_textview.set_wrap_mode (Gtk.WrapMode.WORD_CHAR); - comment_textview.accepts_tab = false; - comment_textview.set_border_window_size (Gtk.TextWindowType.LEFT, 2); - comment_textview.set_border_window_size (Gtk.TextWindowType.RIGHT, 2); - comment_textview.set_border_window_size (Gtk.TextWindowType.TOP, 2); - comment_textview.set_border_window_size (Gtk.TextWindowType.BOTTOM, 2); + comment_textview = new Granite.HyperTextView () { + accepts_tab = false, + wrap_mode = WORD_CHAR, + top_margin = 3, + right_margin = 3, + bottom_margin = 3, + left_margin = 3, + }; var comment_label = new Granite.HeaderLabel (_("Comments:")) { mnemonic_widget = comment_textview diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index 24a36cceb..fb4baff1b 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -48,7 +48,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { location_completion.match_selected.connect ((model, iter) => suggestion_selected (model, iter)); location_entry = new Gtk.SearchEntry () { - completion = location_completion, + // completion = location_completion, hexpand = true, placeholder_text = _("John Smith OR Example St.") }; @@ -69,11 +69,11 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { icon_size = LARGE } }; - point.draggable = parent_dialog.can_edit; - point.drag_finish.connect (() => { - map_selected = true; - find_location.begin (point.latitude, point.longitude); - }); + // point.draggable = parent_dialog.can_edit; + // point.drag_finish.connect (() => { + // map_selected = true; + // find_location.begin (point.latitude, point.longitude); + // }); var marker_layer = new Shumate.MarkerLayer.full (simple_map.viewport, SINGLE); marker_layer.add_marker (point); @@ -89,7 +89,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { load_contact.begin (); var frame = new Gtk.Frame (null) { - child = champlain_embed + // child = champlain_embed }; margin_start = 12; @@ -178,8 +178,10 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { } private async void compute_location (string loc) { - if (search_cancellable != null) + if (search_cancellable != null) { search_cancellable.cancel (); + } + search_cancellable = new GLib.Cancellable (); var forward = new Geocode.Forward.for_string (loc); try { @@ -189,16 +191,19 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { point.latitude = place.location.latitude; point.longitude = place.location.longitude; Idle.add (() => { - if (search_cancellable.is_cancelled () == false) - champlain_embed.champlain_view.go_to (point.latitude, point.longitude); + if (search_cancellable.is_cancelled () == false) { + // champlain_embed.champlain_view.go_to (point.latitude, point.longitude); + } + return false; }); } - if (loc == location_entry.text) + if (loc == location_entry.text) { map_selected = true; + } - location_entry.has_focus = true; + location_entry.grab_focus (); } catch (Error error) { debug (error.message); } @@ -245,8 +250,10 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { point.latitude = simple.location.latitude; point.longitude = simple.location.longitude; Idle.add (() => { - if (search_cancellable.is_cancelled () == false) - champlain_embed.champlain_view.go_to (point.latitude, point.longitude); + if (search_cancellable.is_cancelled () == false) { + // champlain_embed.champlain_view.go_to (point.latitude, point.longitude); + } + return false; }); diff --git a/src/Widgets/CalendarRow.vala b/src/Widgets/CalendarRow.vala index e9714fd60..d7828141b 100644 --- a/src/Widgets/CalendarRow.vala +++ b/src/Widgets/CalendarRow.vala @@ -69,9 +69,9 @@ public class CalendarRow : Gtk.Box { }; spacing = 6; - add (calendar_color); - add (calendar_name_label); - add (selection_revealer); + append (calendar_color); + append (calendar_name_label); + append (selection_revealer); bind_property ("label", calendar_name_label, "label"); bind_property ("selected", selection_revealer, "reveal-child", SYNC_CREATE); From e41f9fed5173c6a877941ad02cdd0e1faf53a92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 14:25:18 -0800 Subject: [PATCH 38/64] Make it build --- src/EventEdition/LocationPanel.vala | 2 +- src/Grid/CalendarView.vala | 2 + src/Grid/VAutoHider.vala | 164 ++++++++++++++-------------- 3 files changed, 85 insertions(+), 83 deletions(-) diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index fb4baff1b..366c3155a 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -61,7 +61,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { }; simple_map = new Shumate.SimpleMap () { - map_source = registry.get_by_id (Shumate.MAP_SOURCE_OSM_MAPNIK) + // map_source = registry.get_by_id (Shumate.MAP_SOURCE_OSM_MAPNIK) }; point = new Shumate.Marker () { diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index 159bf4d46..a3d449b85 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -205,6 +205,8 @@ public class Maya.View.CalendarView : Gtk.Box { initial_name = _("calendar.ics") }; + var window = (Gtk.Window) get_root (); + file_dialog.save.begin (window, null, (obj, res) => { try { var events = Calendar.EventStore.get_default ().get_events (); diff --git a/src/Grid/VAutoHider.vala b/src/Grid/VAutoHider.vala index 4f79baf6a..daf7a67e2 100644 --- a/src/Grid/VAutoHider.vala +++ b/src/Grid/VAutoHider.vala @@ -16,20 +16,20 @@ public class Maya.View.VAutoHider : Granite.Bin { }; main_box = new Gtk.Box (VERTICAL, 0); - main_box.pack_end (more_label); + main_box.append (more_label); - base.add (main_box); + child = main_box; } - public override void add (Gtk.Widget widget) { - var children = main_box.get_children (); - children.append (widget); + public void add (Gtk.Widget widget) { + // var children = main_box.get_children (); + // children.append (widget); - children.sort (compare_children); + // children.sort (compare_children); - int index = children.index (widget); - main_box.add (widget); - main_box.reorder_child (widget, index); + // int index = children.index (widget); + main_box.append (widget); + // main_box.reorder_child (widget, index); widget.destroy.connect (() => { queue_resize (); @@ -39,83 +39,83 @@ public class Maya.View.VAutoHider : Granite.Bin { } public void update (Gtk.Widget widget) { - var children = main_box.get_children (); + // var children = main_box.get_children (); - children.sort (compare_children); + // children.sort (compare_children); - int index = children.index (widget); - main_box.reorder_child (widget, index); + // int index = children.index (widget); + // main_box.reorder_child (widget, index); } - public override void size_allocate (Gtk.Allocation allocation) { - base.size_allocate (allocation); - int global_height = allocation.height; - int children_length = (int)main_box.get_children ().length () - 1; - if (children_length == 0) { - more_label.hide (); - return; - } - - int height = 0; - int more_label_height; - int shown_children = 0; - more_label.show (); - more_label.vexpand = false; - more_label.get_preferred_height (out more_label_height, null); - more_label.vexpand = true; - more_label.hide (); - foreach (var child in main_box.get_children ()) { - if (child == more_label) - continue; - - bool last = (shown_children == children_length - 1); - - int child_height; - child.show (); - child.get_preferred_height (out child_height, null); - ((Maya.View.EventButton) child).hide_without_animate (); - - bool should_hide; - if (global_height - more_label_height < child_height + height) { - should_hide = true; - if (last && (global_height >= child_height + height)) { - should_hide = false; - } - } else { - should_hide = false; - height += child_height; - } - - if (should_hide) { - ((Maya.View.EventButton) child).hide_without_animate (); - } else { - ((Maya.View.EventButton) child).show_without_animate (); - shown_children++; - } - } - - int more = children_length - shown_children; - if (shown_children != children_length && more > 0) { - more_label.show (); - more_label.set_label (_("%u more…").printf ((uint)more)); - } else { - more_label.hide (); - } - } - - public override void get_preferred_width (out int minimum_width, out int natural_width) { - base.get_preferred_width (out minimum_width, out natural_width); - more_label.get_preferred_width (out minimum_width, null); - if (minimum_width > natural_width) - natural_width = minimum_width; - } - - public override void get_preferred_height (out int minimum_height, out int natural_height) { - base.get_preferred_height (out minimum_height, out natural_height); - more_label.get_preferred_height (out minimum_height, null); - if (minimum_height > natural_height) - natural_height = minimum_height; - } + // public override void size_allocate (Gtk.Allocation allocation) { + // base.size_allocate (allocation); + // int global_height = allocation.height; + // int children_length = (int)main_box.get_children ().length () - 1; + // if (children_length == 0) { + // more_label.hide (); + // return; + // } + + // int height = 0; + // int more_label_height; + // int shown_children = 0; + // more_label.show (); + // more_label.vexpand = false; + // more_label.get_preferred_height (out more_label_height, null); + // more_label.vexpand = true; + // more_label.hide (); + // foreach (var child in main_box.get_children ()) { + // if (child == more_label) + // continue; + + // bool last = (shown_children == children_length - 1); + + // int child_height; + // child.show (); + // child.get_preferred_height (out child_height, null); + // ((Maya.View.EventButton) child).hide_without_animate (); + + // bool should_hide; + // if (global_height - more_label_height < child_height + height) { + // should_hide = true; + // if (last && (global_height >= child_height + height)) { + // should_hide = false; + // } + // } else { + // should_hide = false; + // height += child_height; + // } + + // if (should_hide) { + // ((Maya.View.EventButton) child).hide_without_animate (); + // } else { + // ((Maya.View.EventButton) child).show_without_animate (); + // shown_children++; + // } + // } + + // int more = children_length - shown_children; + // if (shown_children != children_length && more > 0) { + // more_label.show (); + // more_label.set_label (_("%u more…").printf ((uint)more)); + // } else { + // more_label.hide (); + // } + // } + + // public override void get_preferred_width (out int minimum_width, out int natural_width) { + // base.get_preferred_width (out minimum_width, out natural_width); + // more_label.get_preferred_width (out minimum_width, null); + // if (minimum_width > natural_width) + // natural_width = minimum_width; + // } + + // public override void get_preferred_height (out int minimum_height, out int natural_height) { + // base.get_preferred_height (out minimum_height, out natural_height); + // more_label.get_preferred_height (out minimum_height, null); + // if (minimum_height > natural_height) + // natural_height = minimum_height; + // } public static GLib.CompareFunc compare_children = (a, b) => { EventButton a2 = a as EventButton; From 2cc21764315b1c084033d239b062ea198a564f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 14:28:41 -0800 Subject: [PATCH 39/64] fix headerbars --- src/AgendaView.vala | 5 ++++- src/Grid/CalendarView.vala | 3 ++- src/MainWindow.vala | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/AgendaView.vala b/src/AgendaView.vala index e9cc19053..f766c730b 100644 --- a/src/AgendaView.vala +++ b/src/AgendaView.vala @@ -35,7 +35,10 @@ public class Maya.View.AgendaView : Gtk.Box { }; weekday_label.add_css_class (Granite.STYLE_CLASS_H2_LABEL); - header_bar = new Adw.HeaderBar (); + header_bar = new Adw.HeaderBar () { + show_start_title_buttons = false, + show_title = false + }; header_bar.pack_start (weekday_label); header_bar.pack_end (button_add); header_bar.add_css_class (Granite.STYLE_CLASS_FLAT); diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index a3d449b85..f8e06d060 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -104,7 +104,8 @@ public class Maya.View.CalendarView : Gtk.Box { }; header_bar = new Adw.HeaderBar () { - show_start_title_buttons = true + show_end_title_buttons = false, + show_title = false }; header_bar.pack_start (month_switcher); header_bar.pack_start (year_switcher); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index c9ccb1dc0..8fdf7cbf7 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -60,6 +60,7 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { }; child = hpaned; + titlebar = new Gtk.Grid () { visible = false }; var size_group = new Gtk.SizeGroup (VERTICAL); size_group.add_widget (calview.header_bar); From 85079ea806b4d6189a74985f1c4fbbee130b5cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 14:31:30 -0800 Subject: [PATCH 40/64] Fix up css syntax --- data/Application.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/Application.css b/data/Application.css index cdb341295..5a0a66835 100644 --- a/data/Application.css +++ b/data/Application.css @@ -82,7 +82,7 @@ } .cell.dim-label .event { - background: alpha (@base_color, 0.7); + background: alpha(@base_color, 0.7); color: @text_color; } @@ -94,8 +94,8 @@ row:selected .event { background: @base_color; background-image: linear-gradient(to right, @selected_bg_color, @selected_bg_color); box-shadow: - 0 1px 2px alpha (#000, 0.2), - 0 1px 3px alpha (@selected_bg_color, 0.15); + 0 1px 2px alpha(#000, 0.2), + 0 1px 3px alpha(@selected_bg_color, 0.15); color: @selected_fg_color; } @@ -106,7 +106,7 @@ row:selected .event { } #today #date { - background-color: alpha (@accent_color, 0.15); + background-color: alpha(@accent_color, 0.15); color: @accent_color; font-weight: 700; } From 40cefd985a15af0b41c8c183df5c436e86d24299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 18:34:28 -0800 Subject: [PATCH 41/64] get rid of unreachable catches --- src/Grid/EventButton.vala | 10 +++------- src/Widgets/AgendaEventRow.vala | 14 +++++--------- src/Widgets/CalendarRow.vala | 8 ++------ src/Widgets/SourceRow.vala | 9 ++------- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index 482b63b51..ba41a49dd 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -119,14 +119,10 @@ public class Maya.View.EventButton : Granite.Bin { private void reload_css (string background_color) { var provider = new Gtk.CssProvider (); - try { - var colored_css = EVENT_CSS.printf (background_color.slice (0, 7)); - provider.load_from_string (colored_css); + var colored_css = EVENT_CSS.printf (background_color.slice (0, 7)); + provider.load_from_string (colored_css); - grid_style_context.add_provider (provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - } catch (GLib.Error e) { - critical (e.message); - } + grid_style_context.add_provider (provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } public void destroy_button () { diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index 1c919fdeb..dd8aed917 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -394,15 +394,11 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { private void reload_css (string background_color) { var provider = new Gtk.CssProvider (); - try { - var colored_css = EVENT_CSS.printf (background_color.slice (0, 7)); - 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); - } catch (GLib.Error e) { - critical (e.message); - } + var colored_css = EVENT_CSS.printf (background_color.slice (0, 7)); + 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); } private void split_keywords (Category category) { diff --git a/src/Widgets/CalendarRow.vala b/src/Widgets/CalendarRow.vala index d7828141b..c9ff5fff9 100644 --- a/src/Widgets/CalendarRow.vala +++ b/src/Widgets/CalendarRow.vala @@ -85,11 +85,7 @@ public class CalendarRow : Gtk.Box { var css_color = CALENDAR_COLOR_STYLE.printf (cal.dup_color ()); var style_provider = new Gtk.CssProvider (); - try { - 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); - } + style_provider.load_from_string (css_color); + calendar_color_context.add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } } diff --git a/src/Widgets/SourceRow.vala b/src/Widgets/SourceRow.vala index b9bdf353f..7e8d150fb 100644 --- a/src/Widgets/SourceRow.vala +++ b/src/Widgets/SourceRow.vala @@ -129,13 +129,8 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { var css_color = "@define-color accent_color %s;".printf (color.slice (0, 7)); var style_provider = new Gtk.CssProvider (); - - try { - 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); - } + style_provider.load_from_string (css_color); + visible_checkbutton.get_style_context ().add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); } public void source_has_changed () { From a6976dadc19fc273761c47bc4b14698eb90b9cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 18:38:58 -0800 Subject: [PATCH 42/64] Style class stuff --- src/EventEdition/GuestsPanel.vala | 7 ++----- src/Grid/EventButton.vala | 2 +- src/Grid/Header.vala | 3 +-- src/Widgets/AgendaEventRow.vala | 4 +--- src/Widgets/CalendarRow.vala | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/EventEdition/GuestsPanel.vala b/src/EventEdition/GuestsPanel.vala index 80cfbd168..85028ecb5 100644 --- a/src/EventEdition/GuestsPanel.vala +++ b/src/EventEdition/GuestsPanel.vala @@ -55,11 +55,8 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { load_contacts.begin (); var no_guests_label = new Gtk.Label (_("No Invitees")); - no_guests_label.show (); - - 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 (Granite.CssClass.DIM); + no_guests_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); + no_guests_label.add_css_class (Granite.CssClass.DIM); guest_list = new Gtk.ListBox () { hexpand = true, diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index ba41a49dd..ff7ee36c7 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -31,7 +31,7 @@ public class Maya.View.EventButton : Granite.Bin { internal_grid.attach (label, 0, 0); grid_style_context = internal_grid.get_style_context (); - grid_style_context.add_class ("event"); + internal_grid.add_css_class ("event"); revealer = new Gtk.Revealer () { child = internal_grid, diff --git a/src/Grid/Header.vala b/src/Grid/Header.vala index cb8737f09..eb9e417ae 100644 --- a/src/Grid/Header.vala +++ b/src/Grid/Header.vala @@ -52,8 +52,7 @@ public class Header : Granite.Bin { labels[c] = new Gtk.Label (""); labels[c].hexpand = true; - unowned Gtk.StyleContext label_context = labels[c].get_style_context (); - label_context.add_class ("daylabel"); + labels[c].add_css_class ("daylabel"); header_grid.attach (labels[c], c, 0); } diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index dd8aed917..0b401b298 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -183,9 +183,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { wrap_mode = WORD_CHAR, xalign = 0 }; - - var name_label_context = name_label.get_style_context (); - name_label_context.add_class ("title"); + name_label.add_css_class ("title"); datetime_label = new Gtk.Label ("") { ellipsize = END, diff --git a/src/Widgets/CalendarRow.vala b/src/Widgets/CalendarRow.vala index c9ff5fff9..51f6eca6c 100644 --- a/src/Widgets/CalendarRow.vala +++ b/src/Widgets/CalendarRow.vala @@ -51,7 +51,7 @@ public class CalendarRow : Gtk.Box { width_request = 12, valign = CENTER }; - calendar_color.get_style_context ().add_class ("cal-color"); + calendar_color.add_css_class ("cal-color"); calendar_color_context = calendar_color.get_style_context (); From 146de3ff9d97b22967ebca0ec7300d025ea64b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 17 Feb 2026 18:49:16 -0800 Subject: [PATCH 43/64] Remove popover arrows --- src/EventEdition/InfoPanel.vala | 1 + src/Grid/Header.vala | 4 +++- src/Grid/WeekLabels.vala | 4 +++- src/Widgets/EventMenu.vala | 4 +++- src/Widgets/SourcePopover.vala | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/EventEdition/InfoPanel.vala b/src/EventEdition/InfoPanel.vala index a173edd00..485214b5d 100644 --- a/src/EventEdition/InfoPanel.vala +++ b/src/EventEdition/InfoPanel.vala @@ -152,6 +152,7 @@ public class Maya.View.EventEdition.InfoPanel : Gtk.Grid { var popover = new Gtk.Popover () { child = calchooser, + has_arrow = false, width_request = 310 }; diff --git a/src/Grid/Header.vala b/src/Grid/Header.vala index eb9e417ae..509aa08c7 100644 --- a/src/Grid/Header.vala +++ b/src/Grid/Header.vala @@ -69,7 +69,9 @@ public class Header : Granite.Bin { var menu = new GLib.Menu (); menu.append (_("Show Week Numbers"), "header.show-weeks"); - var gtk_menu = new Gtk.PopoverMenu.from_model (menu); + var gtk_menu = new Gtk.PopoverMenu.from_model (menu) { + has_arrow = false + }; gtk_menu.set_parent (this); var click_gesture = new Gtk.GestureClick () { diff --git a/src/Grid/WeekLabels.vala b/src/Grid/WeekLabels.vala index 6b7c38766..fc3d4f0c5 100644 --- a/src/Grid/WeekLabels.vala +++ b/src/Grid/WeekLabels.vala @@ -65,7 +65,9 @@ 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.PopoverMenu.from_model (menu); + var gtk_menu = new Gtk.PopoverMenu.from_model (menu) { + has_arrow = false + }; gtk_menu.set_parent (this); var click_gesture = new Gtk.GestureClick () { diff --git a/src/Widgets/EventMenu.vala b/src/Widgets/EventMenu.vala index 7ae0ed80d..998d90de5 100644 --- a/src/Widgets/EventMenu.vala +++ b/src/Widgets/EventMenu.vala @@ -41,7 +41,9 @@ namespace Maya.EventMenu { menu_model.prepend (_("Remove"), "event.remove"); } - var menu = new Gtk.PopoverMenu.from_model (menu_model); + var menu = new Gtk.PopoverMenu.from_model (menu_model) { + has_arrow = false + }; menu.insert_action_group ("event", action_group); E.Source src = comp.get_data ("source"); diff --git a/src/Widgets/SourcePopover.vala b/src/Widgets/SourcePopover.vala index 7babc61d7..42f2f4702 100644 --- a/src/Widgets/SourcePopover.vala +++ b/src/Widgets/SourcePopover.vala @@ -69,6 +69,7 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover { main_box.append (accounts_button); child = main_box; + has_arrow = false; populate.begin (); add_calendar_button.clicked.connect (() => { From 9479532e05b27b6ad537841189e2ee25662c8110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 24 Feb 2026 14:40:40 -0800 Subject: [PATCH 44/64] Fix stack switcher icons --- src/EventEdition/EventDialog.vala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/EventEdition/EventDialog.vala b/src/EventEdition/EventDialog.vala index 1d0420171..943ae0889 100644 --- a/src/EventEdition/EventDialog.vala +++ b/src/EventEdition/EventDialog.vala @@ -116,13 +116,12 @@ public class EventDialog : Granite.Dialog { stack.add_titled (repeat_panel, "repeatpanel", C_("Section Header", "Repeat")); //vala-lint=space-before-paren stack.get_page (info_panel).set_property ("icon-name", "office-calendar-symbolic"); - location_panel.set_property ("icon-name", "mark-location-symbolic"); - guests_panel.set_property ("icon-name", "system-users-symbolic"); - reminder_panel.set_property ("icon-name", "alarm-symbolic"); - repeat_panel.set_property ("icon-name", "media-playlist-repeat-symbolic"); + stack.get_page (location_panel).set_property ("icon-name", "mark-location-symbolic"); + stack.get_page (guests_panel).set_property ("icon-name", "system-users-symbolic"); + stack.get_page (reminder_panel).set_property ("icon-name", "alarm-symbolic"); + stack.get_page (repeat_panel).set_property ("icon-name", "media-playlist-repeat-symbolic"); var stack_switcher = new Gtk.StackSwitcher () { - margin_end = 12, margin_start = 12, stack = stack From 8590f276188cc182b4b074ef0a56c65e25c13d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 08:25:07 -0800 Subject: [PATCH 45/64] use GtkEntry for completion --- src/EventEdition/GuestsPanel.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EventEdition/GuestsPanel.vala b/src/EventEdition/GuestsPanel.vala index 5d2186d34..e9b810a42 100644 --- a/src/EventEdition/GuestsPanel.vala +++ b/src/EventEdition/GuestsPanel.vala @@ -8,7 +8,7 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { public ICal.Component component { get; construct; } - private Gtk.SearchEntry guest_entry; + private Gtk.Entry guest_entry; private Gtk.EntryCompletion guest_completion; private Gtk.ListBox guest_list; private Gee.ArrayList attendees; @@ -79,11 +79,11 @@ public class Maya.View.EventEdition.GuestsPanel : Gtk.Box { return false; }); - guest_entry = new Gtk.SearchEntry () { + guest_entry = new Gtk.Entry () { hexpand = true, placeholder_text = _("Invite") }; - // guest_entry.set_completion (guest_completion); + guest_entry.set_completion (guest_completion); guest_entry.activate.connect (() => { var attendee = new ICal.Property (ATTENDEE_PROPERTY); attendee.set_attendee (guest_entry.text); From ac30bb0c84ff3e98665292b27e118abe50f09f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 08:29:11 -0800 Subject: [PATCH 46/64] Fix some commented stuff --- src/EventEdition/LocationPanel.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index c550059f7..58e12c288 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -8,7 +8,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { private EventDialog parent_dialog; - private Gtk.SearchEntry location_entry; + private Gtk.Entry location_entry; private Gtk.ListStore location_store; private Shumate.SimpleMap simple_map; private Shumate.Marker point; @@ -47,8 +47,8 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { location_completion.set_text_column (1); location_completion.match_selected.connect ((model, iter) => suggestion_selected (model, iter)); - location_entry = new Gtk.SearchEntry () { - // completion = location_completion, + location_entry = new Gtk.Entry () { + completion = location_completion, hexpand = true, placeholder_text = _("John Smith OR Example St.") }; @@ -192,7 +192,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { point.longitude = place.location.longitude; Idle.add (() => { if (search_cancellable.is_cancelled () == false) { - // champlain_embed.champlain_view.go_to (point.latitude, point.longitude); + simple_map.map.go_to (point.latitude, point.longitude); } return false; @@ -251,7 +251,7 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { point.longitude = simple.location.longitude; Idle.add (() => { if (search_cancellable.is_cancelled () == false) { - // champlain_embed.champlain_view.go_to (point.latitude, point.longitude); + simple_map.map.go_to (point.latitude, point.longitude); } return false; From db40903390ba97a7ebb4fed9e5865b821b2810ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 08:40:13 -0800 Subject: [PATCH 47/64] Fix icon sizes --- src/AgendaView.vala | 1 + src/EventEdition/LocationPanel.vala | 3 ++- src/Grid/CalendarView.vala | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/AgendaView.vala b/src/AgendaView.vala index f766c730b..f760aeb37 100644 --- a/src/AgendaView.vala +++ b/src/AgendaView.vala @@ -28,6 +28,7 @@ public class Maya.View.AgendaView : Gtk.Box { application_instance.get_accels_for_action (button_add.action_name), _("Create a new event") ); + button_add.add_css_class (Granite.STYLE_CLASS_LARGE_ICONS); weekday_label = new Gtk.Label ("") { margin_start = 6, diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index 58e12c288..152721af7 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -63,7 +63,8 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { var registry = new Shumate.MapSourceRegistry.with_defaults (); simple_map = new Shumate.SimpleMap () { - map_source = registry.get_by_id (Shumate.MAP_SOURCE_OSM_MAPNIK) + map_source = registry.get_by_id (Shumate.MAP_SOURCE_OSM_MAPNIK), + vexpand = true }; point = new Shumate.Marker () { diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index f8e06d060..41cd89426 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -83,6 +83,7 @@ public class Maya.View.CalendarView : Gtk.Box { application_instance.get_accels_for_action (button_today.action_name), _("Go to today's date") ); + button_today.add_css_class (Granite.STYLE_CLASS_LARGE_ICONS); month_switcher = new Calendar.Widgets.DateSwitcher (10) { valign = CENTER @@ -102,6 +103,7 @@ public class Maya.View.CalendarView : Gtk.Box { popover = source_popover, tooltip_text = _("Manage Calendars") }; + menu_button.add_css_class (Granite.STYLE_CLASS_LARGE_ICONS); header_bar = new Adw.HeaderBar () { show_end_title_buttons = false, @@ -131,14 +133,12 @@ public class Maya.View.CalendarView : Gtk.Box { stack.notify["transition-running"].connect (() => { if (stack.transition_running == false) { - var child = stack.get_first_child (); - while (child != null) { - if (child != stack.visible_child) { - child.destroy (); - child = stack.get_first_child (); - } else { - child = child.get_next_sibling (); - } + if (stack.get_first_child () != stack.visible_child) { + stack.get_first_child ().destroy (); + } + + if (stack.get_last_child () != stack.visible_child) { + stack.get_last_child ().destroy (); } } }); From 9ac6969a57ca5b1774ffca735d2b9b5f9f09dd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 08:51:21 -0800 Subject: [PATCH 48/64] Minor adjustments --- src/EventEdition/EventDialog.vala | 1 + src/EventEdition/RepeatPanel.vala | 1 + src/Grid/CalendarView.vala | 3 ++- src/SourceDialog/SourceDialog.vala | 2 -- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/EventEdition/EventDialog.vala b/src/EventEdition/EventDialog.vala index 943ae0889..f08f3856e 100644 --- a/src/EventEdition/EventDialog.vala +++ b/src/EventEdition/EventDialog.vala @@ -129,6 +129,7 @@ public class EventDialog : Granite.Dialog { ((Gtk.BoxLayout) stack_switcher.layout_manager).homogeneous = true; var buttonbox = new Gtk.Box (HORIZONTAL, 6) { + halign = END, baseline_position = CENTER, margin_end = 12, margin_start = 12 diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index db0988e36..91cd04bd4 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -174,6 +174,7 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { var exceptions_box = new Gtk.Box (VERTICAL, 0) { margin_bottom = 12, + overflow = HIDDEN, sensitive = false }; exceptions_box.append (exceptions_list); diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index 41cd89426..d1a145fa7 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -103,7 +103,8 @@ public class Maya.View.CalendarView : Gtk.Box { popover = source_popover, tooltip_text = _("Manage Calendars") }; - menu_button.add_css_class (Granite.STYLE_CLASS_LARGE_ICONS); + // FIXME: breaks popover icon size + // menu_button.add_css_class (Granite.STYLE_CLASS_LARGE_ICONS); header_bar = new Adw.HeaderBar () { show_end_title_buttons = false, diff --git a/src/SourceDialog/SourceDialog.vala b/src/SourceDialog/SourceDialog.vala index 4985f2954..502b7ee9c 100644 --- a/src/SourceDialog/SourceDialog.vala +++ b/src/SourceDialog/SourceDialog.vala @@ -250,8 +250,6 @@ public class Maya.View.SourceDialog : Granite.Dialog { }); main_box = new Gtk.Box (VERTICAL, 0) { - margin_end = 12, - margin_start = 12, vexpand = true }; From 2bcce65b01e16cfc8f227f79b746e3783c16f71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 09:01:18 -0800 Subject: [PATCH 49/64] solve some warnings --- src/Widgets/AgendaEventRow.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index 0b401b298..196e3bd1f 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -316,7 +316,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { datetime_label.label = get_timespan_label (start_date, end_date); if (datetime_label.label != "") { main_grid.attach (datetime_label, 1, 1); - } else { + } else if (datetime_label.parent != null){ main_grid.remove (datetime_label); } From 8eda46f261110d447f8a8a74934b4d2b8daf68f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 09:04:47 -0800 Subject: [PATCH 50/64] Remove clutter --- src/meson.build | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/meson.build b/src/meson.build index 442fbf1d6..7473a0cf0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -50,8 +50,6 @@ calendar_deps = [ libical_dep, gmodule_dep, m_dep, - # clutter_dep, - # clutter_gtk_dep, folks_dep, geocode_glib_dep, gclue_dep, From 320351b28480bb22f59ee1b6c49d672be2e3c747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 12:11:15 -0800 Subject: [PATCH 51/64] Show events --- src/Grid/GridDay.vala | 1 + src/Grid/VAutoHider.vala | 19 ++++++++----------- src/Widgets/AgendaEventRow.vala | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 22b2cfd75..8ec3df083 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -123,6 +123,7 @@ public class Maya.View.GridDay : Granite.Bin { } event_box.add (button); + button.show_without_animate (); } public bool update_event (ECal.Component modified_event) { diff --git a/src/Grid/VAutoHider.vala b/src/Grid/VAutoHider.vala index daf7a67e2..7d7f9eb3c 100644 --- a/src/Grid/VAutoHider.vala +++ b/src/Grid/VAutoHider.vala @@ -7,10 +7,13 @@ */ public class Maya.View.VAutoHider : Granite.Bin { + private List children; private Gtk.Label more_label; private Gtk.Box main_box; construct { + children = new List (); + more_label = new Gtk.Label ("") { valign = END }; @@ -22,14 +25,10 @@ public class Maya.View.VAutoHider : Granite.Bin { } public void add (Gtk.Widget widget) { - // var children = main_box.get_children (); - // children.append (widget); - - // children.sort (compare_children); - - // int index = children.index (widget); + children.append (widget); main_box.append (widget); - // main_box.reorder_child (widget, index); + + update (widget); widget.destroy.connect (() => { queue_resize (); @@ -39,11 +38,9 @@ public class Maya.View.VAutoHider : Granite.Bin { } public void update (Gtk.Widget widget) { - // var children = main_box.get_children (); - - // children.sort (compare_children); + children.sort (compare_children); - // int index = children.index (widget); + int index = children.index (widget); // main_box.reorder_child (widget, index); } diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index 196e3bd1f..493e20780 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -245,7 +245,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { location_revealer.reveal_child = location_label.label != null && location_label.label != ""; }); - show.connect (() => { + map.connect (() => { revealer.set_reveal_child (true); }); From 679be299f9c22c8571bd30b28b413901c8760473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 12:13:48 -0800 Subject: [PATCH 52/64] Fix clicking grid days --- src/Grid/GridDay.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 8ec3df083..6378deb1d 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -55,7 +55,7 @@ public class Maya.View.GridDay : Granite.Bin { container_box.append (label); container_box.append (event_box); - can_focus = true; + focusable = true; child = container_box; add_css_class ("cell"); From 9f45a1acae7e00d3c56daabfcf99337894ac303f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 12:14:40 -0800 Subject: [PATCH 53/64] Remove unneeded controller --- src/Grid/Grid.vala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Grid/Grid.vala b/src/Grid/Grid.vala index 9a5a73b73..58bb26f3e 100644 --- a/src/Grid/Grid.vala +++ b/src/Grid/Grid.vala @@ -158,7 +158,6 @@ public class Grid : Gtk.Grid { // Still update_day to get the color of etc. right day = update_day (new GridDay (new_date), new_date, today, month_start); day.on_event_add.connect ((date) => on_event_add (date)); - // day.scroll_event.connect ((event) => {scroll_event (event); return false;}); var focus_controller = new Gtk.EventControllerFocus (); focus_controller.enter.connect (() => { From 0bde2c7ba85fe1ae465cd5005650137f8cff849f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 12:20:28 -0800 Subject: [PATCH 54/64] CalendarView: fix menu icon size --- src/Grid/CalendarView.vala | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index d1a145fa7..ad9f574a1 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -99,12 +99,17 @@ public class Maya.View.CalendarView : Gtk.Box { var source_popover = new Calendar.Widgets.SourcePopover (); var menu_button = new Gtk.MenuButton () { - icon_name = "open-menu", + child = new Gtk.Image.from_icon_name ("open-menu") { + icon_size = LARGE + }, + has_frame = false, popover = source_popover, - tooltip_text = _("Manage Calendars") + primary = true, + tooltip_markup = ("%s\n" + Granite.TOOLTIP_SECONDARY_TEXT_MARKUP).printf ( + _("Manage Calendars"), + "F10" + ) }; - // FIXME: breaks popover icon size - // menu_button.add_css_class (Granite.STYLE_CLASS_LARGE_ICONS); header_bar = new Adw.HeaderBar () { show_end_title_buttons = false, From dfe0ef7d8cd548345902818c2d7961db063e113a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 12:23:57 -0800 Subject: [PATCH 55/64] note stylesheet bug --- src/Grid/CalendarView.vala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala index ad9f574a1..d949b4159 100644 --- a/src/Grid/CalendarView.vala +++ b/src/Grid/CalendarView.vala @@ -99,6 +99,7 @@ public class Maya.View.CalendarView : Gtk.Box { var source_popover = new Calendar.Widgets.SourcePopover (); var menu_button = new Gtk.MenuButton () { + // FIXME: Workaround for stylesheet bug child = new Gtk.Image.from_icon_name ("open-menu") { icon_size = LARGE }, From bfe8f4256b86893e8133e9b96b74aa5ab71a99b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 12:27:21 -0800 Subject: [PATCH 56/64] Remove commented code --- src/EventEdition/RepeatPanel.vala | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/EventEdition/RepeatPanel.vala b/src/EventEdition/RepeatPanel.vala index 91cd04bd4..785347957 100644 --- a/src/EventEdition/RepeatPanel.vala +++ b/src/EventEdition/RepeatPanel.vala @@ -546,7 +546,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { private void reorder_week_box () { switch (Calendar.EventStore.get_default ().week_starts_on) { case MONDAY: - // week_box.reorder_child (mon_button, 0); week_box.reorder_child_after (tue_button, mon_button); week_box.reorder_child_after (wed_button, tue_button); week_box.reorder_child_after (thu_button, wed_button); @@ -555,7 +554,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { week_box.reorder_child_after (sun_button, sat_button); break; case TUESDAY: - // week_box.reorder_child (tue_button, 0); week_box.reorder_child_after (wed_button, tue_button); week_box.reorder_child_after (thu_button, wed_button); week_box.reorder_child_after (fri_button, thu_button); @@ -564,7 +562,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { week_box.reorder_child_after (mon_button, sun_button); break; case WEDNESDAY: - // week_box.reorder_child (wed_button, 0); week_box.reorder_child_after (thu_button, wed_button); week_box.reorder_child_after (fri_button, thu_button); week_box.reorder_child_after (sat_button, fri_button); @@ -573,7 +570,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { week_box.reorder_child_after (tue_button, mon_button); break; case THURSDAY: - // week_box.reorder_child (thu_button, 0); week_box.reorder_child_after (fri_button, thu_button); week_box.reorder_child_after (sat_button, fri_button); week_box.reorder_child_after (sun_button, sat_button); @@ -582,7 +578,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { week_box.reorder_child_after (wed_button, tue_button); break; case FRIDAY: - // week_box.reorder_child (fri_button, 0); week_box.reorder_child_after (sat_button, fri_button); week_box.reorder_child_after (sun_button, sat_button); week_box.reorder_child_after (mon_button, sun_button); @@ -591,7 +586,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { week_box.reorder_child_after (thu_button, wed_button); break; case SATURDAY: - // week_box.reorder_child (sat_button, 0); week_box.reorder_child_after (sun_button, sat_button); week_box.reorder_child_after (mon_button, sun_button); week_box.reorder_child_after (tue_button, mon_button); @@ -600,7 +594,6 @@ public class Maya.View.EventEdition.RepeatPanel : Granite.Bin { week_box.reorder_child_after (fri_button, thu_button); break; case SUNDAY: - // week_box.reorder_child (sun_button, 0); week_box.reorder_child_after (mon_button, sun_button); week_box.reorder_child_after (tue_button, mon_button); week_box.reorder_child_after (wed_button, tue_button); From 56178ae0251932a96f66bb7e84f9bb72da6e7840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 12:31:20 -0800 Subject: [PATCH 57/64] Remove extra margin --- src/Widgets/CalendarChooser.vala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Widgets/CalendarChooser.vala b/src/Widgets/CalendarChooser.vala index 302fd28bd..5d26f33c3 100644 --- a/src/Widgets/CalendarChooser.vala +++ b/src/Widgets/CalendarChooser.vala @@ -171,9 +171,7 @@ public class Maya.View.Widgets.CalendarChooser : Gtk.Box { } var header = new Granite.HeaderLabel (row_location) { - margin_top = 6, - margin_end = 6, - margin_start = 6 + margin_top = 6 }; row.set_header (header); From 4a9a1cb06a3651d6290d871af1131d8849e5b762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 26 Feb 2026 13:03:10 -0800 Subject: [PATCH 58/64] Try to fix vautohider with limited success --- src/Grid/VAutoHider.vala | 145 ++++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 71 deletions(-) diff --git a/src/Grid/VAutoHider.vala b/src/Grid/VAutoHider.vala index 7d7f9eb3c..ac95cb522 100644 --- a/src/Grid/VAutoHider.vala +++ b/src/Grid/VAutoHider.vala @@ -40,79 +40,82 @@ public class Maya.View.VAutoHider : Granite.Bin { public void update (Gtk.Widget widget) { children.sort (compare_children); - int index = children.index (widget); - // main_box.reorder_child (widget, index); + while (main_box.get_first_child () != null) { + main_box.remove (main_box.get_first_child ()); + } + + foreach (var child in children) { + main_box.append (child); + } + } + + public override void size_allocate (int width, int height, int baseline) { + base.size_allocate (width, height, baseline); + + int children_length = (int) children.length (); + if (children_length == 0) { + more_label.hide (); + return; + } + + + + more_label.show (); + more_label.vexpand = false; + var more_label_height = more_label.get_height (); + more_label.vexpand = true; + more_label.hide (); + + int internal_height = 0; + int shown_children = 0; + foreach (var child in children) { + if (child == more_label) + continue; + + bool last = (shown_children == children_length - 1); + + child.show (); + var child_height = child.get_height (); + ((Maya.View.EventButton) child).hide_without_animate (); + + bool should_hide; + if (height - more_label_height < child_height + internal_height) { + should_hide = true; + if (last && (height >= child_height + internal_height)) { + should_hide = false; + } + } else { + should_hide = false; + internal_height += child_height; + } + + if (should_hide) { + ((Maya.View.EventButton) child).hide_without_animate (); + } else { + ((Maya.View.EventButton) child).show_without_animate (); + shown_children++; + } + } + + int more = children_length - shown_children; + if (shown_children != children_length && more > 0) { + more_label.show (); + more_label.set_label (_("%u more…").printf ((uint)more)); + } else { + more_label.hide (); + } } - // public override void size_allocate (Gtk.Allocation allocation) { - // base.size_allocate (allocation); - // int global_height = allocation.height; - // int children_length = (int)main_box.get_children ().length () - 1; - // if (children_length == 0) { - // more_label.hide (); - // return; - // } - - // int height = 0; - // int more_label_height; - // int shown_children = 0; - // more_label.show (); - // more_label.vexpand = false; - // more_label.get_preferred_height (out more_label_height, null); - // more_label.vexpand = true; - // more_label.hide (); - // foreach (var child in main_box.get_children ()) { - // if (child == more_label) - // continue; - - // bool last = (shown_children == children_length - 1); - - // int child_height; - // child.show (); - // child.get_preferred_height (out child_height, null); - // ((Maya.View.EventButton) child).hide_without_animate (); - - // bool should_hide; - // if (global_height - more_label_height < child_height + height) { - // should_hide = true; - // if (last && (global_height >= child_height + height)) { - // should_hide = false; - // } - // } else { - // should_hide = false; - // height += child_height; - // } - - // if (should_hide) { - // ((Maya.View.EventButton) child).hide_without_animate (); - // } else { - // ((Maya.View.EventButton) child).show_without_animate (); - // shown_children++; - // } - // } - - // int more = children_length - shown_children; - // if (shown_children != children_length && more > 0) { - // more_label.show (); - // more_label.set_label (_("%u more…").printf ((uint)more)); - // } else { - // more_label.hide (); - // } - // } - - // public override void get_preferred_width (out int minimum_width, out int natural_width) { - // base.get_preferred_width (out minimum_width, out natural_width); - // more_label.get_preferred_width (out minimum_width, null); - // if (minimum_width > natural_width) - // natural_width = minimum_width; - // } - - // public override void get_preferred_height (out int minimum_height, out int natural_height) { - // base.get_preferred_height (out minimum_height, out natural_height); - // more_label.get_preferred_height (out minimum_height, null); - // if (minimum_height > natural_height) - // natural_height = minimum_height; - // } + public override void measure (Gtk.Orientation orientation, int for_size, out int minimum, out int natural, out int minimum_baseline, out int natural_baseline) { + base.measure (orientation, for_size, out minimum, out natural, out minimum_baseline, out natural_baseline); + + for_size = more_label.get_width (); + + minimum = more_label.get_height (); + if (minimum > natural) { + natural = minimum; + } + } public static GLib.CompareFunc compare_children = (a, b) => { EventButton a2 = a as EventButton; From a684c3c35a663c4e7f9d64ad7b63f6f984496a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 27 Feb 2026 07:57:07 -0800 Subject: [PATCH 59/64] Internal DND --- src/Grid/EventButton.vala | 23 +++++++++++----- src/Grid/GridDay.vala | 58 ++++++++++++++++++++------------------- 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/Grid/EventButton.vala b/src/Grid/EventButton.vala index ff7ee36c7..7fd61bddd 100644 --- a/src/Grid/EventButton.vala +++ b/src/Grid/EventButton.vala @@ -75,18 +75,20 @@ public class Maya.View.EventButton : Granite.Bin { 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); + var drag_source = new Gtk.DragSource () { + actions = MOVE + }; + drag_source.prepare.connect (on_drag_prepare); + + add_controller (click_gesture); + add_controller (long_press_gesture); + add_controller (drag_source); + // 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); @@ -108,6 +110,13 @@ public class Maya.View.EventButton : Granite.Bin { }); } + private Gdk.ContentProvider? on_drag_prepare (double x, double y) { + Calendar.EventStore.get_default ().drag_component = comp; + unowned var icalcomp = comp.get_icalcomponent (); + + return new Gdk.ContentProvider.for_value (icalcomp.as_ical_string ()); + } + public string get_uid () { return comp.get_id ().get_uid (); } diff --git a/src/Grid/GridDay.vala b/src/Grid/GridDay.vala index 6378deb1d..a0556e125 100644 --- a/src/Grid/GridDay.vala +++ b/src/Grid/GridDay.vala @@ -70,11 +70,14 @@ public class Maya.View.GridDay : Granite.Bin { }; key_controller.key_pressed.connect (on_key_press); + // Gtk.TargetEntry dnd = {"binary/calendar", 0, 0}; + var drop_target = new Gtk.DropTarget (typeof (string), Gdk.DragAction.MOVE); + drop_target.accept.connect (on_drop_accept); + drop_target.drop.connect (on_drag_drop); + 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); + add_controller (drop_target); this.bind_property ("date", label, "label", BindingFlags.SYNC_CREATE, (binding, srcval, ref targetval) => { unowned var date = (GLib.DateTime) srcval.get_boxed (); @@ -83,31 +86,30 @@ 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); - // } + private bool on_drop_accept (Gdk.Drop drop) { + return true; + } + + private bool on_drag_drop (GLib.Value value, double x, double y) { + 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); + + return true; + } public void add_event (ECal.Component component) { var button = new EventButton (component); From df82e5cbaf2cffd73cbb282d8c6d08a5bf7d79c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 9 Apr 2026 11:48:41 -0700 Subject: [PATCH 60/64] Fix bad merge --- src/Widgets/SourceRow.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Widgets/SourceRow.vala b/src/Widgets/SourceRow.vala index e56cc4910..015a43fc7 100644 --- a/src/Widgets/SourceRow.vala +++ b/src/Widgets/SourceRow.vala @@ -156,11 +156,11 @@ public class Calendar.SourceRow : Gtk.ListBoxRow { "; var style_provider = new Gtk.CssProvider (); - style_provider.load_from_string (css_color); + style_provider.load_from_string (style); providers[color] = style_provider; - Gtk.StyleContext.add_provider_for_screen ( - Gdk.Screen.get_default (), + Gtk.StyleContext.add_provider_for_display ( + Gdk.Display.get_default (), providers[color], Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION ); From 2e52b6a5a06d2ca601771761b43a084e7b6e8159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 9 Apr 2026 11:49:36 -0700 Subject: [PATCH 61/64] Lint --- src/Widgets/AgendaEventRow.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/AgendaEventRow.vala b/src/Widgets/AgendaEventRow.vala index 493e20780..78f82f1f0 100644 --- a/src/Widgets/AgendaEventRow.vala +++ b/src/Widgets/AgendaEventRow.vala @@ -316,7 +316,7 @@ public class Maya.View.AgendaEventRow : Gtk.ListBoxRow { datetime_label.label = get_timespan_label (start_date, end_date); if (datetime_label.label != "") { main_grid.attach (datetime_label, 1, 1); - } else if (datetime_label.parent != null){ + } else if (datetime_label.parent != null) { main_grid.remove (datetime_label); } From e1a2d2b70e021b3773292c3a2e0f7bcfa533723f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sun, 6 Sep 2026 14:43:12 -0700 Subject: [PATCH 62/64] LocationPanel: remove dead --- src/EventEdition/LocationPanel.vala | 33 ----------------------------- 1 file changed, 33 deletions(-) diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index 75f5bfd4c..de81bd0a9 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -72,10 +72,6 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { icon_size = LARGE } }; - // point.drag_finish.connect (() => { - // map_selected = true; - // find_location.begin (point.latitude, point.longitude); - // }); var marker_layer = new Shumate.MarkerLayer.full (simple_map.viewport, SINGLE); marker_layer.add_marker (point); @@ -212,35 +208,6 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { } } - private async void find_location (double latitude, double longitude) { - if (find_cancellable != null) { - find_cancellable.cancel (); - } - - find_cancellable = new GLib.Cancellable (); - Geocode.Location location = new Geocode.Location (latitude, longitude); - var reverse = new Geocode.Reverse.for_location (location); - - try { - var address = yield reverse.resolve_async (find_cancellable); - var builder = new StringBuilder (); - if (address.street != null) { - builder.append (address.street); - add_address_line (builder, address.town); - add_address_line (builder, address.county); - add_address_line (builder, address.postal_code); - add_address_line (builder, address.country); - } else { - builder.append (address.name); - add_address_line (builder, address.country); - } - - location_entry.grab_focus (); - } catch (Error error) { - debug (error.message); - } - } - private async void discover_location () { if (search_cancellable != null) { search_cancellable.cancel (); From d08bb0394968788a9dba8dd2d8764679aa3f123f Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Sun, 6 Sep 2026 15:00:35 -0700 Subject: [PATCH 63/64] Make flatpak work --- io.elementary.calendar.yml | 67 ++++++++++++-------------------------- 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/io.elementary.calendar.yml b/io.elementary.calendar.yml index da932a146..f7548abf4 100644 --- a/io.elementary.calendar.yml +++ b/io.elementary.calendar.yml @@ -1,6 +1,6 @@ id: io.elementary.calendar runtime: io.elementary.Platform -runtime-version: '8.2' +runtime-version: '9' sdk: io.elementary.Sdk command: io.elementary.calendar finish-args: @@ -50,7 +50,7 @@ modules: sources: - type: git url: https://github.com/libical/libical.git - tag: v3.0.9 + tag: v3.0.20 - name: evolution-data-server buildsystem: cmake-ninja @@ -91,55 +91,30 @@ modules: url: https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz md5: 12e517cac2b57a0121cda351570f1e63 - - name: clutter-gtk - cleanup: - - /share/gtk-doc + - name: libshumate + buildsystem: meson + config-opts: + - -Dgtk_doc=false sources: - type: archive - url: https://download.gnome.org/sources/clutter-gtk/1.8/clutter-gtk-1.8.4.tar.xz - sha256: 521493ec038973c77edcb8bc5eac23eed41645117894aaee7300b2487cb42b06 + url: https://download.gnome.org/sources/libshumate/1.6/libshumate-1.6.3.tar.xz + sha256: fd15c91396dcd82fce3021648541aa891e71a6bddeffc03d38597580a7da8ca1 + x-checker-data: + type: gnome + name: libshumate modules: - - name: cogl + - name: protobuf-c + buildsystem: autotools config-opts: - - --disable-cogl-gst - - --disable-gtk-doc - - --enable-xlib-egl-platform - - --enable-wayland-egl-platform - cleanup: - - /share/gtk-doc - - /share/cogl/examples-data - sources: - - type: archive - url: https://download.gnome.org/sources/cogl/1.22/cogl-1.22.8.tar.xz - sha256: a805b2b019184710ff53d0496f9f0ce6dcca420c141a0f4f6fcc02131581d759 - - name: clutter - config-opts: - - --disable-gtk-doc - - --enable-egl-backend - - --enable-wayland-backend - - --enable-deprecated=no - cleanup: - - /share/gtk-doc + - --disable-protoc sources: - - type: archive - url: https://download.gnome.org/sources/clutter/1.26/clutter-1.26.4.tar.xz - sha256: 8b48fac159843f556d0a6be3dbfc6b083fc6d9c58a20a49a6b4919ab4263c4e6 - - name: clutter-gst - config-opts: - - --disable-gtk-doc - cleanup: - - /share/gtk-doc - sources: - - type: archive - url: https://download.gnome.org/sources/clutter-gst/3.0/clutter-gst-3.0.27.tar.xz - sha256: fe69bd6c659d24ab30da3f091eb91cd1970026d431179b0724f13791e8ad9f9d - - - name: champlain - buildsystem: meson - sources: - - type: archive - url: https://download.gnome.org/sources/libchamplain/0.12/libchamplain-0.12.21.tar.xz - sha256: a915cd172a0c52944c5579fcb4683f8a878c571bf5e928254b5dafefc727e5a7 + - type: git + url: https://github.com/protobuf-c/protobuf-c.git + tag: v1.5.2 + commit: 4719fdd7760624388c2c5b9d6759eb6a47490626 + x-checker-data: + type: git + tag-pattern: ^v([\d.]+)$ - name: folks buildsystem: meson From 0230cc43770e6182b1449a376d47e20e5f87bff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sun, 6 Sep 2026 15:05:39 -0700 Subject: [PATCH 64/64] Update ci.yml --- .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 7c269298b..81106385d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false container: - image: ghcr.io/elementary/flatpak-platform/runtime:8.2-${{ matrix.configuration.arch }} + image: ghcr.io/elementary/flatpak-platform/runtime:9-${{ matrix.configuration.arch }} options: --privileged steps: