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
@@ -96,6 +96,7 @@ enum
PROP_0,
PROP_CONTEXT,
PROP_DATE,
PROP_TIME_DIRECTION,
N_PROPS,
};
@@ -1592,6 +1593,10 @@ gcal_month_view_get_property (GObject *object,
g_value_set_object (value, self->context);
break;
case PROP_TIME_DIRECTION:
g_value_set_enum (value, GTK_ORIENTATION_VERTICAL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -1644,6 +1649,7 @@ gcal_month_view_class_init (GcalMonthViewClass *klass)
g_object_class_override_property (object_class, PROP_CONTEXT, "context");
g_object_class_override_property (object_class, PROP_DATE, "active-date");
g_object_class_override_property (object_class, PROP_TIME_DIRECTION, "time-direction");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-month-view.ui");