file_util_start_editor_from_file(key, layout_image_get_fd(lw), lw->window);
}
+#if !GTK_CHECK_VERSION(3,0,0)
static void li_pop_menu_wallpaper_cb(GtkWidget *widget, gpointer data)
{
LayoutWindow *lw = data;
layout_image_to_root(lw);
}
+#endif
static void li_pop_menu_alter_cb(GtkWidget *widget, gpointer data)
{
file_util_copy_path_to_clipboard(layout_image_get_fd(lw), FALSE);
}
+static void li_pop_menu_copy_image_cb(GtkWidget *widget, gpointer data)
+{
+ LayoutWindow *lw = data;
+ ImageWindow *imd = lw->image;
+
+ GdkPixbuf *pixbuf;
+ pixbuf = image_get_pixbuf(imd);
+ if (!pixbuf) return;
+ gtk_clipboard_set_image(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), pixbuf);
+}
+
static void li_pop_menu_move_cb(GtkWidget *widget, gpointer data)
{
LayoutWindow *lw = data;
if (fd) layout_set_fd(lw, fd);
}
+static void li_open_archive_cb(GtkWidget *widget, gpointer data)
+{
+ LayoutWindow *lw = data;
+ LayoutWindow *lw_new;
+ gchar *dest_dir;
+
+ if (!layout_valid(&lw)) return;
+
+ dest_dir = open_archive(layout_image_get_fd(lw));
+ if (dest_dir)
+ {
+ lw_new = layout_new_from_default();
+ layout_set_path(lw_new, dest_dir);
+ g_free(dest_dir);
+ }
+ else
+ {
+ warning_dialog(_("Cannot open archive file"), _("See the Log Window"), GTK_STOCK_DIALOG_WARNING, NULL);
+ }
+}
+
static gboolean li_check_if_current_path(LayoutWindow *lw, const gchar *path)
{
gchar *dirname;
item = menu_item_add(menu, _("_Go to directory view"), G_CALLBACK(li_set_layout_path_cb), lw);
if (!path || li_check_if_current_path(lw, path)) gtk_widget_set_sensitive(item, FALSE);
+ item = menu_item_add_stock(menu, _("Open archive"), GTK_STOCK_OPEN, G_CALLBACK(li_open_archive_cb), lw);
+ if (!path || lw->image->image_fd->format_class != FORMAT_CLASS_ARCHIVE)
+ {
+ gtk_widget_set_sensitive(item, FALSE);
+ }
+
menu_item_add_divider(menu);
item = menu_item_add_stock(menu, _("_Copy..."), GTK_STOCK_COPY, G_CALLBACK(li_pop_menu_copy_cb), lw);
if (!path) gtk_widget_set_sensitive(item, FALSE);
item = menu_item_add(menu, _("_Copy path"), G_CALLBACK(li_pop_menu_copy_path_cb), lw);
item = menu_item_add(menu, _("_Copy path unquoted"), G_CALLBACK(li_pop_menu_copy_path_unquoted_cb), lw);
+ item = menu_item_add(menu, _("Copy _image"), G_CALLBACK(li_pop_menu_copy_image_cb), lw);
if (!path) gtk_widget_set_sensitive(item, FALSE);
menu_item_add_divider(menu);
if (options->image.exif_rotate_enable)
{
- imd->orientation = metadata_read_int(imd->image_fd, ORIENTATION_KEY, EXIF_ORIENTATION_TOP_LEFT);
+ if (g_strcmp0(imd->image_fd->format_name, "heif") != 0)
+ {
+ imd->orientation = metadata_read_int(imd->image_fd, ORIENTATION_KEY, EXIF_ORIENTATION_TOP_LEFT);
+ }
+ else
+ {
+ imd->orientation = EXIF_ORIENTATION_TOP_LEFT;
+ }
}
else
{
return image_get_overunderexposed(lw->image);
}
+void layout_image_set_ignore_alpha(LayoutWindow *lw, gboolean ignore_alpha)
+{
+ if (!layout_valid(&lw)) return;
+
+ lw->options.ignore_alpha = ignore_alpha;
+ image_set_ignore_alpha(lw->image, ignore_alpha);
+}
+
/* stereo */
/*
gint layout_image_stereo_get(LayoutWindow *lw)
if (y->next)
layout_image_set_index(lw, GPOINTER_TO_INT(y->next->data));
else
- layout_image_set_index(lw, GPOINTER_TO_INT(x->data));
+ {
+ if (options->circular_selection_lists)
+ {
+ layout_image_set_index(lw, GPOINTER_TO_INT(x->data));
+ }
+ }
}
while (x)
x = g_list_remove(x, x->data);
if (y->prev)
layout_image_set_index(lw, GPOINTER_TO_INT(y->prev->data));
else
- layout_image_set_index(lw, GPOINTER_TO_INT(last->data));
+ {
+ if (options->circular_selection_lists)
+ {
+ layout_image_set_index(lw, GPOINTER_TO_INT(last->data));
+ }
+ }
}
while (x)
x = g_list_remove(x, x->data);
{
LayoutWindow *lw = data;
GtkWidget *menu;
- FileData *dir_fd;
+ LayoutWindow *lw_new;
+ gchar *dest_dir;
switch (event->button)
{
case MOUSE_BUTTON_LEFT:
- if (options->image_l_click_video && options->image_l_click_video_editor && imd->image_fd && imd->image_fd->format_class == FORMAT_CLASS_VIDEO)
+ if (options->image_l_click_archive && imd-> image_fd && imd->image_fd->format_class == FORMAT_CLASS_ARCHIVE)
+ {
+ dest_dir = open_archive(imd->image_fd);
+ if (dest_dir)
+ {
+ lw_new = layout_new_from_default();
+ layout_set_path(lw_new, dest_dir);
+ g_free(dest_dir);
+ }
+ else
+ {
+ warning_dialog(_("Cannot open archive file"), _("See the Log Window"), GTK_STOCK_DIALOG_WARNING, NULL);
+ }
+ }
+ else if (options->image_l_click_video && options->image_l_click_video_editor && imd-> image_fd && imd->image_fd->format_class == FORMAT_CLASS_VIDEO)
{
start_editor_from_file(options->image_l_click_video_editor, imd->image_fd);
}
layout_image_set_buttons(lw);
image_set_drag_func(lw->image, layout_image_drag_cb, lw);
- image_attach_window(lw->image, lw->window, NULL, g_strcmp0(lw->options.id, "main") == 0 ? GQ_APPNAME : GQ_APPNAME_LC, FALSE);
+ image_attach_window(lw->image, lw->window, NULL, GQ_APPNAME, FALSE);
- /* do not hilight selected image in SPLIT_NONE */
- /* maybe the image should be selected always and hilight should be controled by
+ /* do not highlight selected image in SPLIT_NONE */
+ /* maybe the image should be selected always and highlight should be controlled by
another image option */
if (lw->split_mode != SPLIT_NONE)
image_select(lw->split_images[i], TRUE);