Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sat, 05 Oct 2019 16:13:35 UTC Commit: 4e7c2eeab695b5fc3c0e6123800ced1c767f7e85 https://github.com/geany/geany-plugins/commit/4e7c2eeab695b5fc3c0e6123800ced...
Log Message: ----------- projectorganizer: Add a keybinding for for focusing the sidebar
Modified Paths: -------------- projectorganizer/src/prjorg-menu.c projectorganizer/src/prjorg-sidebar.c projectorganizer/src/prjorg-sidebar.h
Modified: projectorganizer/src/prjorg-menu.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -42,6 +42,7 @@ enum KB_FIND_IN_PROJECT, KB_FIND_FILE, KB_FIND_TAG, + KB_FOCUS_SIDEBAR, KB_COUNT };
@@ -417,6 +418,9 @@ void prjorg_menu_init(void) keybindings_set_item(key_group, KB_SWAP_HEADER_SOURCE, NULL, 0, 0, "swap_header_source", _("Swap header/source"), s_shs_item);
+ keybindings_set_item(key_group, KB_FOCUS_SIDEBAR, (GeanyKeyCallback)prjorg_sidebar_focus_project_tab, + 0, 0, "focus_project_sidebar", _("Focus Project Sidebar"), NULL); + s_context_sep_item = gtk_separator_menu_item_new(); gtk_widget_show(s_context_sep_item); gtk_menu_shell_prepend(GTK_MENU_SHELL(geany->main_widgets->editor_menu), s_context_sep_item);
Modified: projectorganizer/src/prjorg-sidebar.c 19 lines changed, 19 insertions(+), 0 deletions(-) =================================================================== @@ -1493,6 +1493,25 @@ void prjorg_sidebar_find_tag_in_active(void) }
+void prjorg_sidebar_focus_project_tab(void) +{ + GtkNotebook *notebook = GTK_NOTEBOOK(geany_data->main_widgets->sidebar_notebook); + gint pagenum = gtk_notebook_get_n_pages(notebook); + gint i; + + for (i = 0; i < pagenum; i++) + { + GtkWidget *page = gtk_notebook_get_nth_page(notebook, i); + if (page == s_file_view_vbox) + { + gtk_notebook_set_current_page(notebook, i); + gtk_widget_grab_focus(s_file_view); + break; + } + } +} + + static void sidebar_realized_cb (GtkWidget *widget) { if (s_pending_reload) prjorg_sidebar_update(TRUE);
Modified: projectorganizer/src/prjorg-sidebar.h 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -29,6 +29,7 @@ void prjorg_sidebar_find_tag_in_active(void);
void prjorg_sidebar_update(gboolean reload);
+void prjorg_sidebar_focus_project_tab(void);
#endif
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org