[gnome-terminal] search: Revert to using a window instead of a popover



commit 9b18c48ccb591d157cf38511219bbf27fde0bad2
Author: Christian Persch <chpe gnome org>
Date:   Tue Feb 16 18:59:09 2016 +0100

    search: Revert to using a window instead of a popover
    
    The popover isn't movable and might cover the match, so until that
    can be fixed, revert to using a window for the search dialogue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755653

 src/search-popover.ui         |   12 +++++++-----
 src/terminal-search-popover.c |   14 ++++++++++----
 src/terminal-window.c         |    2 ++
 3 files changed, 19 insertions(+), 9 deletions(-)
---
diff --git a/src/search-popover.ui b/src/search-popover.ui
index 68908c7..e031182 100644
--- a/src/search-popover.ui
+++ b/src/search-popover.ui
@@ -2,9 +2,11 @@
 <!-- Generated with glade 3.19.0 -->
 <interface>
   <requires lib="gtk+" version="3.16"/>
-  <template class="TerminalSearchPopover" parent="GtkPopover">
+  <template class="TerminalSearchPopover" parent="GtkWindow">
     <property name="can_focus">False</property>
-    <property name="transitions_enabled">False</property>
+    <property name="title" translatable="yes">Search</property>
+    <property name="resizable">False</property>
+    <property name="skip_pager_hint">True</property>
     <child>
       <object class="GtkBox" id="box1">
         <property name="visible">True</property>
@@ -97,11 +99,11 @@
             </child>
             <child>
               <object class="GtkToggleButton" id="reveal_button">
-                <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="tooltip_text" translatable="yes">Toggle search options</property>
                 <property name="focus_on_click">False</property>
+                <property name="active">True</property>
                 <child>
                   <object class="GtkImage" id="image1">
                     <property name="visible">True</property>
@@ -122,7 +124,6 @@
             </child>
             <child>
               <object class="GtkButton" id="close_button">
-                <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="focus_on_click">False</property>
@@ -153,6 +154,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="transition_type">none</property>
+            <property name="reveal_child">True</property>
             <child>
               <object class="GtkBox" id="box3">
                 <property name="visible">True</property>
@@ -170,7 +172,7 @@
                     <property name="use_underline">True</property>
                     <property name="focus_on_click">False</property>
                     <property name="xalign">0</property>
-                    <property name="yalign">0.49000000953674316</property>
+                    <property name="yalign">0.5</property>
                     <property name="draw_indicator">True</property>
                   </object>
                   <packing>
diff --git a/src/terminal-search-popover.c b/src/terminal-search-popover.c
index 3762721..222354b 100644
--- a/src/terminal-search-popover.c
+++ b/src/terminal-search-popover.c
@@ -37,12 +37,12 @@ typedef struct _TerminalSearchPopoverPrivate TerminalSearchPopoverPrivate;
 
 struct _TerminalSearchPopover
 {
-  GtkPopover parent_instance;
+  GtkWindow parent_instance;
 };
 
 struct _TerminalSearchPopoverClass
 {
-  GtkPopoverClass parent_class;
+  GtkWindowClass parent_class;
 
   /* Signals */
   void (* search) (TerminalSearchPopover *popover,
@@ -91,7 +91,7 @@ static guint signals[LAST_SIGNAL];
 static GParamSpec *pspecs[LAST_PROP];
 static GtkListStore *history_store;
 
-G_DEFINE_TYPE_WITH_PRIVATE (TerminalSearchPopover, terminal_search_popover, GTK_TYPE_POPOVER)
+G_DEFINE_TYPE_WITH_PRIVATE (TerminalSearchPopover, terminal_search_popover, GTK_TYPE_WINDOW)
 
 #define PRIV(obj) ((TerminalSearchPopoverPrivate *) terminal_search_popover_get_instance_private 
((TerminalSearchPopover *)(obj)))
 
@@ -392,10 +392,12 @@ terminal_search_popover_init (TerminalSearchPopover *popover)
     gtk_entry_set_completion (GTK_ENTRY (priv->search_entry), completion);
   }
 
-#if GTK_CHECK_VERSION (3, 17, 2)
+#if 0 // GTK_CHECK_VERSION (3, 17, 2)
   G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_popover_set_default_widget (GTK_POPOVER (popover), priv->search_next_button);
   G_GNUC_END_IGNORE_DEPRECATIONS
+#else
+  gtk_window_set_default (GTK_WINDOW (popover), priv->search_next_button);
 #endif
 
 #if GTK_CHECK_VERSION (3, 16, 0)
@@ -540,7 +542,11 @@ TerminalSearchPopover *
 terminal_search_popover_new (GtkWidget *relative_to_widget)
 {
   return g_object_new (TERMINAL_TYPE_SEARCH_POPOVER,
+#if 0
                        "relative-to", relative_to_widget,
+#else
+                       "transient-for", gtk_widget_get_toplevel (relative_to_widget),
+#endif
                        NULL);
 }
 
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 9b23128..4c2dd47 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -951,6 +951,8 @@ terminal_window_ensure_search_popover (TerminalWindow *window)
   search_popover_notify_wrap_around_cb (priv->search_popover, NULL, window);
   g_signal_connect (priv->search_popover, "notify::wrap-around", G_CALLBACK 
(search_popover_notify_wrap_around_cb), window);
 
+  g_signal_connect (priv->search_popover, "destroy", G_CALLBACK (gtk_widget_destroyed), 
&priv->search_popover);
+
   gtk_widget_show (GTK_WIDGET (priv->search_popover));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]