From 23be310029290582bb81c1a23aab0d521eef8b7b Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Sat, 29 Apr 2023 11:06:58 +0200 Subject: [PATCH] Fixes issues following merge with 'dev' - External Editor: App icon not correctly managed in RTImage - Favorite preferences: Fixes widget sizes - Other fix: With some versions of Glib/Glibmm library on MacOS, Glib::KeyFile "load_from_file" function does not raise a Glib::Error but another exception. This causes crash opening preferences panel due to missing dynamic profiles configuration --- rtengine/dynamicprofile.cc | 6 +++++- rtgui/externaleditorpreferences.cc | 4 ++-- rtgui/rtimage.cc | 2 +- rtgui/toollocationpref.cc | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rtengine/dynamicprofile.cc b/rtengine/dynamicprofile.cc index 6dbd2d0f0..2fa03f2ed 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include "rtengine.h" #include "../rtgui/options.h" @@ -173,9 +174,12 @@ bool DynamicProfileRules::loadRules() { dynamicRules.clear(); Glib::KeyFile kf; + const Glib::ustring fileName = Glib::build_filename (Options::rtdir, "dynamicprofile.cfg"); try { - if (!kf.load_from_file (Glib::build_filename (Options::rtdir, "dynamicprofile.cfg"))) { + if (Glib::file_test(fileName, Glib::FILE_TEST_EXISTS)) { + kf.load_from_file (fileName); + } else { return false; } } catch (Glib::Error &e) { diff --git a/rtgui/externaleditorpreferences.cc b/rtgui/externaleditorpreferences.cc index a1f6a2846..2f8755598 100644 --- a/rtgui/externaleditorpreferences.cc +++ b/rtgui/externaleditorpreferences.cc @@ -92,8 +92,8 @@ ExternalEditorPreferences::getEditors() const auto children = list_model->children(); for (auto rowIter = children.begin(); rowIter != children.end(); rowIter++) { - const Gio::Icon *const icon = rowIter->get_value(model_columns.icon).get(); - const auto &icon_serialized = icon == nullptr ? "" : icon->serialize().print(); + const auto icon = rowIter->get_value(model_columns.icon); + const auto &icon_serialized = !icon ? "" : icon->serialize().print(); editors.push_back(ExternalEditorPreferences::EditorInfo( rowIter->get_value(model_columns.name), rowIter->get_value(model_columns.command), diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc index 37044d1e6..9bd942c47 100644 --- a/rtgui/rtimage.cc +++ b/rtgui/rtimage.cc @@ -74,7 +74,7 @@ RTImage::RTImage (const Glib::RefPtr& gIcon, const Gtk::IconSiz Gtk::Image(), size(iconSize), icon_name(""), - g_icon(Glib::RefPtr()) + g_icon(gIcon) { // Configure RTImage based on g_icon set(this->g_icon, this->size); diff --git a/rtgui/toollocationpref.cc b/rtgui/toollocationpref.cc index f6719e918..358fe969b 100644 --- a/rtgui/toollocationpref.cc +++ b/rtgui/toollocationpref.cc @@ -734,7 +734,7 @@ ToolLocationPreference::ToolLocationPreference(Options &options) : Gtk::Box *favorites_box = Gtk::manage(new Gtk::Box()); Gtk::ScrolledWindow *favorites_list_scrolled_window = Gtk::manage(new Gtk::ScrolledWindow()); - favorites_list_scrolled_window->set_min_content_width(RTScalable::scalePixelSize(300)); + favorites_list_scrolled_window->set_min_content_width(RTScalable::scalePixelSize(400)); layout_grid->attach_next_to(*favorites_frame, Gtk::PositionType::POS_RIGHT, 1, 1); favorites_box->pack_start(impl->favoritesListEditButtons, false, false); favorites_box->pack_start(*favorites_list_scrolled_window, false, false);