submenu = submenu_add_edit(menu, &item, G_CALLBACK(li_pop_menu_edit_cb), lw, editmenu_fd_list);
if (!path) gtk_widget_set_sensitive(item, FALSE);
menu_item_add_divider(submenu);
+#if !GTK_CHECK_VERSION(3,0,0)
menu_item_add(submenu, _("Set as _wallpaper"), G_CALLBACK(li_pop_menu_wallpaper_cb), lw);
-
+#endif
item = submenu_add_alter(menu, G_CALLBACK(li_pop_menu_alter_cb), lw);
item = menu_item_add_stock(menu, _("View in _new window"), GTK_STOCK_NEW, G_CALLBACK(li_pop_menu_new_cb), lw);
}
}
+static void image_alter_rating(FileData *fd_n, const gchar *rating)
+{
+ metadata_write_string(fd_n, RATING_KEY, rating);
+}
+
+void layout_image_rating(LayoutWindow *lw, const gchar *rating)
+{
+ if (!layout_valid(&lw)) return;
+
+ GtkTreeModel *store;
+ GList *work;
+ GtkTreeSelection *selection;
+ GtkTreePath *tpath;
+ FileData *fd_n;
+ GtkTreeIter iter;
+ IconData *id;
+
+ if (!lw || !lw->vf) return;
+
+ if (lw->vf->type == FILEVIEW_ICON)
+ {
+ if (!VFICON(lw->vf)->selection) return;
+ work = VFICON(lw->vf)->selection;
+ }
+ else
+ {
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(lw->vf->listview));
+ work = gtk_tree_selection_get_selected_rows(selection, &store);
+ }
+
+ while (work)
+ {
+ if (lw->vf->type == FILEVIEW_ICON)
+ {
+ id = work->data;
+ fd_n = id->fd;
+ work = work->next;
+ }
+ else
+ {
+ tpath = work->data;
+ gtk_tree_model_get_iter(store, &iter, tpath);
+ gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &fd_n, -1);
+ work = work->next;
+ }
+
+ image_alter_rating(fd_n, rating);
+ }
+}
+
void layout_image_reset_orientation(LayoutWindow *lw)
{
ImageWindow *imd= lw->image;
switch (event->button)
{
case MOUSE_BUTTON_LEFT:
+ if (event->type == GDK_2BUTTON_PRESS)
+ {
+ if (lw->full_screen)
+ layout_image_full_screen_stop(lw);
+ }
if (options->image_lm_click_nav && lw->split_mode == SPLIT_NONE)
layout_image_next(lw);
break;
GList *work = g_list_last(layout_selection_list(lw));
gint j = 0;
- if (work) work = work->prev;
-
while (work && j < i)
{
FileData *fd = work->data;
work = work->prev;
- j++;
- if (!fd || !*fd->path) continue;
+ if (!fd || !*fd->path || fd->parent ||
+ fd == lw->split_images[0]->image_fd)
+ {
+ continue;
+ }
img_fd = fd;
+
+ j++;
}
}