summaryrefslogtreecommitdiff
path: root/gui/glabel.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-18 18:14:57 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-18 18:14:57 -0300
commit8457e569c20ae0eff2553fa5356137e3dbee0a5b (patch)
tree760c5bc4aee833cc5d3ee867e3be55c67c15ae4d /gui/glabel.c
parentae581b30b64dbf90a8529e748c8cdbeb7383791b (diff)
downloadeeshow-8457e569c20ae0eff2553fa5356137e3dbee0a5b.tar.gz
eeshow-8457e569c20ae0eff2553fa5356137e3dbee0a5b.tar.bz2
eeshow-8457e569c20ae0eff2553fa5356137e3dbee0a5b.zip
eeshow/gui/glabel.c: hand off hover to pop-up; close pop-up when leaving
Diffstat (limited to 'gui/glabel.c')
-rw-r--r--gui/glabel.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gui/glabel.c b/gui/glabel.c
index d3babf7..72bc8c5 100644
--- a/gui/glabel.c
+++ b/gui/glabel.c
@@ -19,6 +19,7 @@
#include "misc/util.h"
#include "kicad/dwg.h"
#include "gui/style.h"
+#include "gui/input.h"
#include "gui/aoi.h"
#include "gui/over.h"
#include "gui/common.h"
@@ -129,6 +130,16 @@ static void add_dest_overlay(struct gui_ctx *ctx, const char *label,
}
+static bool pop_hover(void *user, bool on)
+{
+ struct gui_ctx *ctx = user;
+
+ if (!on)
+ dehover_glabel(ctx);
+ return 1;
+}
+
+
static void add_dest_frame(struct gui_ctx *ctx)
{
int w, h;
@@ -150,7 +161,8 @@ static void add_dest_frame(struct gui_ctx *ctx)
};
struct overlay *over;
- over = overlay_add(&ctx->pop_underlays, NULL, NULL, NULL, NULL);
+ over = overlay_add(&ctx->pop_underlays, &ctx->aois,
+ pop_hover, NULL, ctx);
overlay_text_raw(over, "");
overlay_style(over, &style);
}
@@ -167,6 +179,8 @@ static bool hover_glabel(void *user, bool on)
dehover_glabel(ctx);
return 1;
}
+ if (ctx->pop_underlays)
+ return 0;
GtkAllocation alloc;
int sx, sy, ex, ey, mx, my;
@@ -196,6 +210,7 @@ static bool hover_glabel(void *user, bool on)
ctx->pop_y = my < alloc.height / 2 ?
sy - CHEAT : -(alloc.height - ey) + CHEAT;
+ input_update();
redraw(ctx);
return 0;
}