[latexila] Completion: natural size for the proposals' details



commit d8cd222b84482d092fddef7bd2f00b1a68e2727e
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Thu Sep 6 23:50:07 2012 +0200

    Completion: natural size for the proposals' details
    
    There is maybe an easier hack for doing this. Anyway the right place to
    fix this issue is to reimplement the set_sizing() function in
    GtkSourceView. I hope this will be done for the next cycle:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679280

 src/document_view.vala |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/document_view.vala b/src/document_view.vala
index a316d28..8c55659 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -69,6 +69,25 @@ public class DocumentView : Gtk.SourceView
             {
                 provider.hide_calltip_window ();
             });
+
+            /* Natural size of the calltip */
+            // When the set_sizing() function is back, this hack can be removed.
+            SourceCompletionInfo info = completion.get_info_window ();
+
+            // This code is highly dependent on the implementation in GtkSourceView.
+            ScrolledWindow scrolled_window = info.get_child () as ScrolledWindow;
+            scrolled_window.set_policy (PolicyType.NEVER, PolicyType.NEVER);
+
+            info.draw.connect (() =>
+            {
+                Widget child = info.get_widget ();
+
+                Requisition size;
+                child.get_preferred_size (null, out size);
+                info.resize (size.width + 10, size.height + 10);
+
+                return false;
+            });
         }
         catch (GLib.Error e)
         {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]