X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Fview-file%2Fview-file.cc;fp=src%2Fview-file%2Fview-file.cc;h=27b0c8e86aef1c70213cf4c911d02555b73f54d9;hp=929f4eb9ef459af168a6ba9dbc9cb19232ef6ee4;hb=98b2cdbeb4fada4a4e123bf0779a11067a6deae5;hpb=e57cfab83e6ca160d4a1240cc74f6da99bc507b0 diff --git a/src/view-file/view-file.cc b/src/view-file/view-file.cc index 929f4eb9..27b0c8e8 100644 --- a/src/view-file/view-file.cc +++ b/src/view-file/view-file.cc @@ -668,6 +668,19 @@ static void vf_pop_menu_collections_cb(GtkWidget *widget, gpointer data) filelist_free(selection_list); } +static void vf_pop_menu_show_star_rating_cb(GtkWidget *, gpointer data) +{ + auto *vf = static_cast(data); + + options->show_star_rating = !options->show_star_rating; + + switch (vf->type) + { + case FILEVIEW_LIST: vflist_pop_menu_show_star_rating_cb(vf); break; + case FILEVIEW_ICON: vficon_pop_menu_show_star_rating_cb(vf); break; + } +} + GtkWidget *vf_pop_menu(ViewFile *vf) { GtkWidget *menu; @@ -825,17 +838,8 @@ GtkWidget *vf_pop_menu(ViewFile *vf) break; } - switch (vf->type) - { - case FILEVIEW_LIST: - menu_item_add_check(menu, _("Show star rating"), options->show_star_rating, - G_CALLBACK(vflist_pop_menu_show_star_rating_cb), vf); - break; - case FILEVIEW_ICON: - menu_item_add_check(menu, _("Show star rating"), options->show_star_rating, - G_CALLBACK(vficon_pop_menu_show_star_rating_cb), vf); - break; - } + menu_item_add_check(menu, _("Show star rating"), options->show_star_rating, + G_CALLBACK(vf_pop_menu_show_star_rating_cb), vf); menu_item_add_icon(menu, _("Re_fresh"), GQ_ICON_REFRESH, G_CALLBACK(vf_pop_menu_refresh_cb), vf);