summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-02 12:41:09 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-02 12:41:09 +0000
commita7f155ff043a9c6ab8a438d13c4877c5501d9aa5 (patch)
tree47f8f958f942d4cc3b42d2a8fdf0d69b2c61bcda
parent70f2f747f68b56caaef5551eec8cf1655077a1f3 (diff)
fix tooltips to not go offscreen as often
SVN revision: 79982
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/els_tooltip.c22
3 files changed, 23 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 337403068..c3df9add7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -734,3 +734,7 @@
7342012-11-30 ChunEon Park (Hermet) 7342012-11-30 ChunEon Park (Hermet)
735 735
736 * emit the signals for content_set/unset text_set/unset one time! 736 * emit the signals for content_set/unset text_set/unset one time!
737
7382012-12-02 Mike Blumenkrantz
739
740 * Fix case where tooltips could go offscreen unnecessarily
diff --git a/NEWS b/NEWS
index 61a6f07d3..081d0cb41 100644
--- a/NEWS
+++ b/NEWS
@@ -69,6 +69,7 @@ Fixes:
69 * Fix the mapbuf to update it's content correcltly evenif they go outside of the buffer. 69 * Fix the mapbuf to update it's content correcltly evenif they go outside of the buffer.
70 * Fix the naviframe to resize it's items which are inserted. 70 * Fix the naviframe to resize it's items which are inserted.
71 * Fix the naviframe to send signal emits one time for content show/hide, text show/hide. 71 * Fix the naviframe to send signal emits one time for content show/hide, text show/hide.
72 * Fix case where tooltips could go offscreen unnecessarily
72 73
73Removals: 74Removals:
74 75
diff --git a/src/lib/els_tooltip.c b/src/lib/els_tooltip.c
index a2e18a30c..4d8b74397 100644
--- a/src/lib/els_tooltip.c
+++ b/src/lib/els_tooltip.c
@@ -426,22 +426,36 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
426 TTDBG("INIT (INTERPRETED)\n"); 426 TTDBG("INIT (INTERPRETED)\n");
427 } 427 }
428 TTDBG("ADJUST (POINTER): tx=%d,ty=%d\n", tx, ty); 428 TTDBG("ADJUST (POINTER): tx=%d,ty=%d\n", tx, ty);
429 if (tx < 0) 429 if ((tx < 0) || (tx + tw > cw))
430 { 430 {
431 /* if we're offscreen, try to flip over the Y axis */ 431 /* if we're offscreen, try to flip over the Y axis */
432 if (abs((tx + 2 * tw) - cw) < abs(tx)) 432 if ((tx < 0) && (abs((tx + 2 * tw) - cw) < abs(tx)))
433 tx += tw; 433 tx += tw;
434 else if (tx + tw > cw)
435 {
436 int test_x = tx - tw;
437
438 if ((test_x >= 0) || (tx + tw - cw > abs(test_x)))
439 tx -= tw;
440 }
434 } 441 }
435 else if ((tx > px) && (px > tw)) 442 else if ((tx > px) && (px > tw))
436 { 443 {
437 if (tx + tw < cw) 444 if (tx + tw < cw)
438 tx += tw; 445 tx += tw;
439 } 446 }
440 if (ty < 0) 447 if ((ty < 0) || (ty + th > ch))
441 { 448 {
442 /* if we're offscreen, try to flip over the X axis */ 449 /* if we're offscreen, try to flip over the X axis */
443 if (abs((ty + 2 * th) - ch) < abs(ty)) 450 if ((ty < 0) && (abs((ty + 2 * th) - ch) < abs(ty)))
444 ty += th; 451 ty += th;
452 else if (ty + th > ch)
453 {
454 int test_y = ty - th;
455
456 if ((test_y >= 0) || (ty + th - ch > abs(test_y)))
457 ty -= th;
458 }
445 } 459 }
446 else if ((ty > py) && (py > th)) 460 else if ((ty > py) && (py > th))
447 { 461 {