From: Colin Clark Date: Tue, 26 Mar 2024 17:17:00 +0000 (+0000) Subject: Fix #1241: 'Go to directory view' uses hard-coded default values X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=787f3dd15fb68da16e5a9b88774a26ffb99450e9 Fix #1241: 'Go to directory view' uses hard-coded default values https://github.com/BestImageViewer/geeqie/issues/1241 If the image is already displayed, bring that window to the top. If not, a new layout window is opened using the values set by the user in Edit/Preferences/Windows/Use Current Layout For Default. If this option has not been set, use the fixed default values. --- diff --git a/src/img-view.cc b/src/img-view.cc index 677fd403..e9e15d8d 100644 --- a/src/img-view.cc +++ b/src/img-view.cc @@ -1333,8 +1333,7 @@ static LayoutWindow *view_new_layout_with_fd(FileData *fd) { LayoutWindow *nw; - nw = layout_new(nullptr, nullptr); - layout_sort_set_files(nw, nw->options.file_view_list_sort.method, nw->options.file_view_list_sort.ascend, nw->options.file_view_list_sort.case_sensitive); + nw = layout_new_from_default(); layout_set_fd(nw, fd); return nw; } @@ -1352,9 +1351,15 @@ static void view_set_layout_path_cb(GtkWidget *, gpointer data) lw = layout_find_by_image_fd(imd); if (lw) + { layout_set_fd(lw, imd->image_fd); + gtk_window_present(GTK_WINDOW(lw->window)); + } else + { view_new_layout_with_fd(imd->image_fd); + } + view_window_close(vw); }