vficon_toggle_filenames(vf);
}
-static void vficon_toggle_star_rating(ViewFile *vf)
+void vficon_pop_menu_show_star_rating_cb(ViewFile *vf)
{
GtkAllocation allocation;
- options->show_star_rating = !options->show_star_rating;
-
gtk_widget_get_allocation(vf->listview, &allocation);
vficon_populate_at_new_size(vf, allocation.width, allocation.height, TRUE);
}
-void vficon_pop_menu_show_star_rating_cb(GtkWidget *, gpointer data)
-{
- auto vf = static_cast<ViewFile *>(data);
-
- vficon_toggle_star_rating(vf);
-}
-
void vficon_pop_menu_refresh_cb(GtkWidget *, gpointer data)
{
auto vf = static_cast<ViewFile *>(data);
GList *vficon_pop_menu_file_list(ViewFile *vf);
void vficon_pop_menu_view_cb(GtkWidget *widget, gpointer data);
void vficon_pop_menu_rename_cb(GtkWidget *widget, gpointer data);
+void vficon_pop_menu_show_star_rating_cb(ViewFile *vf);
void vficon_pop_menu_refresh_cb(GtkWidget *widget, gpointer data);
void vficon_popup_destroy_cb(GtkWidget *widget, gpointer data);
void vficon_pop_menu_show_names_cb(GtkWidget *widget, gpointer data);
-void vficon_pop_menu_show_star_rating_cb(GtkWidget *widget, gpointer data);
FileData *vficon_index_get_data(ViewFile *vf, gint row);
gint vficon_index_by_fd(ViewFile *vf, FileData *in_fd);
g_list_free(columns);
}
-void vflist_pop_menu_show_star_rating_cb(GtkWidget *, gpointer data)
+void vflist_pop_menu_show_star_rating_cb(ViewFile *vf)
{
- auto vf = static_cast<ViewFile *>(data);
-
- options->show_star_rating = !options->show_star_rating;
-
vflist_populate_view(vf, TRUE);
vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
GList *vflist_pop_menu_file_list(ViewFile *vf);
void vflist_pop_menu_view_cb(GtkWidget *widget, gpointer data);
void vflist_pop_menu_rename_cb(GtkWidget *widget, gpointer data);
+void vflist_pop_menu_show_star_rating_cb(ViewFile *vf);
void vflist_pop_menu_refresh_cb(GtkWidget *widget, gpointer data);
void vflist_popup_destroy_cb(GtkWidget *widget, gpointer data);
void vflist_pop_menu_thumbs_cb(GtkWidget *widget, gpointer data);
void vflist_set_thumb_fd(ViewFile *vf, FileData *fd);
FileData *vflist_thumb_next_fd(ViewFile *vf);
void vflist_thumb_reset_all(ViewFile *vf);
-void vflist_pop_menu_show_star_rating_cb(GtkWidget *widget, gpointer data);
FileData *vflist_star_next_fd(ViewFile *vf);
void vflist_set_star_fd(ViewFile *vf, FileData *fd);
filelist_free(selection_list);
}
+static void vf_pop_menu_show_star_rating_cb(GtkWidget *, gpointer data)
+{
+ auto *vf = static_cast<ViewFile *>(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;
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);