Updating branch refs/heads/master
         to cf6cffe2bcb861194a2dd19c78e55a00a1ce9f88 (commit)
       from 6ae3633dce4e4ed6c892f6090ed4f7feb2de0c9c (commit)

commit cf6cffe2bcb861194a2dd19c78e55a00a1ce9f88
Author: Christian Dywan <christ...@twotoasts.de>
Date:   Thu Mar 4 23:47:05 2010 +0100

    Relate completion height to browser window height
    
    To prevent the completion from obscuring other windows, it will
    relate to 2/3 of the browser window and screen height respectively.

 midori/midori-locationaction.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index f86260c..d053b7f 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -342,7 +342,8 @@ midori_location_action_popup_timeout_cb (gpointer data)
     gint result;
     static sqlite3_stmt* stmt;
     const gchar* sqlcmd;
-    gint matches, searches, height, screen_height, sep;
+    gint matches, searches, height, screen_height, browser_height, sep;
+    MidoriBrowser* browser = midori_browser_get_for_widget (action->entry);
     GtkStyle* style;
 
     if (!gtk_widget_has_focus (action->entry) || !action->history)
@@ -497,10 +498,12 @@ midori_location_action_popup_timeout_cb (gpointer data)
     column = gtk_tree_view_get_column (GTK_TREE_VIEW (action->treeview), 0);
     gtk_tree_view_column_cell_get_size (column, NULL, NULL, NULL, NULL, 
&height);
     screen_height = gdk_screen_get_height (gtk_widget_get_screen 
(action->popup));
+    gtk_window_get_size (GTK_WINDOW (browser), NULL, &browser_height);
+    screen_height = MIN (MIN (browser_height, screen_height / 1.5), 
screen_height / 1.5);
     gtk_widget_style_get (action->treeview, "vertical-separator", &sep, NULL);
     /* FIXME: Instead of 1.5 we should relate to the height of one line */
     height = MIN (matches * height + (matches + searches) * sep
-                                   + searches * height / 1.5, screen_height / 
1.5);
+                                   + searches * height / 1.5, screen_height);
     gtk_widget_set_size_request (action->treeview, -1, height);
     midori_location_action_popup_position (action->popup, action->entry);
     gtk_widget_show_all (action->popup);
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to