[gnumeric] Adjust tooltips of formula guru
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Adjust tooltips of formula guru
- Date: Fri, 18 Jun 2010 04:33:15 +0000 (UTC)
commit af23c698d8eda930752c6a63682c4f5a7e8ad997
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Thu Jun 17 22:32:38 2010 -0600
Adjust tooltips of formula guru
2010-06-17 Andreas J. Guelzow <aguelzow pyrshep ca>
* dialog-formula-guru.c (cb_dialog_formula_guru_query_tooltip):
adjust tooltip
2010-06-17 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/gui-util.c (gnumeric_create_tooltip): windows should have names
ChangeLog | 4 ++++
src/dialogs/ChangeLog | 5 +++++
src/dialogs/dialog-formula-guru.c | 31 ++++++++++++++++++++++---------
src/gui-util.c | 1 +
4 files changed, 32 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1efdea7..a432c69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-17 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * src/gui-util.c (gnumeric_create_tooltip): windows should have names
+
2010-06-17 Morten Welinder <terra gnome org>
* src/gui-util.c (gnumeric_popup_menu): We have passed gtk+ 2.8 by
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index a08765d..6f6de43 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,10 @@
2010-06-17 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * dialog-formula-guru.c (cb_dialog_formula_guru_query_tooltip):
+ adjust tooltip
+
+2010-06-17 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* dialog-analysis-tools.c (dialog_tool_init): disable tooltips
on input expression entries
diff --git a/src/dialogs/dialog-formula-guru.c b/src/dialogs/dialog-formula-guru.c
index e64e007..f3886aa 100644
--- a/src/dialogs/dialog-formula-guru.c
+++ b/src/dialogs/dialog-formula-guru.c
@@ -850,27 +850,40 @@ cb_dialog_formula_guru_query_tooltip (GtkWidget *widget,
(state->treeview, &x_, &y_, keyboard_mode, NULL, &path, &iter)) {
char *markup;
GtkRcStyle *rc_style = gnumeric_create_tooltip_rc_style ();
+ GtkWidget *parent, *window;
gtk_tree_model_get (GTK_TREE_MODEL (state->model), &iter,
ARG_TOOLTIP, &markup, -1);
if (markup == NULL || markup[0]=='\0')
return FALSE;
if (!state->tooltip_widget) {
-/* For some reason we don't get a reasonable tooltip with the following: */
-/* state->tooltip_label = gnumeric_create_tooltip_widget (); */
-/* state->tooltip_widget */
-/* = gtk_widget_get_toplevel (state->tooltip_label); */
- state->tooltip_label = state->tooltip_widget
- = gtk_label_new (NULL);
-
+ state->tooltip_label = gnumeric_create_tooltip_widget ();
+ state->tooltip_widget
+ = gtk_widget_get_toplevel (state->tooltip_label);
gtk_widget_modify_style /* Applying to label */
(state->tooltip_label, rc_style);
+ gtk_widget_modify_style /* Applying to widget */
+ (state->tooltip_widget, rc_style);
+ gtk_widget_show_all (state->tooltip_widget);
g_object_ref (G_OBJECT (state->tooltip_widget));
g_object_ref (G_OBJECT (state->tooltip_label));
- }
+ }
gtk_tooltip_set_custom (tooltip, state->tooltip_widget);
+ window = gtk_widget_get_toplevel (state->tooltip_widget);
gtk_widget_modify_style /* Applying to window */
- (gtk_widget_get_toplevel (state->tooltip_widget), rc_style);
+ (window, rc_style);
+ gtk_widget_set_name (window, "gnumeric-tooltip");
+ gtk_widget_set_app_paintable (window, FALSE);
+
+ parent = gtk_widget_get_parent (state->tooltip_widget);
+ if (parent != NULL && GTK_IS_BOX (parent)) {
+ gtk_box_set_spacing (GTK_BOX (parent),0);
+ parent = gtk_widget_get_parent (parent);
+ if (parent != NULL && GTK_IS_ALIGNMENT (parent))
+ gtk_alignment_set_padding
+ (GTK_ALIGNMENT (parent),
+ 0,0,0,0);
+ }
gtk_label_set_markup (GTK_LABEL (state->tooltip_label), markup);
g_free (markup);
gtk_tree_view_set_tooltip_row (state->treeview,
diff --git a/src/gui-util.c b/src/gui-util.c
index b40ddef..a512542 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -467,6 +467,7 @@ gnumeric_create_tooltip (GtkWidget *ref_widget)
gtk_window_set_resizable (GTK_WINDOW (tip), FALSE);
gtk_window_set_gravity (GTK_WINDOW (tip), GDK_GRAVITY_NORTH_WEST);
gtk_window_set_screen (GTK_WINDOW (tip), gtk_widget_get_screen (ref_widget));
+ gtk_widget_set_name (tip, "gnumeric-tooltip");
if (rc_style != NULL)
gtk_widget_modify_style (tip, rc_style);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]