window: Move calendar popover to GcalCalendarPopover

This helps reducing the LOC number of GcalWindow, and
allows us to also implement the popover in a better way.
This commit is contained in:
Georges Basile Stavracas Neto
2019-05-04 12:05:39 -03:00
parent 64fa11f4c0
commit fd3d2ea3f6
7 changed files with 396 additions and 213 deletions
+1
View File
@@ -2,6 +2,7 @@
<gresources>
<gresource prefix="/org/gnome/calendar">
<file alias="alarm-row.ui" compressed="true">ui/alarm-row.ui</file>
<file alias="calendar-popover.ui" compressed="true">ui/calendar-popover.ui</file>
<file alias="calendar-row.ui" compressed="true">ui/calendar-row.ui</file>
<file alias="date-chooser.ui" compressed="true">ui/date-chooser.ui</file>
<file alias="date-selector.ui" compressed="true">ui/date-selector.ui</file>
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalCalendarPopover" parent="GtkPopover">
<property name="can_focus">False</property>
<property name="position">bottom</property>
<property name="constrain_to">none</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin">6</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="hscrollbar_policy">never</property>
<property name="max_content_height">450</property>
<property name="propagate-natural-height">True</property>
<child>
<object class="GtkListBox" id="calendar_listbox">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="selection_mode">none</property>
<signal name="row-activated" handler="on_listbox_row_activated_cb" object="GcalCalendarPopover" swapped="no"/>
<style>
<class name="calendar-list"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="calendar_settings_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">none</property>
<property name="receives_default">True</property>
<property name="action_name">win.show-calendars</property>
<child>
<object class="GtkLabel" id="calendar_settings_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Calendar Settings</property>
<property name="xalign">0</property>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+1 -48
View File
@@ -271,54 +271,7 @@
</object>
</child>
</template>
<object class="GtkPopover" id="calendar_popover">
<property name="border_width">6</property>
<child>
<object class="GtkBox" id="calendar_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="hscrollbar_policy">never</property>
<property name="max_content_height">450</property>
<property name="propagate-natural-height">True</property>
<child>
<object class="GtkListBox" id="calendar_listbox">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="selection_mode">none</property>
<signal name="row-activated" handler="source_row_activated" object="GcalWindow" swapped="no"/>
<style>
<class name="calendar-list"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="calendar_settings_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">none</property>
<property name="receives_default">True</property>
<property name="action_name">win.show-calendars</property>
<child>
<object class="GtkLabel" id="calendar_settings_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Calendar Settings</property>
<property name="xalign">0</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GcalCalendarPopover" id="calendar_popover" />
<object class="GcalQuickAddPopover" id="quick_add_popover">
<property name="visible">False</property>
<property name="relative_to">views_stack</property>