search: Stop using AdwPreferencesWindow for search locations window

That's not what it's for.
This commit is contained in:
Alice Mikhaylenko 2023-07-31 00:10:14 +04:00 committed by Felipe Borges
parent 52f4919c94
commit ee4c5f8115
3 changed files with 74 additions and 64 deletions

View file

@ -48,7 +48,7 @@ typedef struct {
} PlaceRowWidgets; } PlaceRowWidgets;
struct _CcSearchLocationsDialog { struct _CcSearchLocationsDialog {
AdwPreferencesWindow parent; AdwWindow parent;
GSettings *tracker_preferences; GSettings *tracker_preferences;
@ -64,7 +64,7 @@ struct _CcSearchLocationsDialogClass {
AdwPreferencesWindowClass parent_class; AdwPreferencesWindowClass parent_class;
}; };
G_DEFINE_TYPE (CcSearchLocationsDialog, cc_search_locations_dialog, ADW_TYPE_PREFERENCES_WINDOW) G_DEFINE_TYPE (CcSearchLocationsDialog, cc_search_locations_dialog, ADW_TYPE_WINDOW)
static gboolean static gboolean
keynav_failed_cb (CcSearchLocationsDialog *self, keynav_failed_cb (CcSearchLocationsDialog *self,
@ -782,4 +782,6 @@ cc_search_locations_dialog_class_init (CcSearchLocationsDialogClass *klass)
gtk_widget_class_bind_template_callback (widget_class, add_button_clicked); gtk_widget_class_bind_template_callback (widget_class, add_button_clicked);
gtk_widget_class_bind_template_callback (widget_class, keynav_failed_cb); gtk_widget_class_bind_template_callback (widget_class, keynav_failed_cb);
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
} }

View file

@ -23,7 +23,7 @@
#include "cc-search-panel.h" #include "cc-search-panel.h"
#define CC_SEARCH_LOCATIONS_DIALOG_TYPE (cc_search_locations_dialog_get_type ()) #define CC_SEARCH_LOCATIONS_DIALOG_TYPE (cc_search_locations_dialog_get_type ())
G_DECLARE_FINAL_TYPE (CcSearchLocationsDialog, cc_search_locations_dialog, CC, SEARCH_LOCATIONS_DIALOG, AdwPreferencesWindow) G_DECLARE_FINAL_TYPE (CcSearchLocationsDialog, cc_search_locations_dialog, CC, SEARCH_LOCATIONS_DIALOG, AdwWindow)
CcSearchLocationsDialog *cc_search_locations_dialog_new (CcSearchPanel *panel); CcSearchLocationsDialog *cc_search_locations_dialog_new (CcSearchPanel *panel);

View file

@ -1,14 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.0 --> <!-- interface-requires gtk+ 3.0 -->
<template class="CcSearchLocationsDialog" parent="AdwPreferencesWindow"> <template class="CcSearchLocationsDialog" parent="AdwWindow">
<property name="modal">True</property> <property name="modal">True</property>
<property name="width-request">360</property> <property name="width-request">360</property>
<property name="height-request">294</property> <property name="height-request">294</property>
<property name="default-width">640</property>
<property name="default-height">576</property>
<property name="hide-on-close">True</property> <property name="hide-on-close">True</property>
<property name="search-enabled">False</property>
<property name="title" translatable="yes">Search Locations</property> <property name="title" translatable="yes">Search Locations</property>
<child> <property name="content">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
<property name="content">
<object class="AdwPreferencesPage"> <object class="AdwPreferencesPage">
<property name="description" translatable="yes">Folders which are searched by system apps, such as Files, Photos and Videos.</property> <property name="description" translatable="yes">Folders which are searched by system apps, such as Files, Photos and Videos.</property>
<child> <child>
@ -78,6 +84,8 @@
</object> </object>
</child> </child>
</object> </object>
</child> </property>
</object>
</property>
</template> </template>
</interface> </interface>