Merge branch 'dev' into release-5.6

This commit is contained in:
Morgan Hardwood 2019-04-17 14:10:24 +02:00
commit 4fb80826d0
18 changed files with 127 additions and 88 deletions

View File

@ -1036,6 +1036,7 @@ PREFERENCES_APPEARANCE_COLORPICKERFONT;Police des ancres de vérification couleu
PREFERENCES_APPEARANCE_CROPMASKCOLOR;Couleur du masque de recadrage
PREFERENCES_APPEARANCE_MAINFONT;Police principale
PREFERENCES_APPEARANCE_NAVGUIDECOLOR;Couleur du cadre dans le Navigateur
PREFERENCES_APPEARANCE_PSEUDOHIDPI;Mode pseudo-HiDPI
PREFERENCES_APPEARANCE_THEME;Thème
PREFERENCES_APPLNEXTSTARTUP;appliqué au prochain lancement
PREFERENCES_AUTOMONPROFILE;Utiliser automatiquement le profil de l'écran principal

View File

@ -1039,6 +1039,7 @@ PREFERENCES_APPEARANCE_COLORPICKERFONT;Color picker font
PREFERENCES_APPEARANCE_CROPMASKCOLOR;Crop mask color
PREFERENCES_APPEARANCE_MAINFONT;Main font
PREFERENCES_APPEARANCE_NAVGUIDECOLOR;Navigator guide color
PREFERENCES_APPEARANCE_PSEUDOHIDPI;Pseudo-HiDPI mode
PREFERENCES_APPEARANCE_THEME;Theme
PREFERENCES_APPLNEXTSTARTUP;restart required
PREFERENCES_AUTOMONPROFILE;Use operating system's main monitor color profile

View File

@ -1225,11 +1225,12 @@ dialog frame > label:not(.dummy) {
border-top-width: 0.083333333333333333em;
}
#Navigator {
padding-top: 0.75em;
padding-top: 0.25em;
padding-bottom: 0.25em;
}
#Navigator label {
padding: 0;
margin: 0.083333333333333333em 0;
}
/*** PartialPaste ******************************************************************************/

View File

