| 114 | // } |
| 115 | |
| 116 | void ThemesWidget::setFixedMode() { |
| 117 | // resize the widget to show three items only |
| 118 | int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); |
| 119 | QFont font; |
| 120 | QFontMetrics fm(font); |
| 121 | static const int themeIconSize = std::ceil(3.0 / GSL_CONST_CGS_INCH * QApplication::primaryScreen()->physicalDotsPerInchX()); |
| 122 | QSize widgetSize(themeIconSize + style()->pixelMetric(QStyle::PM_ScrollBarExtent) + frameWidth * 2, |
| 123 | 3 * (themeIconSize + fm.height() + 2 * frameWidth) + fm.height() + frameWidth); |
| 124 | setMinimumSize(widgetSize); |
| 125 | setMaximumSize(widgetSize); |
| 126 | } |