[gedit] Lazy init the search entry widget
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Lazy init the search entry widget
- Date: Sun, 26 Jun 2011 16:47:19 +0000 (UTC)
commit 775d6b20169dcb076e9531528e5ff94869bce9b2
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Jun 26 16:38:43 2011 +0200
Lazy init the search entry widget
gedit/gedit-view-frame.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index 578983d..3cc4ade 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -72,7 +72,6 @@ struct _GeditViewFramePrivate
guint search_flags;
GtkWidget *slider;
- GtkWidget *search_widget;
GtkWidget *search_entry;
GtkCssProvider *search_css;
@@ -1284,6 +1283,12 @@ start_interactive_search_real (GeditViewFrame *frame)
GtkTextIter iter;
GtkTextMark *mark;
+ if (gtk_bin_get_child (GTK_BIN (frame->priv->slider)) == NULL)
+ {
+ gtk_container_add (GTK_CONTAINER (frame->priv->slider),
+ create_search_widget (frame));
+ }
+
if (gtk_widget_get_visible (frame->priv->slider))
{
if (frame->priv->search_mode != frame->priv->request_search_mode)
@@ -1456,10 +1461,7 @@ gedit_view_frame_init (GeditViewFrame *frame)
gtk_box_pack_start (GTK_BOX (frame), frame->priv->overlay, TRUE, TRUE, 0);
/* Add slider */
- frame->priv->search_widget = create_search_widget (frame);
frame->priv->slider = gedit_floating_slider_new ();
- gtk_container_add (GTK_CONTAINER (frame->priv->slider),
- frame->priv->search_widget);
gtk_widget_set_halign (frame->priv->slider, GTK_ALIGN_END);
gtk_widget_set_valign (frame->priv->slider, GTK_ALIGN_START);
gtk_widget_set_margin_right (frame->priv->slider, SEARCH_POPUP_MARGIN);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]