[libgda] Misc UI corrections



commit f955a746bf517abb7c2a907dd0297b82f302ca1e
Author: Vivien Malerba <malerba gnome-db org>
Date:   Wed Jul 21 17:19:21 2010 +0200

    Misc UI corrections

 libgda-ui/data-entries/gdaui-entry-string.c |    5 ++++-
 libgda-ui/gdaui-raw-grid.c                  |    9 +++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-string.c b/libgda-ui/data-entries/gdaui-entry-string.c
index a23801e..a651565 100644
--- a/libgda-ui/data-entries/gdaui-entry-string.c
+++ b/libgda-ui/data-entries/gdaui-entry-string.c
@@ -517,7 +517,10 @@ can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
 	mgstr = GDAUI_ENTRY_STRING (mgwrap);
 	g_return_val_if_fail (mgstr->priv, FALSE);
 
-	return mgstr->priv->multiline;
+	if (horiz)
+		return FALSE;
+	else
+		return mgstr->priv->multiline;
 }
 
 static void
diff --git a/libgda-ui/gdaui-raw-grid.c b/libgda-ui/gdaui-raw-grid.c
index 49cd32c..ba1d68c 100644
--- a/libgda-ui/gdaui-raw-grid.c
+++ b/libgda-ui/gdaui-raw-grid.c
@@ -1746,6 +1746,15 @@ tree_view_popup_button_pressed_cb (GtkWidget *widget, GdkEventButton *event, Gda
 	selection = gtk_tree_view_get_selection (tree_view);
 	sel_mode = gtk_tree_selection_get_mode (selection);
 
+	/* force selection of row on which clicked occurred */
+	GtkTreePath *path;
+	if ((event->window == gtk_tree_view_get_bin_window (tree_view)) &&
+	    gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y, &path, NULL, NULL, NULL)) {
+		gtk_tree_selection_unselect_all (selection);
+		gtk_tree_selection_select_path (selection, path);
+		gtk_tree_path_free (path);
+	}
+
 	/* create the menu */
 	menu = gtk_menu_new ();
 	if (sel_mode == GTK_SELECTION_MULTIPLE)



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