From 6f3ba5731451e359e0016da62b8abd79d6c06a64 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 20 Oct 2015 22:00:15 -0400 Subject: [PATCH] fixed up default sizes for list icons and main page icons for high DPI screens --- .../src/gui/settings/rsharesettings.cpp | 61 ++++++++----------- .../src/gui/settings/rsharesettings.h | 5 +- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp index 83fbf0563..b7cf16f01 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.cpp +++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp @@ -20,6 +20,7 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ +#include #include #include #include @@ -237,26 +238,32 @@ void RshareSettings::setToolButtonStyle(Qt::ToolButtonStyle style) } } +int RshareSettings::computeBestIconSize(int n_sizes,int *sizes,int recommended_size) +{ + float default_size = QFontMetricsF(QWidget().font()).height()/16.0 * recommended_size ; + float closest_ratio_dist = 10000.0f ; + int best_default_size = sizes[0] ; + + for(int i=0;i