@ -2,7 +2,7 @@
This file is part of RawTherapee.
Copyright (c) 2016-2019 TooWaBoo
Version 3.05
Version 3.06
RawTherapee is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -163,7 +163,7 @@ undershoot {
label {
padding: 0.083333333333333333em 0;
margin: 0.19em;
margin: 0.125em 0.166666666666666666em;
min-height: 1.333333333333333333em;
}
@ -1341,7 +1341,7 @@ button,
#BeforeAfterContainer button {
min-height: 1.666666666666666666em;
min-width: 1.666666666666666666em;/*x*/
margin: 0.19em;
margin: 0.125em;
border-radius: 0.2em;
border: 0.083333333333333333em solid @bg-button-border;
background-color: transparent;
@ -1414,7 +1414,7 @@ combobox entry.combo + button.combo {
}
#WB-Size-Helper {
min-width: 3.5em;
margin: 0.19em;
margin: 0.125em;
}
combobox arrow {
@ -1536,9 +1536,9 @@ messagedialog .dialog-action-area button:not(:only-child):nth-child(2) {
#RightNotebook > stack > scrolledwindow:last-child button.image-button, /* Fast Export */
#MetaPanelNotebook scrolledwindow + grid > button,
#MetaPanelNotebook scrolledwindow + grid + grid > button {
min-height: 2.5em;
min-width: 2.5em;
margin: 0 0.19em;
min-height: 2.333333333333333333em;
min-width: 2.333333333333333333em;
margin: 0 0.125em;
}
#ToolBarPanelFileBrowser > button:first-child,
#EditorTopPanel > button:first-child,
@ -1558,39 +1558,35 @@ messagedialog .dialog-action-area button:not(:only-child):nth-child(2) {
#MyExpander button.independent.toggle:not(.image-button):not(.text-button):first-child:only-child, /* Graduated filter button */
#MetaPanelNotebook scrolledwindow + grid > button,
#MetaPanelNotebook scrolledwindow + grid + grid > button {
margin: 0.19em;
margin: 0.125em;
}
#EditorTopPanel button.narrowbutton {
min-width: 0.833333333333333333em;
padding: 0 0.166666666666666666em;
min-width: 0;
padding: 0 0.13em;
}
/* Image close button */
#MainNotebook > header tab #CloseButton {
padding: 0;
margin: 0.333333333333333333em 0 0.416666666666666666em 0.19em;
min-width: 1.5em;
padding: 0.166666666666666666em;
margin: 0.333333333333333333em 0 0.5em 0.19em;
min-width: 0;
min-height: 0;
}
#MainNotebook > header tab #CloseButton image{
min-width: 1.333333333333333333em;
min-height: 1.333333333333333333em;
}
/* Filter buttons*/
#ToolBarPanelFileBrowser .smallbuttonbox {
min-height: 1.333333333333333333em;
min-height: 0;
padding: 0;
margin: 0;
}
#ToolBarPanelFileBrowser .smallbuttonbox:nth-child(2) {
margin: 0.083333333333333333em 0 -0.166666666666666666em;
margin-top: 0.12em;
}
#ToolBarPanelFileBrowser .smallbuttonbox button.smallbutton image {
margin: -0.19em;
min-width: 1.333333333333333333em;
min-height: 1.333333333333333333em;
margin: -0.12em;
min-width: 0;
min-height: 0;
}
#ToolBarPanelFileBrowser .smallbuttonbox button.smallbutton {
min-height: 0;
@ -1806,7 +1802,7 @@ popover button.text-button:active {
checkbutton,
radiobutton {
padding: 0.083333333333333333em 0;
margin: 0.19em;
margin: 0.125em;
min-height: 1.666666666666666666em;/*x*/
}
@ -1847,10 +1843,10 @@ frame > checkbutton check{
#PartialPaste checkbutton {
padding: 0;
margin: 0.19em 0 0 0.583333333333333333em;
margin: 0 0 0 0.583333333333333333em;
}
#PartialPaste checkbutton:not(#PartialPasteHeader) {
margin: 0 0 0 1.166666666666666666em;
margin: 0 0 0 1.125em;
}
/*** end ***************************************************************************************/
@ -1859,7 +1855,7 @@ frame > checkbutton check{
#MyExpander entry,
entry,
spinbutton {
margin: 0.19em;
margin: 0.125em;
padding: 0 0.333333333333333333em;
min-height: 1.666666666666666666em;/*x*/
min-width: 0;
@ -1891,7 +1887,7 @@ spinbutton {
}
#MyExpander spinbutton {
margin: 0.19em;
margin: 0.125em;
padding: 0;
min-height: 1.333333333333333333em;
min-width: 0;
@ -1904,12 +1900,12 @@ spinbutton {
}
/* Needed for Reset & and Auto button height*/
#MyExpander button + label + spinbutton {
margin-top: 0.333333333333333333em;
margin-bottom: 0.333333333333333333em;
margin-top: 0.25em;
margin-bottom: 0.25em;
}
#MyExpander checkbutton + label + spinbutton {
margin-top: 0.416666666666666666em;
margin-bottom: 0.416666666666666666em;
margin-top: 0.333333333333333333em;
margin-bottom: 0.333333333333333333em;
}
/**/

View File

