From a5a4b876dee8268083f7e186f084e6662ea5bddb Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 1 Aug 2018 17:31:40 +0300 Subject: [PATCH] improve dock settings windows geometry calculation --the dock settings window calculations should not look different between different font settings/geometries/screens. One way to overcome that issue is by using the font.height to calculate the settings height, that is 37chars for now and the width to be calculated in accordance with that height. There are some down limits for both, height shouldnt overcome screens height and shouldnt go under 400px and the width can not be less than 200px CCBUG: 397038 --- .../configuration/LatteDockConfiguration.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index c74624a4f..1a62c50d6 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -40,11 +40,12 @@ import "../controls" as LatteExtraControls FocusScope { id: dialog - property int maxWidth: Math.max(34 * theme.defaultFont.pixelSize, 0.85 * height) + property int maxWidth: Math.max(200, 0.87 * proposedHeight) + property int proposedHeight: Math.min(dock.screenGeometry.height - dock.normalThickness - 2*units.largeSpacing, + Math.max(400, 37 * theme.mSize(theme.defaultFont).height)) + width: maxWidth + units.smallSpacing * 2 - height: Math.min(content.height + units.smallSpacing * 2, - dock.screenGeometry.height - dock.normalThickness - 2*units.largeSpacing) - //! for small resolutions we better limit the size of the settings in order to be shown properly + height: proposedHeight Layout.minimumWidth: width Layout.minimumHeight: height @@ -361,10 +362,7 @@ FocusScope { border.color: theme.backgroundColor //fix the height binding loop when showing the configuration window - - property int availableFreeHeight: Math.min(29*theme.mSize(theme.defaultFont).height + units.smallSpacing * 2, //calculatios according to font size - dock.screenGeometry.height - dock.normalThickness - 2*units.largeSpacing - header.height - headerSpacer.height - - tabBar.height - actionButtons.height - 36) //calculations according to screen geometry and elements heights + property int availableFreeHeight: dialog.proposedHeight - header.height - headerSpacer.height - tabBar.height - actionButtons.height - 2 * units.smallSpacing PlasmaExtras.ScrollArea { id: scrollArea