forked from AuroraMiddleware/gtk
GtkTreeView: Use more consistent search window naming
Instead of alternating between search dialog and search window, use search window everywhere. https://bugzilla.gnome.org/show_bug.cgi?id=756780
This commit is contained in:
parent
76619cf1ae
commit
2eb7d7476b
@ -790,11 +790,11 @@ static inline gint gtk_tree_view_get_row_height (GtkTreeView *tree_
|
|||||||
|
|
||||||
/* interactive search */
|
/* interactive search */
|
||||||
static void gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view);
|
static void gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view);
|
||||||
static void gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog,
|
static void gtk_tree_view_search_window_hide (GtkWidget *search_window,
|
||||||
GtkTreeView *tree_view,
|
GtkTreeView *tree_view,
|
||||||
GdkDevice *device);
|
GdkDevice *device);
|
||||||
static void gtk_tree_view_search_position_func (GtkTreeView *tree_view,
|
static void gtk_tree_view_search_position_func (GtkTreeView *tree_view,
|
||||||
GtkWidget *search_dialog,
|
GtkWidget *search_window,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
static void gtk_tree_view_search_disable_popdown (GtkEntry *entry,
|
static void gtk_tree_view_search_disable_popdown (GtkEntry *entry,
|
||||||
GtkMenu *menu,
|
GtkMenu *menu,
|
||||||
@ -6135,9 +6135,8 @@ gtk_tree_view_focus_out (GtkWidget *widget,
|
|||||||
|
|
||||||
/* destroy interactive search dialog */
|
/* destroy interactive search dialog */
|
||||||
if (tree_view->priv->search_window)
|
if (tree_view->priv->search_window)
|
||||||
gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view,
|
gtk_tree_view_search_window_hide (tree_view->priv->search_window, tree_view,
|
||||||
gdk_event_get_device ((GdkEvent *) event));
|
gdk_event_get_device ((GdkEvent *) event));
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10978,7 +10977,7 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view)
|
|||||||
static gboolean
|
static gboolean
|
||||||
gtk_tree_view_search_entry_flush_timeout (GtkTreeView *tree_view)
|
gtk_tree_view_search_entry_flush_timeout (GtkTreeView *tree_view)
|
||||||
{
|
{
|
||||||
gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view, NULL);
|
gtk_tree_view_search_window_hide (tree_view->priv->search_window, tree_view, NULL);
|
||||||
tree_view->priv->typeselect_flush_timeout = 0;
|
tree_view->priv->typeselect_flush_timeout = 0;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -14971,8 +14970,8 @@ gtk_tree_view_get_search_position_func (GtkTreeView *tree_view)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog,
|
gtk_tree_view_search_window_hide (GtkWidget *search_window,
|
||||||
GtkTreeView *tree_view,
|
GtkTreeView *tree_view,
|
||||||
GdkDevice *device)
|
GdkDevice *device)
|
||||||
{
|
{
|
||||||
if (tree_view->priv->disable_popdown)
|
if (tree_view->priv->disable_popdown)
|
||||||
@ -14990,11 +14989,11 @@ gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog,
|
|||||||
tree_view->priv->typeselect_flush_timeout = 0;
|
tree_view->priv->typeselect_flush_timeout = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gtk_widget_get_visible (search_dialog))
|
if (gtk_widget_get_visible (search_window))
|
||||||
{
|
{
|
||||||
/* send focus-in event */
|
/* send focus-in event */
|
||||||
send_focus_change (GTK_WIDGET (tree_view->priv->search_entry), device, FALSE);
|
send_focus_change (GTK_WIDGET (tree_view->priv->search_entry), device, FALSE);
|
||||||
gtk_widget_hide (search_dialog);
|
gtk_widget_hide (search_window);
|
||||||
gtk_entry_set_text (GTK_ENTRY (tree_view->priv->search_entry), "");
|
gtk_entry_set_text (GTK_ENTRY (tree_view->priv->search_entry), "");
|
||||||
send_focus_change (GTK_WIDGET (tree_view), device, TRUE);
|
send_focus_change (GTK_WIDGET (tree_view), device, TRUE);
|
||||||
}
|
}
|
||||||
@ -15002,7 +15001,7 @@ gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tree_view_search_position_func (GtkTreeView *tree_view,
|
gtk_tree_view_search_position_func (GtkTreeView *tree_view,
|
||||||
GtkWidget *search_dialog,
|
GtkWidget *search_window,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gint x, y;
|
gint x, y;
|
||||||
@ -15017,12 +15016,12 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view,
|
|||||||
monitor_num = gdk_screen_get_monitor_at_window (screen, tree_window);
|
monitor_num = gdk_screen_get_monitor_at_window (screen, tree_window);
|
||||||
gdk_screen_get_monitor_workarea (screen, monitor_num, &monitor);
|
gdk_screen_get_monitor_workarea (screen, monitor_num, &monitor);
|
||||||
|
|
||||||
gtk_widget_realize (search_dialog);
|
gtk_widget_realize (search_window);
|
||||||
|
|
||||||
gdk_window_get_origin (tree_window, &tree_x, &tree_y);
|
gdk_window_get_origin (tree_window, &tree_x, &tree_y);
|
||||||
tree_width = gdk_window_get_width (tree_window);
|
tree_width = gdk_window_get_width (tree_window);
|
||||||
tree_height = gdk_window_get_height (tree_window);
|
tree_height = gdk_window_get_height (tree_window);
|
||||||
gtk_widget_get_preferred_size (search_dialog, &requisition, NULL);
|
gtk_widget_get_preferred_size (search_window, &requisition, NULL);
|
||||||
|
|
||||||
if (tree_x + tree_width > gdk_screen_get_width (screen))
|
if (tree_x + tree_width > gdk_screen_get_width (screen))
|
||||||
x = gdk_screen_get_width (screen) - requisition.width;
|
x = gdk_screen_get_width (screen) - requisition.width;
|
||||||
@ -15038,7 +15037,7 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view,
|
|||||||
else
|
else
|
||||||
y = tree_y + tree_height;
|
y = tree_y + tree_height;
|
||||||
|
|
||||||
gtk_window_move (GTK_WINDOW (search_dialog), x, y);
|
gtk_window_move (GTK_WINDOW (search_window), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -15073,14 +15072,22 @@ gtk_tree_view_search_preedit_changed (GtkIMContext *im_context,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_tree_view_search_commit (GtkIMContext *im_context,
|
||||||
|
gchar *buf,
|
||||||
|
GtkTreeView *tree_view)
|
||||||
|
{
|
||||||
|
tree_view->priv->imcontext_changed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tree_view_search_activate (GtkEntry *entry,
|
gtk_tree_view_search_activate (GtkEntry *entry,
|
||||||
GtkTreeView *tree_view)
|
GtkTreeView *tree_view)
|
||||||
{
|
{
|
||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
|
|
||||||
gtk_tree_view_search_dialog_hide (tree_view->priv->search_window,
|
gtk_tree_view_search_window_hide (tree_view->priv->search_window,
|
||||||
tree_view,
|
tree_view,
|
||||||
gtk_get_current_event_device ());
|
gtk_get_current_event_device ());
|
||||||
|
|
||||||
/* If we have a row selected and it's the cursor row, we activate
|
/* If we have a row selected and it's the cursor row, we activate
|
||||||
@ -15123,7 +15130,7 @@ gtk_tree_view_search_delete_event (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
||||||
|
|
||||||
gtk_tree_view_search_dialog_hide (widget, tree_view, NULL);
|
gtk_tree_view_search_window_hide (widget, tree_view, NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -15138,7 +15145,7 @@ gtk_tree_view_search_button_press_event (GtkWidget *widget,
|
|||||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
||||||
|
|
||||||
keyb_device = gdk_device_get_associated_device (event->device);
|
keyb_device = gdk_device_get_associated_device (event->device);
|
||||||
gtk_tree_view_search_dialog_hide (widget, tree_view, keyb_device);
|
gtk_tree_view_search_window_hide (widget, tree_view, keyb_device);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -15191,7 +15198,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
|
|||||||
if (!tree_view->priv->search_custom_entry_set
|
if (!tree_view->priv->search_custom_entry_set
|
||||||
&& gtk_tree_view_search_key_cancels_search (event->keyval))
|
&& gtk_tree_view_search_key_cancels_search (event->keyval))
|
||||||
{
|
{
|
||||||
gtk_tree_view_search_dialog_hide (widget, tree_view,
|
gtk_tree_view_search_window_hide (widget, tree_view,
|
||||||
gdk_event_get_device ((GdkEvent *) event));
|
gdk_event_get_device ((GdkEvent *) event));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user