search-view: make it a GtkPopover descendant

This huge patch makes GcalSearchView a GtkPopover
descendant. Also, it poorly adapts GcalWindow to
make it work with it.
This commit is contained in:
Georges Basile Stavracas Neto
2015-01-09 09:16:40 -05:00
committed by Erick Pérez Castellanos
parent 6c7500c5b0
commit fb7b738ff7
5 changed files with 109 additions and 128 deletions
+58 -65
View File
@@ -2,33 +2,70 @@
<!-- Generated with glade 3.18.1 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="GcalSearchView" parent="GtkScrolledWindow">
<template class="GcalSearchView" parent="GtkPopover">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_request">600</property>
<property name="height_request">300</property>
<property name="border_width">12</property>
<property name="modal">False</property>
<child>
<object class="GtkViewport" id="viewport">
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
<object class="GtkGrid" id="no_results_grid">
<property name="can_focus">False</property>
<property name="margin_start">96</property>
<property name="margin_end">96</property>
<property name="margin_top">24</property>
<property name="margin_bottom">24</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">24</property>
<child>
<object class="GtkFrame" id="frame">
<object class="GtkImage" id="image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<property name="valign">GTK_ALIGN_START</property>
<property name="label_xalign">0</property>
<style>
<class name="search-list" />
</style>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixel_size">48</property>
<property name="icon_name">face-sad-symbolic</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="label" translatable="yes">No results found</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport" id="viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="visible">True</property>
@@ -40,57 +77,13 @@
</style>
</object>
</child>
<child type="label_item">
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="no_results_grid">
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">24</property>
<child>
<object class="GtkImage" id="image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixel_size">48</property>
<property name="icon_name">face-sad-symbolic</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="label" translatable="yes">No results found</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
+23 -5
View File
@@ -27,12 +27,15 @@
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="show_close_button">True</property>
<property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional"/>
<property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional"/>
<signal name="notify::search-mode-enabled" handler="search_toggled" object="GcalWindow" swapped="no"/>
<child>
<object class="GtkGrid" id="search_entry_grid">
<object class="GtkBox" id="search_entry_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<style>
<class name="linked" />
</style>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="width_request">500</property>
@@ -46,8 +49,24 @@
<signal name="search-changed" handler="search_changed" object="GcalWindow" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="search_list_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active" bind-source="search_entry" bind-property="has-focus" bind-flags="bidirectional"/>
<child>
<object class="GtkImage" id="search_list_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
@@ -66,7 +85,6 @@
<property name="vexpand">True</property>
<property name="transition_duration">250</property>
<property name="transition_type">slide-left-right</property>
<signal name="notify::transition-running" handler="stack_transition_running" object="GcalWindow" swapped="no"/>
<signal name="notify::visible-child" handler="view_changed" object="GcalWindow" swapped="no"/>
<style>
<class name="views"/>