[gnome-clocks] Put the scrolled window in the overlay.
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Put the scrolled window in the overlay.
- Date: Sun, 24 Feb 2013 14:43:13 +0000 (UTC)
commit ce103b52809fd019f5c82036b14ad63eca60d1ed
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Feb 24 15:41:51 2013 +0100
Put the scrolled window in the overlay.
Not the other way around. This makes sure the floating toolbar is
positioned correctly also when scrolling
src/widgets.vala | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/widgets.vala b/src/widgets.vala
index 89a764d..aa201f1 100644
--- a/src/widgets.vala
+++ b/src/widgets.vala
@@ -357,7 +357,6 @@ public class ContentView : Gtk.Bin {
private GLib.MenuModel selection_menu;
private Gtk.Toolbar selection_toolbar;
private Gtk.Overlay overlay;
- private Gtk.ScrolledWindow scrolled_window;
public ContentView (Gtk.Widget e, IconView iv, Toolbar t) {
empty_page = e;
@@ -367,15 +366,15 @@ public class ContentView : Gtk.Bin {
var builder = Utils.load_ui ("menu.ui");
selection_menu = builder.get_object ("selection-menu") as GLib.MenuModel;
+ var scrolled_window = new Gtk.ScrolledWindow (null, null);
+ scrolled_window.add (icon_view);
+
overlay = new Gtk.Overlay ();
- overlay.add (icon_view);
+ overlay.add (scrolled_window);
selection_toolbar = create_selection_toolbar ();
overlay.add_overlay (selection_toolbar);
- scrolled_window = new Gtk.ScrolledWindow (null, null);
- scrolled_window.add (overlay);
-
var model = icon_view.get_model ();
model.row_inserted.connect(() => {
update_empty_view (model);
@@ -460,9 +459,9 @@ public class ContentView : Gtk.Bin {
var child = get_child ();
if (model.get_iter_first (out i)) {
- if (child != scrolled_window) {
+ if (child != overlay) {
remove (child);
- add (scrolled_window);
+ add (overlay);
empty = false;
}
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]