importer: Port dialog to AdwWindow and AdwToolbarView

This commit is contained in:
Christopher Davis
2023-06-19 01:09:55 -04:00
parent 93da9cee7d
commit 8e989294f7
3 changed files with 69 additions and 67 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ typedef struct
struct _GcalImportDialog
{
GtkDialog parent;
AdwWindow parent;
GtkWidget *cancel_button;
AdwComboRow *calendar_combo_row;
@@ -64,7 +64,7 @@ static void on_import_row_file_loaded_cb (GcalImportFil
GPtrArray *events,
GcalImportDialog *self);
G_DEFINE_TYPE (GcalImportDialog, gcal_import_dialog, GTK_TYPE_DIALOG)
G_DEFINE_TYPE (GcalImportDialog, gcal_import_dialog, ADW_TYPE_WINDOW)
enum
{
+3 -1
View File
@@ -20,12 +20,14 @@
#pragma once
#include <adwaita.h>
#include "gcal-context.h"
G_BEGIN_DECLS
#define GCAL_TYPE_IMPORT_DIALOG (gcal_import_dialog_get_type())
G_DECLARE_FINAL_TYPE (GcalImportDialog, gcal_import_dialog, GCAL, IMPORT_DIALOG, GtkDialog)
G_DECLARE_FINAL_TYPE (GcalImportDialog, gcal_import_dialog, GCAL, IMPORT_DIALOG, AdwWindow)
GtkWidget* gcal_import_dialog_new_for_files (GcalContext *context,
GFile **files,
+64 -64
View File
@@ -1,83 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalImportDialog" parent="GtkDialog">
<template class="GcalImportDialog" parent="AdwWindow">
<property name="title" translatable="yes">Import Files…</property>
<property name="width_request">500</property>
<property name="default_width">550</property>
<property name="default_height">500</property>
<property name="resizable">False</property>
<property name="width-request">360</property>
<property name="height-request">294</property>
<property name="default-width">550</property>
<property name="default-height">500</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="use-header-bar">1</property>
<property name="destroy-with-parent">True</property>
<property name="content">
<object class="AdwToolbarView">
<child type="top">
<object class="GtkHeaderBar" id="headerbar">
<property name="show-title-buttons">False</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="show-title-buttons">False</property>
<!-- Cancel button -->
<child type="start">
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="on_cancel_button_clicked_cb" object="GcalImportDialog" swapped="no" />
</object>
</child>
<!-- Import button -->
<child type="end">
<object class="GtkButton" id="import_button">
<property name="label" translatable="yes">_Import</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="on_import_button_clicked_cb" object="GcalImportDialog" swapped="no" />
<style>
<class name="suggested-action" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesPage" id="preferences_page">
<!-- Calendar -->
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwComboRow" id="calendar_combo_row">
<property name="activatable">True</property>
<property name="title" translatable="yes">C_alendar</property>
<!-- Cancel button -->
<child type="start">
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="use-underline">True</property>
<property name="factory">
<object class="GtkSignalListItemFactory">
<signal name="bind" handler="on_combo_row_signal_factory_bind_cb" object="GcalImportDialog" swapped="no" />
<signal name="setup" handler="on_combo_row_signal_factory_setup_cb" object="GcalImportDialog" swapped="no" />
</object>
</property>
<signal name="notify::selected-item" handler="on_calendar_combo_row_selected_item_changed_cb" object="GcalImportDialog" swapped="no" />
<signal name="clicked" handler="on_cancel_button_clicked_cb" object="GcalImportDialog" swapped="no" />
</object>
</child>
<!-- Import button -->
<child type="end">
<object class="GtkButton" id="import_button">
<property name="label" translatable="yes">_Import</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="on_import_button_clicked_cb" object="GcalImportDialog" swapped="no" />
<style>
<class name="suggested-action" />
</style>
</object>
</child>
</object>
</child>
<property name="content">
<object class="AdwPreferencesPage" id="preferences_page">
<!-- Files overview -->
<child>
<object class="AdwPreferencesGroup" id="files_group">
<!-- Calendar -->
<child>
<object class="GtkSpinner" id="placeholder_spinner">
<property name="halign">center</property>
<property name="valign">center</property>
<property name="spinning">True</property>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwComboRow" id="calendar_combo_row">
<property name="activatable">True</property>
<property name="title" translatable="yes">C_alendar</property>
<property name="use-underline">True</property>
<property name="factory">
<object class="GtkSignalListItemFactory">
<signal name="bind" handler="on_combo_row_signal_factory_bind_cb" object="GcalImportDialog" swapped="no" />
<signal name="setup" handler="on_combo_row_signal_factory_setup_cb" object="GcalImportDialog" swapped="no" />
</object>
</property>
<signal name="notify::selected-item" handler="on_calendar_combo_row_selected_item_changed_cb" object="GcalImportDialog" swapped="no" />
</object>
</child>
</object>
</child>
<!-- Files overview -->
<child>
<object class="AdwPreferencesGroup" id="files_group">
<child>
<object class="GtkSpinner" id="placeholder_spinner">
<property name="halign">center</property>
<property name="valign">center</property>
<property name="spinning">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
</property>
</object>
</child>
</property>
</template>
<object class="GtkSizeGroup" id="title_sizegroup">