year-view: initial UI for no events days
This commit is contained in:
@@ -118,10 +118,28 @@
|
|||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.italic-label {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
GtkListBox.sidebar {
|
GtkListBox.sidebar {
|
||||||
background-color: @theme_bg_color;
|
background-color: @theme_bg_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GtkBox.sidebar {
|
||||||
|
background-color: @theme_bg_color;
|
||||||
|
border-color: @borders;
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
GtkBox.sidebar:dir(ltr) {
|
||||||
|
border-left-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
GtkBox.sidebar:dir(rtl) {
|
||||||
|
border-right-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
GcalYearView GtkScrolledWindow {
|
GcalYearView GtkScrolledWindow {
|
||||||
border-top-width: 0;
|
border-top-width: 0;
|
||||||
border-bottom-width: 0;
|
border-bottom-width: 0;
|
||||||
|
|||||||
+55
-4
@@ -24,17 +24,68 @@
|
|||||||
<property name="width_request">200</property>
|
<property name="width_request">200</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkScrolledWindow" id="navigator_sidebar">
|
<object class="GtkStack" id="navigator_stack">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="shadow_type">out</property>
|
|
||||||
<property name="vexpand">True</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBox" id="events_sidebar">
|
<object class="GtkScrolledWindow" id="navigator_sidebar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="shadow_type">out</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBox" id="events_sidebar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<style>
|
||||||
|
<class name="sidebar" />
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="position">0</property>
|
||||||
|
<property name="name">events-list</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="sidebar" />
|
<class name="sidebar" />
|
||||||
</style>
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="margin">6</property>
|
||||||
|
<property name="label" translatable="True">Today</property>
|
||||||
|
<style>
|
||||||
|
<class name="sidebar-header" />
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</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="True">No events</property>
|
||||||
|
<style>
|
||||||
|
<class name="dim-label" />
|
||||||
|
<class name="italic-label"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="position">1</property>
|
||||||
|
<property name="name">no-events</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ struct _GcalYearViewPrivate
|
|||||||
GtkWidget *navigator;
|
GtkWidget *navigator;
|
||||||
GtkWidget *sidebar;
|
GtkWidget *sidebar;
|
||||||
GtkWidget *events_sidebar;
|
GtkWidget *events_sidebar;
|
||||||
|
GtkWidget *navigator_stack;
|
||||||
GtkWidget *navigator_sidebar;
|
GtkWidget *navigator_sidebar;
|
||||||
|
|
||||||
GtkWidget *popover; /* Popover for popover_mode */
|
GtkWidget *popover; /* Popover for popover_mode */
|
||||||
@@ -244,6 +245,20 @@ update_sidebar (GcalYearView *year_view)
|
|||||||
days_widgets_array = g_new0 (GList*, days_span);
|
days_widgets_array = g_new0 (GList*, days_span);
|
||||||
|
|
||||||
events = gcal_manager_get_events (priv->manager, priv->start_selected_date, priv->end_selected_date);
|
events = gcal_manager_get_events (priv->manager, priv->start_selected_date, priv->end_selected_date);
|
||||||
|
|
||||||
|
/* XXX: compare_date_only does not work if is_date field is different */
|
||||||
|
priv->start_selected_date->is_date = priv->current_date->is_date;
|
||||||
|
if (events == NULL && icaltime_compare_date_only (*(priv->start_selected_date), *(priv->current_date)) == 0)
|
||||||
|
{
|
||||||
|
days_span = 0;
|
||||||
|
gtk_stack_set_visible_child_name (GTK_STACK (priv->navigator_stack), "no-events");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gtk_stack_set_visible_child_name (GTK_STACK (priv->navigator_stack), "events-list");
|
||||||
|
}
|
||||||
|
priv->start_selected_date->is_date = 0;
|
||||||
|
|
||||||
for (l = events; l != NULL; l = g_list_next (l))
|
for (l = events; l != NULL; l = g_list_next (l))
|
||||||
{
|
{
|
||||||
GcalEventData *data = l->data;
|
GcalEventData *data = l->data;
|
||||||
@@ -1164,6 +1179,7 @@ gcal_year_view_class_init (GcalYearViewClass *klass)
|
|||||||
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, navigator);
|
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, navigator);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, sidebar);
|
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, sidebar);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, events_sidebar);
|
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, events_sidebar);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, navigator_stack);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, navigator_sidebar);
|
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, navigator_sidebar);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, popover);
|
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, popover);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, popover_sidebar);
|
gtk_widget_class_bind_template_child_private (widget_class, GcalYearView, popover_sidebar);
|
||||||
|
|||||||
Reference in New Issue
Block a user