[gnome-builder/wip/chergert/headerbar] editor: hide scrollbar when minimap is visible



commit 1b037d07557b036446ad40036ba54da6d30c11ba
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jun 26 00:49:20 2016 -0700

    editor: hide scrollbar when minimap is visible
    
    We can simply hide the scrollbar using GTK_POLICY_EXTERNAL when the
    overview map is visible.

 libide/editor/ide-editor-frame.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libide/editor/ide-editor-frame.c b/libide/editor/ide-editor-frame.c
index 51bf307..59cbb09 100644
--- a/libide/editor/ide-editor-frame.c
+++ b/libide/editor/ide-editor-frame.c
@@ -610,7 +610,7 @@ ide_editor_frame_get_show_map (IdeEditorFrame *self)
 
 static void
 ide_editor_frame_set_show_map (IdeEditorFrame *self,
-                              gboolean       show_map)
+                               gboolean        show_map)
 {
   g_assert (IDE_IS_EDITOR_FRAME (self));
 
@@ -643,6 +643,11 @@ ide_editor_frame_set_show_map (IdeEditorFrame *self,
           g_signal_emit_by_name (self->source_map, "show-map");
         }
 
+      /* Hide scrollbars when map is enabled. */
+      g_object_set (self->scrolled_window,
+                    "vscrollbar-policy", show_map ? GTK_POLICY_EXTERNAL : GTK_POLICY_AUTOMATIC,
+                    NULL);
+
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SHOW_MAP]);
     }
 }


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