[latexila] Completion info window sizing: more robust
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Completion info window sizing: more robust
- Date: Tue, 25 Sep 2012 21:31:14 +0000 (UTC)
commit 94a3fef753e0391a85cc132f0b8b8c855edf17aa
Author: SÃbastien Wilmet <swilmet gnome org>
Date: Tue Sep 25 23:30:31 2012 +0200
Completion info window sizing: more robust
src/completion.vala | 7 +++++--
src/document_view.vala | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/completion.vala b/src/completion.vala
index ee00c17..1ab976d 100644
--- a/src/completion.vala
+++ b/src/completion.vala
@@ -305,8 +305,11 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
_calltip_window = new SourceCompletionInfo ();
// HACK: no scrollbars
- ScrolledWindow scrolled_window = _calltip_window.get_child () as ScrolledWindow;
- scrolled_window.set_policy (PolicyType.NEVER, PolicyType.NEVER);
+ if (_calltip_window.get_child () is ScrolledWindow)
+ {
+ ScrolledWindow sw = _calltip_window.get_child () as ScrolledWindow;
+ sw.set_policy (PolicyType.NEVER, PolicyType.NEVER);
+ }
_calltip_window_label = new Label (null);
_calltip_window.set_widget (_calltip_window_label);
diff --git a/src/document_view.vala b/src/document_view.vala
index f105fe8..2777de2 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -75,8 +75,11 @@ public class DocumentView : Gtk.SourceView
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);
+ if (info.get_child () is ScrolledWindow)
+ {
+ ScrolledWindow scrolled_window = info.get_child () as ScrolledWindow;
+ scrolled_window.set_policy (PolicyType.NEVER, PolicyType.NEVER);
+ }
info.draw.connect (() =>
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]