[libgda] GTK3 related corrections



commit 6dbd95dc8ae10af382a3c7f735defbaddfdd08e0
Author: Vivien Malerba <malerba gnome-db org>
Date:   Tue May 10 23:12:52 2011 +0200

    GTK3 related corrections

 libgda-ui/data-entries/gdaui-entry-common-time.c |    5 ++---
 libgda-ui/data-entries/gdaui-entry-shell.c       |   18 ++++--------------
 libgda-ui/internal/utility.c                     |    2 --
 3 files changed, 6 insertions(+), 19 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c b/libgda-ui/data-entries/gdaui-entry-common-time.c
index 579b7d6..eff9065 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -1,5 +1,4 @@
-/* gdaui-entry-common-time.c
- *
+/*
  * Copyright (C) 2003 - 2011 Vivien Malerba
  *
  * This Library is free software; you can redistribute it and/or
@@ -911,8 +910,8 @@ date_calendar_choose_cb (GtkWidget *button, GdauiEntryCommonTime *mgtim)
                 return;
 
         position_popup (mgtim);
-        gtk_grab_add (mgtim->priv->window);
         gtk_widget_show (mgtim->priv->window);
+        gtk_grab_add (mgtim->priv->window);
 
 	GdkScreen *screen;
 	gint swidth, sheight;
diff --git a/libgda-ui/data-entries/gdaui-entry-shell.c b/libgda-ui/data-entries/gdaui-entry-shell.c
index 7b5cc23..4586911 100644
--- a/libgda-ui/data-entries/gdaui-entry-shell.c
+++ b/libgda-ui/data-entries/gdaui-entry-shell.c
@@ -1,6 +1,5 @@
-/* gdaui-entry-shell.c
- *
- * Copyright (C) 2003 - 2009 Vivien Malerba <malerba gnome-db org>
+/*
+ * Copyright (C) 2003 - 2011 Vivien Malerba <malerba gnome-db org>
  *
  * This Library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public License as
@@ -56,7 +55,6 @@ struct  _GdauiEntryShellPriv {
         GtkWidget           *embedder;
 	GtkWidget           *hbox;
         GtkWidget           *button;
-        GtkStyle            *orig_style;
         GdaDataHandler      *data_handler;
 	gboolean             show_actions;
 
@@ -159,7 +157,6 @@ gdaui_entry_shell_init (GdauiEntryShell * shell)
 	/* Setting the initial layout */
 	gtk_viewport_set_shadow_type (GTK_VIEWPORT (shell), GTK_SHADOW_NONE);
 	gtk_container_set_border_width (GTK_CONTAINER (shell), 0);
-	shell->priv->orig_style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (shell)));
 
 	/* hbox */
 	hbox = gtk_hbox_new (FALSE, 0);
@@ -382,16 +379,14 @@ gdaui_entry_shell_refresh_status_display (GdauiEntryShell *shell)
 {
 	static GdkColor **colors = NULL;
 	GdkColor *normal = NULL, *prelight = NULL;
-	GdkColor *orig_normal, *orig_prelight;
 
 	g_return_if_fail (GDAUI_IS_ENTRY_SHELL (shell));
 
-	orig_normal = & (shell->priv->orig_style->bg[GTK_STATE_NORMAL]);
-	orig_prelight = & (shell->priv->orig_style->bg[GTK_STATE_PRELIGHT]);
-
 	if (!colors)
 		colors = _gdaui_utility_entry_build_info_colors_array ();
 
+	gtk_widget_set_tooltip_text (shell->priv->button, NULL);
+
 	if (shell->priv->value_is_null) {
 		normal = colors[0];
 		prelight = colors[1];
@@ -410,11 +405,6 @@ gdaui_entry_shell_refresh_status_display (GdauiEntryShell *shell)
 		gtk_widget_set_tooltip_text (shell->priv->button, _("Value is invalid"));
 	}
 
-	if (!normal)
-		normal = orig_normal;
-	if (!prelight)
-		prelight = orig_prelight;
-
 	gtk_widget_modify_bg (shell->priv->button, GTK_STATE_NORMAL, normal);
 	gtk_widget_modify_bg (shell->priv->button, GTK_STATE_ACTIVE, normal);
 	gtk_widget_modify_bg (shell->priv->button, GTK_STATE_PRELIGHT, prelight);
diff --git a/libgda-ui/internal/utility.c b/libgda-ui/internal/utility.c
index 72ca15e..7a5712a 100644
--- a/libgda-ui/internal/utility.c
+++ b/libgda-ui/internal/utility.c
@@ -148,7 +148,6 @@ _gdaui_utility_entry_build_info_colors_array (void)
 	gdk_color_parse (GDAUI_COLOR_PRELIGHT_NULL, color);
 	colors[1] = color;
 	
-	
 	/* Blue color */
 	color = g_new0 (GdkColor, 1);
 	gdk_color_parse (GDAUI_COLOR_NORMAL_DEFAULT, color);
@@ -158,7 +157,6 @@ _gdaui_utility_entry_build_info_colors_array (void)
 	gdk_color_parse (GDAUI_COLOR_PRELIGHT_DEFAULT, color);
 	colors[3] = color;
 	
-	
 	/* Red color */
 	color = g_new0 (GdkColor, 1);
 	gdk_color_parse (GDAUI_COLOR_NORMAL_INVALID, color);



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