GNOME Bugzilla – Bug 726685
keyboard navigation using arrow keys in preview mode
Last modified: 2014-07-18 15:58:50 UTC
It would be nice to use arrow keys for navigating photos in preview mode.
Created attachment 278907 [details] [review] use arrow keys for navigating photos in preview mode
Created attachment 278920 [details] [review] use arrow keys for navigating photos in preview mode
Created attachment 278922 [details] [review] use arrow keys for navigating photos in preview mode
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.
Created attachment 279661 [details] [review] Use arrow keys for navigating in preview mode
(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.
Created attachment 279662 [details] [review] Use arrow keys for navigating in preview mode
Created attachment 281076 [details] [review] preview-nav-buttons: Restrict keynav within the bounds of the model