aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-01 00:00:29 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-01 00:00:29 +1100
commit6f66781b1fe99d0157abc0a7f2220e4adaf2e431 (patch)
treef588f16be11336b4eb073a85f5669fcf10216f36
parentaa55bda94433ba22df2f4a4bff1c3f78f6fd8406 (diff)
downloadsubsurface-6f66781b1fe99d0157abc0a7f2220e4adaf2e431.tar.gz
Turn off tooltips if no dives are selected
We already clear the widgets but forgot to turn off the tooltips as well. Reported-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gtk-gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 1c4672ac2..582e77c64 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1491,7 +1491,7 @@ static gboolean on_key_press(GtkWidget *w, GdkEventKey *event, GtkWidget *diveli
static gboolean notebook_tooltip (GtkWidget *widget, gint x, gint y,
gboolean keyboard_mode, GtkTooltip *tooltip, gpointer data)
{
- if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widget)) == 0) {
+ if (amount_selected > 0 && gtk_notebook_get_current_page(GTK_NOTEBOOK(widget)) == 0) {
gtk_tooltip_set_text(tooltip, _("To edit dive information\ndouble click on it in the dive list"));
return TRUE;
} else {
@@ -1674,7 +1674,7 @@ static gboolean profile_tooltip (GtkWidget *widget, gint x, gint y,
return FALSE;
/* don't draw a tooltip if nothing is there */
- if (gc->pi.nr == 0)
+ if (amount_selected == 0 || gc->pi.nr == 0)
return FALSE;
width = drawing_area->width - 2*drawing_area->x;