[gnome-documents/wip/ui-changes] thumb-bar: tweak thumb bar appearance
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/ui-changes] thumb-bar: tweak thumb bar appearance
- Date: Wed, 28 Nov 2012 21:30:30 +0000 (UTC)
commit 08273ec7eb3adf006e1c9f1560fcabab006d3593
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 | 4 ++--
src/preview.js | 33 +++------------------------------
3 files changed, 8 insertions(+), 35 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..738cc95 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,
@@ -340,6 +338,7 @@ gd_thumb_nav_init (GdThumbNav *nav)
priv->show_buttons = TRUE;
priv->button_left = gtk_button_new ();
+ gtk_widget_set_no_show_all (priv->button_left, TRUE);
gtk_button_set_relief (GTK_BUTTON (priv->button_left), GTK_RELIEF_NONE);
gtk_widget_set_size_request (GTK_WIDGET (priv->button_left), 30, 0);
gtk_box_pack_start (GTK_BOX (nav), priv->button_left, FALSE, FALSE, 0);
@@ -382,6 +381,7 @@ gd_thumb_nav_init (GdThumbNav *nav)
nav);
priv->button_right = gtk_button_new ();
+ gtk_widget_set_no_show_all (priv->button_right, TRUE);
gtk_button_set_relief (GTK_BUTTON (priv->button_right), GTK_RELIEF_NONE);
gtk_widget_set_size_request (GTK_WIDGET (priv->button_right), 30, 0);
gtk_box_pack_start (GTK_BOX (nav), priv->button_right, FALSE, FALSE, 0);
diff --git a/src/preview.js b/src/preview.js
index d7f9818..053cba5 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -203,7 +203,8 @@ const PreviewThumbnails = new Lang.Class({
_init: function(model) {
this.view = new GdPrivate.SidebarThumbnails({ model: model });
- this.widget = new GdPrivate.ThumbNav({ thumbview: this.view });
+ this.widget = new GdPrivate.ThumbNav({ thumbview: this.view,
+ show_buttons: false });
this.actor = new GtkClutter.Actor({ contents: this.widget,
opacity: 0 });
@@ -245,36 +246,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]