diff --git a/CMakeLists.txt b/CMakeLists.txt index a0bd6e92b..4910a56d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,6 +368,8 @@ if(NOT DEFINED ICONSDIR) else() set(ICONSDIR "${CMAKE_INSTALL_PREFIX}/share/icons") endif() + else() + set(ICONSDIR "${DATADIR}/icons") endif() endif() diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index 6a1168fa4..25cfd0ae3 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -314,8 +314,10 @@ void DirBrowser::row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk:: expandSuccess = true; - // Update row icon - iter->set_value(dtColumns.icon_name, openfolder); + // Update row icon (only if row icon is not a volume one or is empty) + if (iter->get_value(dtColumns.icon_name) == closedfolder || iter->get_value(dtColumns.icon_name) == "") { + iter->set_value(dtColumns.icon_name, openfolder); + } Glib::RefPtr monitor = dir->monitor_directory (); iter->set_value (dtColumns.monitor, monitor); @@ -324,8 +326,10 @@ void DirBrowser::row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk:: void DirBrowser::row_collapsed (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path) { - // Update row icon - iter->set_value(dtColumns.icon_name, closedfolder); + // Update row icon (only if row icon is not a volume one) + if (iter->get_value(dtColumns.icon_name) == openfolder) { + iter->set_value(dtColumns.icon_name, closedfolder); + } } void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter) diff --git a/rtgui/rtscalable.h b/rtgui/rtscalable.h index f78c3bf3d..e96fdddfc 100644 --- a/rtgui/rtscalable.h +++ b/rtgui/rtscalable.h @@ -30,9 +30,7 @@ * * About Pango size convention (for font): * Pango size can be expressed in two different units: - * - Absolute size (i.e. "px"): If size is int type, absolute size is given in "Pango unit" - * shall be divided by Pango::SCALE (i.e. 1024) to get "px". If size is double, absolute - * is already given in "px". + * - Absolute size (i.e. "px") * - Non-absolute size (i.e. "pt"): The default resolution is 72 DPI (i.e. pt per inch). To * convert the size to "px", use the following formula: * "size in px" = "size in pt" * ("device resolution" / 72) * "device scale" diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index fede08a9a..11d4087f3 100755 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -195,14 +195,14 @@ RTWindow::RTWindow () Pango::FontDescription pfd = style->get_font(Gtk::STATE_FLAG_NORMAL); if (pfd.get_set_fields() & Pango::FONT_MASK_SIZE) { - const int fontSize = pfd.get_size(); + int fontSize = pfd.get_size(); const bool isAbsoluteFontSize = pfd.get_size_is_absolute(); int newFontSize; if (isAbsoluteFontSize) { // Absolute size is defined in "Pango units" and shall be divided by // Pango::SCALE to get "px" - newFontSize = fontSize / Pango::SCALE; + fontSize = fontSize / Pango::SCALE; #ifndef __APPLE__ // Guessing that pixel size is given for a 96 DPI reference: @@ -213,12 +213,16 @@ RTWindow::RTWindow () // Refer to https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/quartz/gdkscreen-quartz.c const double newFontScale = 1.; #endif - newFontSize = static_cast(newFontSize * newFontScale + 0.5); + newFontSize = static_cast(fontSize * newFontScale + 0.5); if (rtengine::settings->verbose) { printf("\"Default\" absolute font size(%d)\n", newFontSize); } } else { + // Non-absolute size is defined in "Pango units" and shall be divided by + // Pango::SCALE to get "px" + fontSize = fontSize / Pango::SCALE; + // Non-absolute size is defined in "pt" and shall be converted to "px" newFontSize = static_cast(fontSize * fontScale + 0.5); diff --git a/rtgui/shcselector.cc b/rtgui/shcselector.cc index dc7e06936..132a5f1ef 100644 --- a/rtgui/shcselector.cc +++ b/rtgui/shcselector.cc @@ -195,8 +195,7 @@ void SHCSelector::updateBackBuffer() // update font fontd.set_weight (Pango::WEIGHT_NORMAL); - // Absolute size is defined in "Pango units" and shall be multiplied by - // Pango::SCALE from "px" + const double fontSize = static_cast(h) * 0.8; // pt // Converting font size to "px" based on DPI and scale #ifndef __APPLE__