summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2018-02-13 19:29:54 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2018-02-13 19:29:54 +0100
commit8cbf865d33f4eb618908ed5ca91ed3c7d67eaf8a (patch)
tree265b77d45a35281c50937a6f42d58dea6971aab2
parent08ccc91d6061d6ad6d5b4a9390809ced62da993a (diff)
gui: better resizing of the completoion popup
The completion popup now can consume the totality of the screen width, instead of being restricted by the column the completion started.
-rw-r--r--src/gui.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui.c b/src/gui.c
index c077ae5..af1468d 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -808,9 +808,8 @@ gui_completion_show(s_gui *gui,
808 int win_w, win_h; 808 int win_w, win_h;
809 evas_object_geometry_get(gui->win, NULL, NULL, &win_w, &win_h); 809 evas_object_geometry_get(gui->win, NULL, NULL, &win_w, &win_h);
810 810
811 /* We will not make the popup larger than 90% of the window's width, 811 /* We will not make the popup larger than 60% of the window's height */
812 * not larger than 60% of the window's height */ 812 const int max_width = tv_width;
813 const int max_width = (int)((float)win_w * 0.9f);
814 const int max_height = (int)((float)win_h * 0.6f); 813 const int max_height = (int)((float)win_h * 0.6f);
815 int width = MIN(ideal_width, max_width); 814 int width = MIN(ideal_width, max_width);
816 int height = MIN(ideal_height, max_height); 815 int height = MIN(ideal_height, max_height);
@@ -852,7 +851,11 @@ gui_completion_show(s_gui *gui,
852 851
853 /* If the width is too big to fit, we reduce it */ 852 /* If the width is too big to fit, we reduce it */
854 if (px + width > tv_width) 853 if (px + width > tv_width)
855 width = tv_width - px - w_offset; 854 {
855 px = tv_width - width + w_offset;
856 if (px < 0) px = w_offset;
857 width = tv_width - px - w_offset;
858 }
856 859
857 /* Show the completion panel: we move it where the completion was, show it, 860 /* Show the completion panel: we move it where the completion was, show it,
858 * set make sure the **visible** part of the genlist fits it height, 861 * set make sure the **visible** part of the genlist fits it height,