[gnome-documents] preview: make some widgets insensitive when there's only one page
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] preview: make some widgets insensitive when there's only one page
- Date: Wed, 27 Feb 2013 22:28:28 +0000 (UTC)
commit 1fcb2d97433d22efae51421bce924636a1214f6c
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Feb 27 17:26:12 2013 -0500
preview: make some widgets insensitive when there's only one page
When the document only has one page, it doesn't make sense for controls
on the page navigation widget to be sensitive.
https://bugzilla.gnome.org/show_bug.cgi?id=694806
src/lib/gd-nav-bar.c | 1 +
src/preview.js | 6 +++++-
2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/lib/gd-nav-bar.c b/src/lib/gd-nav-bar.c
index c822e05..9b945b5 100644
--- a/src/lib/gd-nav-bar.c
+++ b/src/lib/gd-nav-bar.c
@@ -480,6 +480,7 @@ gd_nav_bar_document_changed_cb (EvDocumentModel *model,
previews_create (self);
+ gtk_widget_set_sensitive (priv->scale, (priv->n_pages > 1));
gtk_range_set_range (GTK_RANGE (priv->scale), 0.0, priv->n_pages - 1);
update_page (self);
diff --git a/src/preview.js b/src/preview.js
index d87d8b5..cf1918b 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -580,6 +580,10 @@ const PreviewNavBar = new Lang.Class({
this.widget.document_model = model;
if (!model)
this.hide();
+
+ let hasMultiplePages = (model.document.get_n_pages() > 1);
+ Application.application.lookup_action('bookmark-page').enabled = hasMultiplePages;
+ Application.application.lookup_action('places').enabled = hasMultiplePages;
},
show: function() {
@@ -765,7 +769,7 @@ const PreviewNavButtons = new Lang.Class({
this._visible = false;
this._fadeOutButton(this.prev_widget);
this._fadeOutButton(this.next_widget);
- },
+ }
});
const PreviewToolbar = new Lang.Class({
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]