After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726685 - keyboard navigation using arrow keys in preview mode
keyboard navigation using arrow keys in preview mode
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-03-19 08:31 UTC by Pranav Kant
Modified: 2014-07-18 15:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use arrow keys for navigating photos in preview mode (5.65 KB, patch)
2014-06-21 20:25 UTC, Pranav Kant
none Details | Review
use arrow keys for navigating photos in preview mode (5.81 KB, patch)
2014-06-22 07:52 UTC, Pranav Kant
none Details | Review
use arrow keys for navigating photos in preview mode (5.64 KB, patch)
2014-06-22 11:33 UTC, Pranav Kant
needs-work Details | Review
Use arrow keys for navigating in preview mode (7.99 KB, patch)
2014-07-01 10:08 UTC, Debarshi Ray
none Details | Review
Use arrow keys for navigating in preview mode (8.10 KB, patch)
2014-07-01 10:23 UTC, Debarshi Ray
committed Details | Review
preview-nav-buttons: Restrict keynav within the bounds of the model (7.73 KB, patch)
2014-07-18 10:56 UTC, Debarshi Ray
committed Details | Review

Description Pranav Kant 2014-03-19 08:31:53 UTC
It would be nice to use arrow keys for navigating photos in preview mode.
Comment 1 Pranav Kant 2014-06-21 20:25:08 UTC
Created attachment 278907 [details] [review]
use arrow keys for navigating photos in preview mode
Comment 2 Pranav Kant 2014-06-22 07:52:38 UTC
Created attachment 278920 [details] [review]
use arrow keys for navigating photos in preview mode
Comment 3 Pranav Kant 2014-06-22 11:33:44 UTC
Created attachment 278922 [details] [review]
use arrow keys for navigating photos in preview mode
Comment 4 Debarshi Ray 2014-07-01 10:07:34 UTC
Review of attachment 278922 [details] [review]:

Nice patch, Pranav.

::: src/photos-embed.h
@@ +30,2 @@
 #include "photos-main-toolbar.h"
+#include "photos-preview-view.h"

Remove the #include from photos-embed.c.

@@ +76,3 @@
 PhotosMainToolbar     *photos_embed_get_main_toolbar       (PhotosEmbed *self);
 
+PhotosPreviewView     *photos_embed_get_preview_view       (PhotosEmbed *self);

I think photos_embed_get_preview would be a better name because that is what it is called in gnome-documents.

::: src/photos-main-window.c
@@ +246,3 @@
           photos_base_manager_set_active_object (priv->item_mngr, NULL);
           photos_mode_controller_go_back (priv->mode_cntrlr);
+          ret = GDK_EVENT_STOP;

Do we really need to return GDK_EVENT_STOP?

::: src/photos-preview-nav-buttons.c
@@ +309,3 @@
 photos_preview_nav_buttons_next_clicked (PhotosPreviewNavButtons *self)
 {
   gtk_tree_path_next (self->priv->current_path);

Also move the function definition towards the lower half of the file. We usually put public methods in alphabetical order after the _new.

@@ +317,3 @@
 photos_preview_nav_buttons_prev_clicked (PhotosPreviewNavButtons *self)
 {
   gtk_tree_path_prev (self->priv->current_path);

Ditto.

::: src/photos-preview-nav-buttons.h
@@ +83,3 @@
 void                        photos_preview_nav_buttons_show               (PhotosPreviewNavButtons *self);
 
+void                        photos_preview_nav_buttons_next_clicked       (PhotosPreviewNavButtons *self);

Remove the _clicked because it is no longer just a callback for the 'clicked' signal.

@@ +85,3 @@
+void                        photos_preview_nav_buttons_next_clicked       (PhotosPreviewNavButtons *self);
+
+void                        photos_preview_nav_buttons_prev_clicked       (PhotosPreviewNavButtons *self);

Ditto.

::: src/photos-preview-view.c
@@ +277,3 @@
+photos_preview_view_load_previous (PhotosPreviewView *self)
+{
+  PhotosPreviewViewPrivate *priv = self->priv;

No need for this because priv is used in only one place. Just use self->priv->nav_buttons.
Comment 5 Debarshi Ray 2014-07-01 10:08:57 UTC
Created attachment 279661 [details] [review]
Use arrow keys for navigating in preview mode
Comment 6 Debarshi Ray 2014-07-01 10:22:47 UTC
(In reply to comment #4)

> ::: src/photos-main-window.c
> @@ +246,3 @@
>            photos_base_manager_set_active_object (priv->item_mngr, NULL);
>            photos_mode_controller_go_back (priv->mode_cntrlr);
> +          ret = GDK_EVENT_STOP;
> 
> Do we really need to return GDK_EVENT_STOP?

Ofcourse we need it, otherwise pressing the arrow keys will also move the keyboard focus from the current widget. I think handled would be a better name to retain consistency with rest of the code.
Comment 7 Debarshi Ray 2014-07-01 10:23:25 UTC
Created attachment 279662 [details] [review]
Use arrow keys for navigating in preview mode
Comment 8 Debarshi Ray 2014-07-18 10:56:25 UTC
Created attachment 281076 [details] [review]
preview-nav-buttons: Restrict keynav within the bounds of the model