summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author张雯 <[email protected]>2018-02-13 15:06:07 +0800
committermonsta <[email protected]>2018-03-20 13:21:47 +0300
commit87d7bdb00281a8acb706d17e18a7e01a5ce67d3b (patch)
treeea3dcf3f2cef6db1f8a9c204758c7e1b0e57f56b
parent3eea173a327a86053ac671033408c95bd61ac5e4 (diff)
downloadcaja-87d7bdb00281a8acb706d17e18a7e01a5ce67d3b.tar.bz2
caja-87d7bdb00281a8acb706d17e18a7e01a5ce67d3b.tar.xz
allow selecting all the search keywords with Ctrl+A
(squashed 012d9f86e046cfbffd4d2d4e55633d250ec90dd7 + 01cec7e9f65985d5e16e54f0c5a64d4203f37474 for 1.18 branch)
-rw-r--r--src/caja-navigation-window-pane.c2
-rw-r--r--src/caja-search-bar.c11
-rw-r--r--src/caja-search-bar.h3
3 files changed, 13 insertions, 3 deletions
diff --git a/src/caja-navigation-window-pane.c b/src/caja-navigation-window-pane.c
index 62e0f9a2..19c63d1f 100644
--- a/src/caja-navigation-window-pane.c
+++ b/src/caja-navigation-window-pane.c
@@ -784,7 +784,7 @@ caja_navigation_window_pane_setup (CajaNavigationWindowPane *pane)
pane->navigation_bar,
TRUE, TRUE, 0);
- pane->search_bar = caja_search_bar_new ();
+ pane->search_bar = caja_search_bar_new (CAJA_WINDOW_PANE (pane)->window);
g_signal_connect_object (pane->search_bar, "activate",
G_CALLBACK (search_bar_activate_callback), pane, 0);
g_signal_connect_object (pane->search_bar, "cancel",
diff --git a/src/caja-search-bar.c b/src/caja-search-bar.c
index af0531ea..a0867ffc 100644
--- a/src/caja-search-bar.c
+++ b/src/caja-search-bar.c
@@ -28,6 +28,7 @@
#include <eel/eel-gtk-macros.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#include <libcaja-private/caja-clipboard.h>
struct CajaSearchBarDetails
{
@@ -212,11 +213,19 @@ caja_search_bar_return_entry (CajaSearchBar *bar)
}
GtkWidget *
-caja_search_bar_new (void)
+caja_search_bar_new (CajaWindow *window)
{
GtkWidget *bar;
+ CajaSearchBar *search_bar;
bar = g_object_new (CAJA_TYPE_SEARCH_BAR, NULL);
+ search_bar = CAJA_SEARCH_BAR(bar);
+
+ /* Clipboard */
+ caja_clipboard_set_up_editable
+ (GTK_EDITABLE (search_bar->details->entry),
+ caja_window_get_ui_manager (window),
+ FALSE);
return bar;
}
diff --git a/src/caja-search-bar.h b/src/caja-search-bar.h
index 35fce4d9..81af49cc 100644
--- a/src/caja-search-bar.h
+++ b/src/caja-search-bar.h
@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <libcaja-private/caja-query.h>
+#include "caja-window.h"
#define CAJA_TYPE_SEARCH_BAR caja_search_bar_get_type()
#define CAJA_SEARCH_BAR(obj) \
@@ -57,7 +58,7 @@ typedef struct
} CajaSearchBarClass;
GType caja_search_bar_get_type (void);
-GtkWidget* caja_search_bar_new (void);
+GtkWidget* caja_search_bar_new (CajaWindow *window);
GtkWidget * caja_search_bar_borrow_entry (CajaSearchBar *bar);
void caja_search_bar_return_entry (CajaSearchBar *bar);