From 100c940a63ccf7cb0b7d7232f8e8992e77a4f0b3 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 5 Aug 2013 15:46:36 +0200 Subject: [PATCH] propagate size hints from compact representation --- .../desktop/contents/applet/CompactApplet.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/applet/CompactApplet.qml b/src/shell/qmlpackages/desktop/contents/applet/CompactApplet.qml index fe6346b0c..18200304e 100644 --- a/src/shell/qmlpackages/desktop/contents/applet/CompactApplet.qml +++ b/src/shell/qmlpackages/desktop/contents/applet/CompactApplet.qml @@ -25,10 +25,20 @@ import org.kde.plasma.components 2.0 as PlasmaComponents Item { id: root + property int minimumWidth: compactRepresentation && compactRepresentation.minimumWidth !== undefined ? compactRepresentation.minimumWidth : -1 + property int minimumHeight: compactRepresentation && compactRepresentation.minimumHeight !== undefined ? compactRepresentation.minimumHeight : -1 + + property int maximumWidth: compactRepresentation && compactRepresentation.maximumWidth !== undefined ? compactRepresentation.maximumWidth : -1 + property int maximumHeight: compactRepresentation && compactRepresentation.maximumHeight !== undefined ? compactRepresentation.maximumHeight : -1 + + property int implicitWidth: compactRepresentation && compactRepresentation.implicitWidth !== undefined ? compactRepresentation.implicitWidth : -1 + property int implicitHeight: compactRepresentation && compactRepresentation.implicitHeight !== undefined ? compactRepresentation.implicitHeight : -1 + + + property Item applet property Item compactRepresentation - onAppletChanged: { applet.parent = appletParent applet.anchors.fill = applet.parent @@ -48,7 +58,7 @@ Item { mainItem: Item { id: appletParent - width: applet && applet.implicitWidth > 0 ? applet.implicitWidth : theme.mSize(theme.defaultFont).width * 35 + width: applet && applet.implicitHeight > 0 ? applet.implicitHeight : theme.mSize(theme.defaultFont).width * 35 height: applet && applet.implicitHeight > 0 ? applet.implicitHeight : theme.mSize(theme.defaultFont).height * 25 onWidthChanged: applet.width = width onHeightChanged: applet.height = height