edit-dialog: add a button in the headerbar
This button will be used to select the new source of the event.
This commit is contained in:
@@ -265,3 +265,24 @@ event-widget.color-light:backdrop {
|
|||||||
.calendar-list > list {
|
.calendar-list > list {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Edit dialog's header button */
|
||||||
|
button.sources-button {
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
padding-bottom: 0;
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.sources-button:hover {
|
||||||
|
background: @theme_bg_color;
|
||||||
|
border-bottom: solid 2px @theme_selected_bg_color;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.sources-button:checked {
|
||||||
|
background: @theme_bg_color;
|
||||||
|
border-bottom: solid 2px @theme_selected_bg_color;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|||||||
+76
-19
@@ -15,7 +15,6 @@
|
|||||||
<child type="titlebar">
|
<child type="titlebar">
|
||||||
<object class="GtkHeaderBar" id="titlebar">
|
<object class="GtkHeaderBar" id="titlebar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="title" bind-source="summary_entry" bind-property="text" bind-flags="default" />
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="cancel_button">
|
<object class="GtkButton" id="cancel_button">
|
||||||
<property name="label" translatable="yes">Cancel</property>
|
<property name="label" translatable="yes">Cancel</property>
|
||||||
@@ -31,6 +30,66 @@
|
|||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child type="title">
|
||||||
|
<object class="GtkMenuButton" id="sources_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="popover">sources_popover</property>
|
||||||
|
<style>
|
||||||
|
<class name="flat"/>
|
||||||
|
<class name="sources-button"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage" id="source_image">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">start</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="title_label_box">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="title_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" bind-source="summary_entry" bind-property="text" bind-flags="default" />
|
||||||
|
<style>
|
||||||
|
<class name="title"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="subtitle_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<style>
|
||||||
|
<class name="subtitle"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage" id="pan_down_image">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">start</property>
|
||||||
|
<property name="icon_name">pan-down-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="done_button">
|
<object class="GtkButton" id="done_button">
|
||||||
<property name="label" translatable="yes">Done</property>
|
<property name="label" translatable="yes">Done</property>
|
||||||
@@ -162,24 +221,6 @@
|
|||||||
<property name="width">2</property>
|
<property name="width">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkMenuButton" id="sources_button">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="popover">sources_popover</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage" id="source_image">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">3</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCheckButton" id="all_day_check">
|
<object class="GtkCheckButton" id="all_day_check">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -471,4 +512,20 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkSizeGroup">
|
||||||
|
<property name="mode">vertical</property>
|
||||||
|
<widgets>
|
||||||
|
<widget name="cancel_button" />
|
||||||
|
<widget name="done_button" />
|
||||||
|
<widget name="sources_button" />
|
||||||
|
</widgets>
|
||||||
|
</object>
|
||||||
|
<object class="GtkSizeGroup">
|
||||||
|
<property name="mode">vertical</property>
|
||||||
|
<widgets>
|
||||||
|
<widget name="source_image" />
|
||||||
|
<widget name="pan_down_image" />
|
||||||
|
<widget name="title_label_box" />
|
||||||
|
</widgets>
|
||||||
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
@@ -34,7 +34,11 @@ struct _GcalEditDialog
|
|||||||
|
|
||||||
GcalManager *manager;
|
GcalManager *manager;
|
||||||
|
|
||||||
|
/* titlebar */
|
||||||
GtkWidget *titlebar;
|
GtkWidget *titlebar;
|
||||||
|
GtkWidget *title_label;
|
||||||
|
GtkWidget *subtitle_label;
|
||||||
|
|
||||||
GtkWidget *lock;
|
GtkWidget *lock;
|
||||||
GtkWidget *source_image;
|
GtkWidget *source_image;
|
||||||
GtkWidget *source_label;
|
GtkWidget *source_label;
|
||||||
@@ -413,6 +417,8 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
|||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, notes_text);
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, notes_text);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, all_day_check);
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, all_day_check);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, titlebar);
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, titlebar);
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, title_label);
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, subtitle_label);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, lock);
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, lock);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, source_image);
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, source_image);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, sources_popover);
|
gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, sources_popover);
|
||||||
@@ -1010,8 +1016,7 @@ gcal_edit_dialog_set_event (GcalEditDialog *dialog,
|
|||||||
gtk_image_set_from_pixbuf (GTK_IMAGE (dialog->source_image), pix);
|
gtk_image_set_from_pixbuf (GTK_IMAGE (dialog->source_image), pix);
|
||||||
g_object_unref (pix);
|
g_object_unref (pix);
|
||||||
|
|
||||||
gtk_header_bar_set_subtitle (GTK_HEADER_BAR (dialog->titlebar),
|
gtk_label_set_label (GTK_LABEL (dialog->subtitle_label), e_source_get_display_name (source));
|
||||||
e_source_get_display_name (source));
|
|
||||||
|
|
||||||
/* retrieve start and end dates */
|
/* retrieve start and end dates */
|
||||||
date_start = gcal_event_get_date_start (event);
|
date_start = gcal_event_get_date_start (event);
|
||||||
|
|||||||
Reference in New Issue
Block a user