@ -297,7 +297,7 @@ window.csd:not(.fullscreen) #MainNotebook > header.top {
#MyExpander image {
min-width: 1.333333333333333333em;
min-height: 0;
margin: -0.083333333333333333em 0.19em;
margin: -0.083333333333333333em 0.125em;
}
#MyExpander .drawingarea:not(.slider) {
@ -456,7 +456,7 @@ button,
#BeforeAfterContainer button {
min-height: 1.666666666666666666em;
min-width: 1.666666666666666666em;/*x*/
margin: 0.19em;
margin: 0.125em;
border-radius: 0.2em;
border-width: 0.083333333333333333em;
}
@ -482,7 +482,7 @@ combobox entry.combo + button.combo {
}
#WB-Size-Helper {
min-width: 3.5em;
margin: 0.19em;
margin: 0.125em;
}
combobox arrow {
@ -570,7 +570,7 @@ colorchooser colorswatch#add-color-button:first-child {
button.font label{
min-height: 0;
min-width: 0;
margin: 0 0.19em;
margin: 0 0.125em;
}
/* Save, Cancel, OK ... buttons */
@ -603,9 +603,9 @@ messagedialog .dialog-action-area button:not(:only-child):nth-child(2) {
#RightNotebook > stack > scrolledwindow:last-child button.image-button, /* Fast Export */
#MetaPanelNotebook scrolledwindow + grid > button,
#MetaPanelNotebook scrolledwindow + grid + grid > button {
min-height: 2.5em;
min-width: 2.5em;
margin: 0 0.19em;
min-height: 2.333333333333333333em;
min-width: 2.333333333333333333em;
margin: 0 0.125em;
}
#ToolBarPanelFileBrowser > button:first-child,
#EditorTopPanel > button:first-child,
@ -625,12 +625,12 @@ messagedialog .dialog-action-area button:not(:only-child):nth-child(2) {
#MyExpander button.independent.toggle:not(.image-button):not(.text-button):first-child:only-child, /* Graduated filter button */
#MetaPanelNotebook scrolledwindow + grid > button,
#MetaPanelNotebook scrolledwindow + grid + grid > button {
margin: 0.19em;
margin: 0.125em;
}
#EditorTopPanel button.narrowbutton {
min-width: 0.833333333333333333em;
padding: 0 0.166666666666666666em;
padding: 0 0.13em;
}
/* Image close button */
@ -647,21 +647,21 @@ messagedialog .dialog-action-area button:not(:only-child):nth-child(2) {
/* Filter buttons*/
#ToolBarPanelFileBrowser .smallbuttonbox {
min-height: 1.333333333333333333em;
min-height: 0;
padding: 0;
margin: 0;
}
#ToolBarPanelFileBrowser .smallbuttonbox:nth-child(2) {
margin: 0.083333333333333333em 0 -0.166666666666666666em;
margin: 0 0 -0.166666666666666666em;
}
#ToolBarPanelFileBrowser .smallbuttonbox button.smallbutton image {
margin: -0.19em;
min-width: 1.333333333333333333em;
min-height: 1.333333333333333333em;
margin: -0.166666666666666666em;
min-width: 0;
min-height: 0;
}
#ToolBarPanelFileBrowser .smallbuttonbox button.smallbutton {
min-height: 0;
min-width: 1.333333333333333333em;
min-width: 1.166666666666666666em;
padding: 0;
margin: 0 0.25em;
border: none;
@ -686,7 +686,7 @@ messagedialog .dialog-action-area button:not(:only-child):nth-child(2) {
#MyExpander .image-combo button.Left {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
min-width: 2.5em;
min-width: 2.333333333333333333em;
margin-right: 0;
}
#MyExpander .image-combo button.Left {
@ -820,7 +820,7 @@ button.text-button {
checkbutton,
radiobutton {
padding: 0.083333333333333333em 0;
margin: 0.19em;
margin: 0.125em;
min-height: 1.666666666666666666em;/*x*/
}
@ -852,7 +852,7 @@ frame > checkbutton check{
#PartialPaste checkbutton {
padding: 0;
margin: 0.19em 0 0 0.583333333333333333em;
margin: 0.125em 0 0 0.583333333333333333em;
}
#PartialPaste checkbutton:not(#PartialPasteHeader) {
margin: 0 0 0 1.166666666666666666em;
@ -864,7 +864,7 @@ frame > checkbutton check{
#MyExpander entry,
entry,
spinbutton {
margin: 0.19em;
margin: 0.125em;
padding: 0 0.333333333333333333em;
min-height: 1.666666666666666666em;/*x*/
min-width: 0;
@ -894,7 +894,7 @@ spinbutton {
}
#MyExpander spinbutton {
margin: 0.19em;
margin: 0.125em;
padding: 0;
min-height: 1.333333333333333333em;
min-width: 0;

View File

@ -234,7 +234,8 @@ else()
)
endif()
if(OPENMP_FOUND AND NOT APPLE)
# Excluding libatomic needed by Clang/FreeBSD, #3636
if(OPENMP_FOUND AND NOT APPLE AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
set(EXTRA_LIB_RTGUI ${EXTRA_LIB_RTGUI} "atomic")
endif()

View File

@ -56,7 +56,7 @@ void CursorManager::init (Glib::RefPtr<Gdk::Window> mainWindow)
Glib::RefPtr<Gdk::Pixbuf> rotate = RTImage::createPixbufFromFile("rotate-aroundnode-hicontrast.png");
Glib::RefPtr<Gdk::Pixbuf> wait = RTImage::createPixbufFromFile("gears.png"); // Currently unused, create *-hicontrast once used.
double s = RTScalable::getTweakedDPI() / 96.; // RTScalable::getDPI() might be preferable, however it imply a lot of work to support this option
double s = RTScalable::getTweakedDPI() / RTScalable::baseDPI; // RTScalable::getDPI() might be preferable, however it imply a lot of work to support this option
cAdd = add ? Gdk::Cursor::create(display, add, (int)(8.*s), (int)(8.*s)) : Gdk::Cursor::create(display, Gdk::PLUS);
cAddPicker = colPickAdd ? Gdk::Cursor::create(display, colPickAdd, (int)(4.*s), (int)(21.*s)) : Gdk::Cursor::create(display, Gdk::PLUS);

View File

@ -51,7 +51,7 @@ EditWindow* EditWindow::getInstance(RTWindow* p, bool restore)
return &instance_.editWnd;
}
EditWindow::EditWindow (RTWindow* p) : resolution(96.), parent(p) , isFullscreen(false), isClosed(true)
EditWindow::EditWindow (RTWindow* p) : resolution(RTScalable::baseDPI), parent(p) , isFullscreen(false), isClosed(true)
{
updateResolution();
@ -128,7 +128,7 @@ bool EditWindow::updateResolution()
double res = get_screen()->get_resolution();
if (scale == 2) {
// from Windows' behavior : if scale==2, resolution = 192. (Gtk shows 96 dpi !?), there's no higher value
res = 192.;
res = RTScalable::baseHiDPI;
}
bool retVal = res != resolution;
resolution = res;
@ -141,11 +141,11 @@ void EditWindow::setAppIcon()
bool downsize = false;
// findIconAbsolutePath won't be able to select the image based on resolution with the
// storage of the images, we're doing the selection here
if (resolution == 96.) {
if (resolution == RTScalable::baseDPI) {
fName = "rawtherapee-logo-24.png";
} else {
fName = "rawtherapee-logo-48.png";
if (resolution < 192.) {
if (resolution < RTScalable::baseHiDPI) {
downsize = true;
}
}
@ -155,7 +155,7 @@ void EditWindow::setAppIcon()
return;
}
if (downsize) {
int size = int((48. * resolution) / 192.);
int size = int((48. * resolution) / RTScalable::baseHiDPI);
pixbuf->scale_simple(size, size, Gdk::InterpType::INTERP_BILINEAR);
}

View File

@ -375,14 +375,6 @@ int main (int argc, char **argv)
Glib::init(); // called by Gtk::Main, but this may be important for thread handling, so we call it ourselves now
Gio::init ();
// Reading/updating GDK_SCALE early if it exists
const gchar *gscale = g_getenv("GDK_SCALE");
if (gscale && gscale[0] == '2') {
initialGdkScale = 2;
}
// HOMBRE: On Windows, if resolution is set to 200%, Gtk internal variables are SCALE=2 and DPI=96
g_setenv("GDK_SCALE", "1", true);
#ifdef WIN32
if (GetFileType (GetStdHandle (STD_OUTPUT_HANDLE)) == 0x0003) {
// started from msys2 console => do not buffer stdout
@ -536,6 +528,16 @@ int main (int argc, char **argv)
int ret = 0;
if (options.pseudoHiDPISupport) {
// Reading/updating GDK_SCALE early if it exists
const gchar *gscale = g_getenv("GDK_SCALE");
if (gscale && gscale[0] == '2') {
initialGdkScale = 2;
}
// HOMBRE: On Windows, if resolution is set to 200%, Gtk internal variables are SCALE=2 and DPI=96
g_setenv("GDK_SCALE", "1", true);
}
gdk_threads_set_lock_functions (G_CALLBACK (myGdkLockEnter), (G_CALLBACK (myGdkLockLeave)));
gdk_threads_init();
gtk_init (&argc, &argv); // use the "--g-fatal-warnings" command line flag to make warnings fatal

View File

@ -345,6 +345,7 @@ void Options::setDefaults()
fontSize = 10;
CPFontFamily = "default";
CPFontSize = 8;
pseudoHiDPISupport = false;
lastScale = 5;
lastShowAllExif = false;
panAccelFactor = 5;
@ -1252,6 +1253,10 @@ void Options::readFromFile(Glib::ustring fname)
CPFontSize = keyFile.get_integer("GUI", "CPFontSize");
}
if (keyFile.has_key("GUI", "PseudoHiDPISupport")) {
pseudoHiDPISupport = keyFile.get_boolean("GUI", "PseudoHiDPISupport");
}
if (keyFile.has_key("GUI", "LastPreviewScale")) {
lastScale = keyFile.get_integer("GUI", "LastPreviewScale");
}
@ -2062,6 +2067,7 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_integer("GUI", "FontSize", fontSize);
keyFile.set_string("GUI", "CPFontFamily", CPFontFamily);
keyFile.set_integer("GUI", "CPFontSize", CPFontSize);
keyFile.set_boolean("GUI", "PseudoHiDPISupport", pseudoHiDPISupport);
keyFile.set_integer("GUI", "LastPreviewScale", lastScale);
keyFile.set_boolean("GUI", "LastShowAllExif", lastShowAllExif);
keyFile.set_integer("GUI", "PanAccelFactor", panAccelFactor);

View File

@ -212,6 +212,7 @@ public:
int fontSize; // RT's main font size (units: pt)
Glib::ustring CPFontFamily; // ColorPicker font family
int CPFontSize; // ColorPicker font size (units: pt)
bool pseudoHiDPISupport;
bool fbOnlyRaw;
bool fbShowDateTime;
bool fbShowBasicExif;

View File

@ -1048,12 +1048,15 @@ Gtk::Widget* Preferences::getGeneralPanel ()
navGuideColorCB = Gtk::manage(new Gtk::ColorButton());
navGuideColorCB->set_use_alpha(true);
pseudoHiDPI = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_APPEARANCE_PSEUDOHIDPI") + Glib::ustring (" (") + M ("PREFERENCES_APPLNEXTSTARTUP") + ")"));
setExpandAlignProperties(pseudoHiDPI, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
Gtk::VSeparator *vSep = Gtk::manage(new Gtk::VSeparator());
appearanceGrid->attach(*themeLbl, 0, 0, 1, 1);
appearanceGrid->attach(*themeCBT, 1, 0, 1, 1);
appearanceGrid->attach(*themeRestartLbl, 2, 0, 2, 1);
appearanceGrid->attach(*vSep, 2, 1, 1, 3);
appearanceGrid->attach(*vSep, 2, 1, 1, 2);
appearanceGrid->attach(*mainFontLbl, 0, 1, 1, 1);
appearanceGrid->attach(*mainFontFB, 1, 1, 1, 1);
appearanceGrid->attach(*cropMaskColorLbl, 3, 1, 1, 1);
@ -1062,6 +1065,7 @@ Gtk::Widget* Preferences::getGeneralPanel ()
appearanceGrid->attach(*colorPickerFontFB, 1, 2, 1, 1);
appearanceGrid->attach(*navGuideColorLbl, 3, 2, 1, 1);
appearanceGrid->attach(*navGuideColorCB, 4, 2, 1, 1);
appearanceGrid->attach(*pseudoHiDPI, 0, 3, 5, 1);
appearanceFrame->add(*appearanceGrid);
vbGeneral->attach_next_to(*appearanceFrame, *flang, Gtk::POS_BOTTOM, 2, 1);
@ -1642,6 +1646,8 @@ void Preferences::storePreferences ()
moptions.CPFontSize = cpfd.get_size() / Pango::SCALE;
}
moptions.pseudoHiDPISupport = pseudoHiDPI->get_active();
#ifdef WIN32
moptions.gimpDir = gimpDir->get_filename ();
moptions.psDir = psDir->get_filename ();
@ -1906,6 +1912,8 @@ void Preferences::fillPreferences ()
colorPickerFontFB->set_font_name (Glib::ustring::compose ("%1 %2", options.CPFontFamily, options.CPFontSize));
}
pseudoHiDPI->set_active(options.pseudoHiDPISupport);
showDateTime->set_active (moptions.fbShowDateTime);
showBasicExif->set_active (moptions.fbShowBasicExif);
showExpComp->set_active (moptions.fbShowExpComp);

View File

@ -145,6 +145,8 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener
Gtk::FontButton* colorPickerFontFB;
Gtk::ColorButton* cropMaskColorCB;
Gtk::ColorButton* navGuideColorCB;
Gtk::CheckButton* pseudoHiDPI;
Gtk::SpinButton* maxRecentFolders;
Gtk::SpinButton* maxThumbHeightSB;

View File

@ -120,6 +120,10 @@ void RTImage::changeImage (const Glib::ustring& imageName)
{
clear ();
if (imageName.empty()) {
return;
}
if (pixbuf) {
auto iterator = pixbufCache.find (imageName);
assert(iterator != pixbufCache.end ());
@ -169,6 +173,17 @@ void RTImage::init()
scaleBack = RTScalable::getScale();
}
void RTImage::cleanup()
{
for (auto& entry : pixbufCache) {
entry.second.reset();
}
for (auto& entry : surfaceCache) {
entry.second.clear();
}
RTScalable::cleanup();
}
void RTImage::updateImages()
{
for (auto& entry : pixbufCache) {

View File

@ -52,6 +52,7 @@ public:
static void init();
static void cleanup();
static void updateImages ();
static void setDPInScale (const double newDPI, const int newScale);
static void setScale (const int newScale);

View File

@ -36,6 +36,12 @@ Gtk::TextDirection RTScalable::direction = Gtk::TextDirection::TEXT_DIR_NONE;
void RTScalable::setDPInScale (const double newDPI, const int newScale)
{
if (!options.pseudoHiDPISupport) {
scale = 1;
dpi = baseDPI;
return;
}
if (scale != newScale || (scale == 1 && dpi != newDPI)) {
// reload all images
scale = newScale;
@ -225,7 +231,7 @@ Cairo::RefPtr<Cairo::ImageSurface> RTScalable::loadImage(const Glib::ustring &fn
RsvgDimensionData dim;
rsvg_handle_get_dimensions(handle, &dim);
double r = dpi / 96.;
double r = dpi / baseDPI;
Cairo::RefPtr<Cairo::ImageSurface> surf = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, (int)(dim.width * r + 0.499), (int)(dim.height * r + 0.499));
Cairo::RefPtr<Cairo::Context> c = Cairo::Context::create(surf);
c->set_source_rgba (0., 0., 0., 0.);

View File

@ -40,11 +40,13 @@ protected:
public:
#ifdef __APPLE__
static constexpr double baseDPI = 72;
static constexpr double baseHiDPI = 144;
static constexpr double baseDPI = 72.;
static constexpr double baseHiDPI = 144.;
static constexpr int baseFontSize = 12;
#else
static constexpr double baseDPI = 96;
static constexpr double baseHiDPI = 192;
static constexpr double baseDPI = 96.;
static constexpr double baseHiDPI = 192.;
static constexpr int baseFontSize = 9;
#endif
static void init(Gtk::Window *window);

View File

@ -106,12 +106,6 @@ RTWindow::RTWindow ()
Gtk::Settings::get_for_screen (screen)->property_gtk_theme_name() = "Adwaita";
Gtk::Settings::get_for_screen (screen)->property_gtk_application_prefer_dark_theme() = true;
#if defined(__APPLE__)
// This will force screen resolution regarding font, but I don't think it's compliant with Gtk guidelines...
// Do not confuse with screen scaling, where everything is scaled up !
screen->set_resolution (96.);
#endif
Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create (THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS);
Glib::ustring filename;
Glib::MatchInfo mInfo;
@ -170,7 +164,9 @@ RTWindow::RTWindow ()
css = Glib::ustring::compose ("* { font-family: %1; font-size: %2pt}", options.fontFamily, options.fontSize * (int)initialGdkScale);
#endif
//GTK318
fontScale = options.fontSize / 9.f;
if (options.pseudoHiDPISupport) {
fontScale = options.fontSize / (float)RTScalable::baseFontSize;
}
if (options.rtSettings.verbose) {
printf("\"Non-Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", options.fontSize, (int)initialGdkScale, fontScale);
}
@ -184,27 +180,27 @@ RTWindow::RTWindow ()
int resolution = (int)style->get_screen()->get_resolution();
if (isPix) {
// HOMBRE: guessing here...
// if resolution is lower than 192ppi, we're supposing that it's already expressed in a scale==1 scenario
// if resolution is lower than baseHiDPI, we're supposing that it's already expressed in a scale==1 scenario
if (resolution >= int(RTScalable::baseHiDPI)) {
// converting the resolution to a scale==1 scenario
resolution /= 2;
}
// 1pt = 1/72in @ 96 ppi
// HOMBRE: If the font unit is px, is it already scaled up to match the resolution ?
// px >inch >pt >"scaled pt"
pt = (int)(double(fontSize) / RTScalable::baseDPI * 72. * (RTScalable::baseHiDPI / resolution) + 0.49);
// px >inch >pt >"scaled pt"
pt = (int)(double(fontSize) / RTScalable::baseDPI * 72. * (96. / (double)resolution) + 0.49);
} else {
pt = fontSize / Pango::SCALE;
}
fontScale = (float)pt / 9.f;
if ((int)initialGdkScale > 1 || pt != 9) {
if (options.pseudoHiDPISupport) {
fontScale = (float)pt / (float)RTScalable::baseFontSize;
}
if ((int)initialGdkScale > 1 || pt != RTScalable::baseFontSize) {
css = Glib::ustring::compose ("* { font-size: %1pt}", pt * (int)initialGdkScale);
if (options.rtSettings.verbose) {
printf("\"Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", pt, (int)initialGdkScale, fontScale);
}
}
} else {
fontScale = 1.f;
}
}
if (!css.empty()) {
@ -463,7 +459,7 @@ RTWindow::~RTWindow()
delete fpanel;
}
RTScalable::cleanup();
RTImage::cleanup();
}
void RTWindow::on_realize ()