summaryrefslogtreecommitdiff
path: root/src/completion.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2013-06-30 21:40:49 +0200
committerDaniel Carl <danielcarl@gmx.de>2013-06-30 21:40:49 +0200
commitdd97c634228671cafddb38d61ccaf00b7275e6bb (patch)
treeda1aa3bdfa7997977b6cbf1404bfbbd8d153d880 /src/completion.c
parent0f5963e3d89594f0b6b7b5b3fa807348fad69d39 (diff)
Fixed too small completion box if completion list is small (#39).
If there where only few item in completion list, the completion list where shrinked under the allow winheight/3 value (only gtk3). Now we set the min content height of the scrollable window also if this should already fit.
Diffstat (limited to 'src/completion.c')
-rw-r--r--src/completion.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/completion.c b/src/completion.c
index 2e38480..5f94cc2 100644
--- a/src/completion.c
+++ b/src/completion.c
@@ -197,9 +197,10 @@ static void init_completion(GtkTreeModel *model)
gtk_widget_get_preferred_size(comp.tree, NULL, &size);
gtk_window_get_size(GTK_WINDOW(vb.gui.window), NULL, &height);
height /= 3;
- if (size.height > height) {
- gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(comp.win), height);
- }
+ gtk_scrolled_window_set_min_content_height(
+ GTK_SCROLLED_WINDOW(comp.win),
+ size.height > height ? height : size.height
+ );
#else
gtk_widget_size_request(comp.tree, &size);
gtk_window_get_size(GTK_WINDOW(vb.gui.window), NULL, &height);