[gnome-documents] thumb-bar: tweak thumb bar appearance



commit 375397fce6047ee264de9f0d72b1913236f3f76c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Nov 28 16:28:54 2012 -0500

    thumb-bar: tweak thumb bar appearance
    
    - make thumbnails smaller
    - have it extend the full window width
    - remove scrolling buttons

 src/lib/gd-sidebar-thumbnails.c |    6 +++---
 src/lib/gd-thumb-nav.c          |    2 --
 src/preview.js                  |   38 ++++++--------------------------------
 3 files changed, 9 insertions(+), 37 deletions(-)
---
diff --git a/src/lib/gd-sidebar-thumbnails.c b/src/lib/gd-sidebar-thumbnails.c
index 8619e15..e5514bb 100644
--- a/src/lib/gd-sidebar-thumbnails.c
+++ b/src/lib/gd-sidebar-thumbnails.c
@@ -33,7 +33,7 @@
 
 #include "gd-sidebar-thumbnails.h"
 
-#define THUMBNAIL_WIDTH 100
+#define THUMBNAIL_WIDTH 96
 
 typedef struct _EvThumbsSize
 {
@@ -301,8 +301,8 @@ gd_sidebar_thumbnails_constructed (GObject *object)
 	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self), cell, FALSE);
 	g_object_set (cell,
 	              "follow-state", FALSE,
-	              "height", 100,
-	              "width", 115,
+	              "height", 96,
+	              "width", 96,
 	              "yalign", 0.5,
 	              "xalign", 0.5,
 	              NULL);
diff --git a/src/lib/gd-thumb-nav.c b/src/lib/gd-thumb-nav.c
index 7e0e8d9..fd4e018 100644
--- a/src/lib/gd-thumb-nav.c
+++ b/src/lib/gd-thumb-nav.c
@@ -286,8 +286,6 @@ gd_thumb_nav_constructed (GObject *object)
 	if (priv->thumbview != NULL) {
 		gtk_container_add (GTK_CONTAINER (priv->sw), priv->thumbview);
 		gtk_widget_show_all (priv->sw);
-		gd_sidebar_thumbnails_set_item_height (GD_SIDEBAR_THUMBNAILS (priv->thumbview),
-						       115);
 
 		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
 						GTK_POLICY_AUTOMATIC,
diff --git a/src/preview.js b/src/preview.js
index a2c4ba4..61beeba 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -202,12 +202,14 @@ const PreviewThumbnails = new Lang.Class({
     Name: 'PreviewThumbnails',
 
     _init: function(model) {
-        this.view = new GdPrivate.SidebarThumbnails({ model: model });
-        this.widget = new GdPrivate.ThumbNav({ thumbview: this.view });
+        this.view = new GdPrivate.SidebarThumbnails({ model: model,
+                                                      visible: true });
+        this.widget = new GdPrivate.ThumbNav({ thumbview: this.view,
+                                               show_buttons: false });
         this.actor = new GtkClutter.Actor({ contents: this.widget,
                                             opacity: 0 });
 
-        this.widget.show_all();
+        this.widget.show();
     },
 
     show: function() {
@@ -245,36 +247,8 @@ const PreviewFullscreen = new Lang.Class({
 
         // create thumb bar
         this._thumbBar = new PreviewThumbnails(model);
-
         layout.add(this._thumbBar.actor,
-            Clutter.BinAlignment.FIXED, Clutter.BinAlignment.FIXED);
-
-        let widthConstraint =
-            new Clutter.BindConstraint({ source: parentActor,
-                                         coordinate: Clutter.BindCoordinate.WIDTH,
-                                         offset: - 300 });
-        this._thumbBar.actor.add_constraint(widthConstraint);
-        this._thumbBar.actor.connect('notify::width', Lang.bind(this,
-            function() {
-                let width = parentActor.width;
-                let offset = 300;
-
-                if (width > 1000)
-                    offset += (width - 1000);
-                else if (width < 600)
-                    offset -= (600 - width);
-
-                widthConstraint.offset = - offset;
-            }));
-
-        this._thumbBar.actor.add_constraint(
-            new Clutter.AlignConstraint({ align_axis: Clutter.AlignAxis.X_AXIS,
-                                          source: parentActor,
-                                          factor: 0.50 }));
-        this._thumbBar.actor.add_constraint(
-            new Clutter.AlignConstraint({ align_axis: Clutter.AlignAxis.Y_AXIS,
-                                          source: parentActor,
-                                          factor: 0.95 }));
+            Clutter.BinAlignment.FILL, Clutter.BinAlignment.END);
 
         // create toolbar
         this._fsToolbar = new PreviewFullscreenToolbar(previewView);



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