views: add time direction property

The time direction property tells which orientation one
needs to scroll to change the time of the view. In these
directions (up/down v left/right) the new prev/next
buttons will be pointing.

The two buttons will be added in a subsequent commit,
and will gain view-dependent tooltips.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/542>
This commit is contained in:
Markus Göllnitz
2025-06-08 09:59:00 +00:00
committed by Marge Bot
parent d400048bc6
commit 4a4dce8ee3
6 changed files with 59 additions and 0 deletions
+6
View File
@@ -102,6 +102,7 @@ enum
PROP_SPLIT_MONTH_YEAR,
PROP_DATE,
PROP_CONTEXT,
PROP_TIME_DIRECTION,
NUM_PROPERTIES = PROP_SPLIT_MONTH_YEAR + 1,
};
@@ -739,6 +740,10 @@ calendar_get_property (GObject *obj,
g_value_set_boolean (value, self->split_month_year);
break;
case PROP_TIME_DIRECTION:
g_value_set_enum (value, GTK_ORIENTATION_VERTICAL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
break;
@@ -894,6 +899,7 @@ gcal_date_chooser_class_init (GcalDateChooserClass *class)
g_object_class_override_property (object_class, PROP_DATE, "active-date");
g_object_class_override_property (object_class, PROP_CONTEXT, "context");
g_object_class_override_property (object_class, PROP_TIME_DIRECTION, "time-direction");
signals[DAY_SELECTED] = g_signal_new ("day-selected",
G_OBJECT_CLASS_TYPE (object_class),