Mercurial > hg > forks > geeqie
comparison src/layout_util.c @ 2824:c9eded8ad4e0
Fix #305: Faster Tagging (Keywords)
https://github.com/BestImageViewer/geeqie/issues/305
Keyword autocompletion - see the Info Sidebar section in the Help file
for details
author | Colin Clark <colin.clark@cclark.uk> |
---|---|
date | Sun, 26 Aug 2018 13:32:42 +0100 |
parents | f1c975235feb |
children | e88128f85953 |
comparison
equal
deleted
inserted
replaced
2823:938790283e32 | 2824:c9eded8ad4e0 |
---|---|
23 #include "layout_util.h" | 23 #include "layout_util.h" |
24 | 24 |
25 #include "advanced_exif.h" | 25 #include "advanced_exif.h" |
26 #include "bar_sort.h" | 26 #include "bar_sort.h" |
27 #include "bar.h" | 27 #include "bar.h" |
28 #include "bar_keywords.h" | |
28 #include "cache_maint.h" | 29 #include "cache_maint.h" |
29 #include "collect.h" | 30 #include "collect.h" |
30 #include "collect-dlg.h" | 31 #include "collect-dlg.h" |
31 #include "compat.h" | 32 #include "compat.h" |
32 #include "color-man.h" | 33 #include "color-man.h" |
1654 static void layout_menu_metadata_write_cb(GtkAction *action, gpointer data) | 1655 static void layout_menu_metadata_write_cb(GtkAction *action, gpointer data) |
1655 { | 1656 { |
1656 metadata_write_queue_confirm(TRUE, NULL, NULL); | 1657 metadata_write_queue_confirm(TRUE, NULL, NULL); |
1657 } | 1658 } |
1658 | 1659 |
1660 static GtkWidget *last_focussed = NULL; | |
1661 static void layout_menu_keyword_autocomplete_cb(GtkAction *action, gpointer data) | |
1662 { | |
1663 LayoutWindow *lw = data; | |
1664 GtkWidget *tmp; | |
1665 gboolean auto_has_focus; | |
1666 | |
1667 tmp = gtk_window_get_focus(GTK_WINDOW(lw->window)); | |
1668 auto_has_focus = bar_keywords_autocomplete_focus(lw); | |
1669 | |
1670 if (auto_has_focus) | |
1671 { | |
1672 gtk_widget_grab_focus(last_focussed); | |
1673 } | |
1674 else | |
1675 { | |
1676 last_focussed = tmp; | |
1677 } | |
1678 } | |
1659 | 1679 |
1660 /* | 1680 /* |
1661 *----------------------------------------------------------------------------- | 1681 *----------------------------------------------------------------------------- |
1662 * color profile button (and menu) | 1682 * color profile button (and menu) |
1663 *----------------------------------------------------------------------------- | 1683 *----------------------------------------------------------------------------- |
1886 { "Plugins", GTK_STOCK_PREFERENCES, N_("Configure _Plugins..."), NULL, N_("Configure Plugins..."), CB(layout_menu_editors_cb) }, | 1906 { "Plugins", GTK_STOCK_PREFERENCES, N_("Configure _Plugins..."), NULL, N_("Configure Plugins..."), CB(layout_menu_editors_cb) }, |
1887 { "LayoutConfig", GTK_STOCK_PREFERENCES, N_("_Configure this window..."), NULL, N_("Configure this window..."), CB(layout_menu_layout_config_cb) }, | 1907 { "LayoutConfig", GTK_STOCK_PREFERENCES, N_("_Configure this window..."), NULL, N_("Configure this window..."), CB(layout_menu_layout_config_cb) }, |
1888 { "Maintenance", PIXBUF_INLINE_ICON_MAINTENANCE, N_("_Cache maintenance..."), NULL, N_("Cache maintenance..."), CB(layout_menu_remove_thumb_cb) }, | 1908 { "Maintenance", PIXBUF_INLINE_ICON_MAINTENANCE, N_("_Cache maintenance..."), NULL, N_("Cache maintenance..."), CB(layout_menu_remove_thumb_cb) }, |
1889 { "Wallpaper", NULL, N_("Set as _wallpaper"), NULL, N_("Set as wallpaper"), CB(layout_menu_wallpaper_cb) }, | 1909 { "Wallpaper", NULL, N_("Set as _wallpaper"), NULL, N_("Set as wallpaper"), CB(layout_menu_wallpaper_cb) }, |
1890 { "SaveMetadata", GTK_STOCK_SAVE, N_("_Save metadata"), "<control>S", N_("Save metadata"), CB(layout_menu_metadata_write_cb) }, | 1910 { "SaveMetadata", GTK_STOCK_SAVE, N_("_Save metadata"), "<control>S", N_("Save metadata"), CB(layout_menu_metadata_write_cb) }, |
1911 { "KeywordAutocomplete", NULL, N_("Keyword autocomplete"), "<alt>K", N_("Keyword Autocomplete"), CB(layout_menu_keyword_autocomplete_cb) }, | |
1891 { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "equal", N_("Zoom in"), CB(layout_menu_zoom_in_cb) }, | 1912 { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "equal", N_("Zoom in"), CB(layout_menu_zoom_in_cb) }, |
1892 { "ZoomInAlt1", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "KP_Add", N_("Zoom in"), CB(layout_menu_zoom_in_cb) }, | 1913 { "ZoomInAlt1", GTK_STOCK_ZOOM_IN, N_("Zoom _in"), "KP_Add", N_("Zoom in"), CB(layout_menu_zoom_in_cb) }, |
1893 { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "minus", N_("Zoom out"), CB(layout_menu_zoom_out_cb) }, | 1914 { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "minus", N_("Zoom out"), CB(layout_menu_zoom_out_cb) }, |
1894 { "ZoomOutAlt1", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "KP_Subtract", N_("Zoom out"), CB(layout_menu_zoom_out_cb) }, | 1915 { "ZoomOutAlt1", GTK_STOCK_ZOOM_OUT, N_("Zoom _out"), "KP_Subtract", N_("Zoom out"), CB(layout_menu_zoom_out_cb) }, |
1895 { "Zoom100", GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "Z", N_("Zoom 1:1"), CB(layout_menu_zoom_1_1_cb) }, | 1916 { "Zoom100", GTK_STOCK_ZOOM_100, N_("Zoom _1:1"), "Z", N_("Zoom 1:1"), CB(layout_menu_zoom_1_1_cb) }, |
2108 " <menuitem action='Rating5'/>" | 2129 " <menuitem action='Rating5'/>" |
2109 " <menuitem action='RatingM1'/>" | 2130 " <menuitem action='RatingM1'/>" |
2110 " <separator/>" | 2131 " <separator/>" |
2111 " </menu>" | 2132 " </menu>" |
2112 " <menuitem action='SaveMetadata'/>" | 2133 " <menuitem action='SaveMetadata'/>" |
2134 " <menuitem action='KeywordAutocomplete'/>" | |
2113 " <placeholder name='PropertiesSection'/>" | 2135 " <placeholder name='PropertiesSection'/>" |
2114 " <separator/>" | 2136 " <separator/>" |
2115 " <menuitem action='DrawRectangle'/>" | 2137 " <menuitem action='DrawRectangle'/>" |
2116 " <separator/>" | 2138 " <separator/>" |
2117 " <menuitem action='Preferences'/>" | 2139 " <menuitem action='Preferences'/>" |