tooltip windows now show themselves offscreen to force size calc before appearing
authorMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 8 Dec 2014 00:37:54 +0000 (19:37 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 8 Dec 2014 01:22:30 +0000 (20:22 -0500)
this improves initial tooltip placement and prevents tooltip warping due to incremental size recalcs after show

src/lib/els_tooltip.c

index dbcac34592a42d10b155989b3e04b89c2774afb1..79b1494aa7a8afb0c987c39a0d77e2e724593253 100644 (file)
@@ -385,8 +385,16 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
    if (eminw && (ominw < eminw)) ominw = eminw;
    if (eminh && (ominh < eminh)) ominh = eminh;
 
-   if (ominw < 1) ominw = 10; /* at least it is noticeable */
-   if (ominh < 1) ominh = 10; /* at least it is noticeable */
+   if ((ominw < 1) || (ominh < 1))
+     {
+        evas_object_move(tt->tt_win ? : tt->tooltip, -9999, -9999);
+        evas_object_resize(tt->tt_win ? : tt->tooltip, 1, 1);
+        TTDBG("FAKE: tx=%d,ty=%d,tw=%d,th=%d\n", -9999, -9999, 1, 1);
+        evas_object_show(tt->tooltip);
+        if (tt->tt_win) evas_object_show(tt->tt_win);
+        _elm_tooltip_reconfigure_job_start(tt);
+        return;
+     }
 
    edje_object_size_min_restricted_calc(tt->tooltip, &tw, &th, ominw, ominh);
    TTDBG("TTSIZE:  tw=%d,th=%d,ominw=%d,ominh=%d\n", tw, th, ominw, ominh);