Move UI files to src/

Keep it in sync with what To Do and Settings do.
This commit is contained in:
Georges Basile Stavracas Neto
2019-12-02 16:41:56 -03:00
parent d843885fc0
commit b772349c3f
51 changed files with 81 additions and 281 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ gcal_month_cell_class_init (GcalMonthCellClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/month-cell.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-month-cell.ui");
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, day_label);
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, header_box);
+99
View File
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalMonthCell" parent="GtkEventBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="expand">True</property>
<signal name="enter-notify-event" handler="enter_notify_event_cb" object="GcalMonthCell" swapped="no" />
<signal name="leave-notify-event" handler="leave_notify_event_cb" object="GcalMonthCell" swapped="no" />
<child>
<object class="GtkOverlay" id="overlay">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child type="overlay">
<object class="GtkBox" id="header_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">start</property>
<property name="spacing">6</property>
<property name="margin">6</property>
<property name="margin-bottom">0</property>
<child>
<object class="GtkLabel" id="day_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<style>
<class name="day-label" />
</style>
</object>
</child>
<!-- Weather forecast -->
<child>
<object class="GtkImage" id="weather_icon">
<property name="can-focus">False</property>
<property name="visible">True</property>
<property name="pixel_size">16</property>
<property name="margin-start">12</property>
<style>
<class name="dim-label" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="temp_label">
<property name="visible">True</property>
<property name="can-focus">True</property>
<style>
<class name="dim-label" />
<class name="temp-label" />
</style>
</object>
</child>
</object>
</child>
<!-- HACK: in Gtk3, insensitive widgets receive no events. We "fix" this
limitation by adding an always-sensitive GtkEventBox above the event,
and when the event is insensitive, the event box's event window is
above it -->
<child type="overlay">
<object class="GtkEventBox" id="button_event_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="above-child" bind-source="overflow_button" bind-property="sensitive" bind-flags="default|invert-boolean|sync-create" />
<signal name="enter-notify-event" handler="enter_notify_event_cb" object="GcalMonthCell" swapped="no" />
<signal name="leave-notify-event" handler="leave_notify_event_cb" object="GcalMonthCell" swapped="no" />
<child>
<object class="GtkButton" id="overflow_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">end</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="overflow_button_clicked_cb" object="GcalMonthCell" swapped="no" />
<style>
<class name="flat" />
</style>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="overflow_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="ellipsize">end</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+1 -1
View File
@@ -721,7 +721,7 @@ gcal_month_popover_class_init (GcalMonthPopoverClass *klass)
1,
GCAL_TYPE_EVENT_WIDGET);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/month-popover.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-month-popover.ui");
gtk_widget_class_bind_template_callback (widget_class, close_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, new_event_button_clicked_cb);
+99
View File
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalMonthPopover" parent="GtkWindow">
<property name="modal">false</property>
<property name="opacity">0.0</property>
<property name="destroy-with-parent">true</property>
<child>
<object class="GtkBox">
<property name="visible">true</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<!-- Day label & close button-->
<child>
<object class="GtkBox">
<property name="visible">true</property>
<child>
<object class="GtkLabel" id="day_label">
<property name="visible">true</property>
<property name="label">12</property>
<property name="xalign">0.0</property>
<property name="hexpand">true</property>
<attributes>
<attribute name="scale" value="2.25" />
</attributes>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="relief">none</property>
<signal name="clicked" handler="close_button_clicked_cb" object="GcalMonthPopover" swapped="yes" />
<child>
<object class="GtkImage">
<property name="visible">true</property>
<property name="icon-name">window-close-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
<!-- Event list revealer -->
<child>
<object class="GtkRevealer" id="revealer">
<property name="reveal-child">false</property>
<property name="transition-duration">200</property>
<property name="transition-type">slide-down</property>
<property name="visible">true</property>
<child>
<object class="GtkBox" id="top_box">
<property name="orientation">vertical</property>
<property name="visible">true</property>
<child>
<object class="DzlElasticBin" id="elastic">
<property name="visible">true</property>
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="hscrollbar-policy">never</property>
<property name="propagate-natural-height">true</property>
<property name="visible">true</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="visible">true</property>
<property name="selection-mode">none</property>
<style>
<class name="background" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<!-- New Event button -->
<child>
<object class="GtkButton" id="new_event_button">
<property name="visible">true</property>
<property name="relief">none</property>
<property name="label" translatable="yes">New Event…</property>
<signal name="clicked" handler="new_event_button_clicked_cb" object="GcalMonthPopover" swapped="no" />
</object>
</child>
</object>
</child>
</template>
</interface>
+1 -1
View File
@@ -2288,7 +2288,7 @@ gcal_month_view_class_init (GcalMonthViewClass *klass)
g_object_class_override_property (object_class, PROP_DATE, "active-date");
g_object_class_override_property (object_class, PROP_CONTEXT, "context");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/month-view.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-month-view.ui");
gtk_widget_class_bind_template_child (widget_class, GcalMonthView, label_0);
gtk_widget_class_bind_template_child (widget_class, GcalMonthView, label_1);
+145
View File
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalMonthView" parent="GtkContainer">
<!-- Header -->
<child type="header">
<object class="GtkBox">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">true</property>
<child>
<object class="GtkLabel" id="month_label">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="month-name" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="year_label">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">1.0</property>
<style>
<class name="secondary-label" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">true</property>
<property name="spacing">6</property>
<property name="margin-start">6</property>
<property name="margin-end">6</property>
<property name="margin-bottom">6</property>
<child>
<object class="GtkLabel" id="label_0">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_1">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_2">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_3">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_4">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_5">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_6">
<property name="visible">true</property>
<property name="can_focus">false</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<!-- Grid -->
<child type="grid">
<object class="GtkGrid" id="grid">
<property name="visible">true</property>
<property name="can-focus">false</property>
<property name="row-homogeneous">true</property>
<property name="column-homogeneous">true</property>
</object>
</child>
</template>
</interface>
+1 -1
View File
@@ -1651,7 +1651,7 @@ gcal_week_header_class_init (GcalWeekHeaderClass *kclass)
1,
GCAL_TYPE_EVENT_WIDGET);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/week-header.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-week-header.ui");
gtk_widget_class_bind_template_child (widget_class, GcalWeekHeader, expand_button);
gtk_widget_class_bind_template_child (widget_class, GcalWeekHeader, expand_button_box);
+208
View File
@@ -0,0 +1,208 @@
<?xml version="1.0"?>
<interface>
<template class="GcalWeekHeader" parent="GtkGrid">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<style>
<class name="week-header" />
</style>
<child>
<object class="GtkBox" id="header_labels_box">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkLabel" id="month_label">
<property name="visible">True</property>
<property name="label">Month</property>
<property name="yalign">0</property>
<style>
<class name="primary-label" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="week_label">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label">Week</property>
<style>
<class name="secondary-label" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="year_label">
<property name="visible">True</property>
<property name="label">Year</property>
<property name="yalign">0</property>
<style>
<class name="secondary-label" />
</style>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkBox" id="expand_button_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">False</property>
<child>
<object class="GtkButton" id="expand_button">
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="halign">center</property>
<property name="valign">end</property>
<property name="margin-bottom">6</property>
<signal name="clicked" handler="on_expand_action_activated" object="GcalWeekHeader" swapped="yes"/>
<style>
<class name="flat" />
<class name="circular" />
</style>
<child>
<object class="GtkImage" id="expand_button_image">
<property name="visible">True</property>
<property name="icon_name">go-down-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkEventBox">
<property name="visible">True</property>
<signal name="button-press-event" handler="on_button_pressed" object="GcalWeekHeader" swapped="yes" />
<signal name="motion-notify-event" handler="on_motion_notify" object="GcalWeekHeader" swapped="yes" />
<signal name="button-release-event" handler="on_button_released" object="GcalWeekHeader" swapped="yes" />
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="hscrollbar-policy">never</property>
<property name="vscrollbar-policy">never</property>
<property name="propagate-natural-height">True</property>
<property name="margin-bottom">2</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="column-homogeneous">True</property>
<property name="hexpand">True</property>
<property name="column-spacing">6</property>
<property name="row-spacing">2</property>
<property name="margin-start">6</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">6</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</template>
<object class="GtkSizeGroup" id="sizegroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="expand_button_box"/>
</widgets>
</object>
</interface>
+1 -1
View File
@@ -632,7 +632,7 @@ gcal_week_view_class_init (GcalWeekViewClass *klass)
g_object_class_override_property (object_class, PROP_DATE, "active-date");
g_object_class_override_property (object_class, PROP_CONTEXT, "context");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/week-view.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-week-view.ui");
gtk_widget_class_bind_template_child (widget_class, GcalWeekView, header);
gtk_widget_class_bind_template_child (widget_class, GcalWeekView, hours_bar);
+49
View File
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<interface>
<template class="GcalWeekView" parent="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<style>
<class name="week-view" />
</style>
<child>
<object class="GcalWeekHeader" id="header">
<property name="visible">True</property>
<signal name="event-activated" handler="on_event_activated" object="GcalWeekView" swapped="yes" />
</object>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkDrawingArea" id="hours_bar">
<property name="visible">True</property>
<property name="height-request">2568</property>
<signal name="draw" handler="gcal_week_view_draw_hours" object="GcalWeekView" swapped="yes" />
</object>
</child>
<child>
<object class="GcalWeekGrid" id="week_grid">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<signal name="event-activated" handler="on_event_activated" object="GcalWeekView" swapped="yes" />
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+1 -1
View File
@@ -2063,7 +2063,7 @@ gcal_year_view_class_init (GcalYearViewClass *klass)
FALSE,
G_PARAM_READWRITE));
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/year-view.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-year-view.ui");
gtk_widget_class_bind_template_child (widget_class, GcalYearView, navigator);
gtk_widget_class_bind_template_child (widget_class, GcalYearView, sidebar);
+172
View File
@@ -0,0 +1,172 @@
<?xml version="1.0"?>
<interface>
<!-- interface-requires gtk+ 3.10 -->
<template class="GcalYearView" parent="GtkBox">
<style>
<class name="year-view"/>
</style>
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="visible">True</property>
<property name="shadow_type">none</property>
<property name="vexpand">True</property>
<signal name="edge-overshot" handler="navigator_edge_overshot_cb" object="GcalYearView" swapped="yes"/>
<signal name="scroll-event" handler="navigator_scroll_event_cb" object="GcalYearView" swapped="yes"/>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="shadow_type">none</property>
<property name="vexpand">True</property>
<child>
<object class="GtkDrawingArea" id="navigator">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="events">GDK_POINTER_MOTION_MASK|GDK_BUTTON_MOTION_MASK|GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK|GDK_STRUCTURE_MASK</property>
<signal name="draw" handler="draw_navigator" object="GcalYearView" swapped="yes"/>
<signal name="button-press-event" handler="navigator_button_press_cb" object="GcalYearView" swapped="yes"/>
<signal name="button-release-event" handler="navigator_button_release_cb" object="GcalYearView" swapped="yes"/>
<signal name="motion-notify-event" handler="navigator_motion_notify_cb" object="GcalYearView" swapped="yes"/>
<signal name="drag-motion" handler="navigator_drag_motion_cb" object="GcalYearView" swapped="yes"/>
<signal name="drag-drop" handler="navigator_drag_drop_cb" object="GcalYearView" swapped="yes"/>
<signal name="drag-leave" handler="navigator_drag_leave_cb" object="GcalYearView" swapped="yes"/>
<style>
<class name="year-navigator"/>
</style>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
<property name="pack_type">start</property>
</packing>
</child>
<child>
<object class="GtkBox" id="sidebar">
<property name="visible">True</property>
<property name="width_request">200</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkStack" id="navigator_stack">
<property name="visible">True</property>
<child>
<object class="GtkScrolledWindow" id="navigator_sidebar">
<property name="visible">True</property>
<property name="shadow_type">none</property>
<property name="vexpand">True</property>
<child>
<object class="GtkListBox" id="events_sidebar">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<style>
<class name="sidebar"/>
</style>
</object>
</child>
</object>
<packing>
<property name="name">events-list</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<style>
<class name="sidebar"/>
</style>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="no_events_title">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Today</property>
<style>
<class name="sidebar-header"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="temp_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">temp</property>
<property name="label">foo</property>
<style>
<class name="temp-label" />
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkImage" id="weather_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="margin_start">6</property>
<property name="label" translatable="yes">No events</property>
<style>
<class name="dim-label"/>
<class name="italic-label"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
<property name="name">no-events</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="valign">end</property>
<property name="label" translatable="yes">Add Event…</property>
<signal name="clicked" handler="add_event_clicked_cb" object="GcalYearView" swapped="yes"/>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</template>
<object class="GtkPopover" id="popover">
<property name="relative_to">navigator</property>
<style>
<class name="events"/>
</style>
<signal name="closed" handler="popover_closed_cb" object="GcalYearView" swapped="yes"/>
</object>
</interface>