widgets/cliprect: override parent's implicit size instead of wrapper

Adding implicitSize to margin wrappers broke implicit sizing
of ClippingWrapperRectangle.
This commit is contained in:
outfoxxed 2025-05-25 20:33:37 -07:00
parent 73e673ea1c
commit 7390ae28e4
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 14 additions and 9 deletions

View file

@ -14,6 +14,7 @@ qt_add_qml_module(quickshell-widgets
WrapperMouseArea.qml WrapperMouseArea.qml
WrapperRectangle.qml WrapperRectangle.qml
ClippingWrapperRectangle.qml ClippingWrapperRectangle.qml
ClippingWrapperRectangleInternal.qml
) )
qt6_add_shaders(quickshell-widgets "widgets-cliprect" qt6_add_shaders(quickshell-widgets "widgets-cliprect"

View file

@ -11,7 +11,7 @@ import QtQuick
/// > @@Item.height or @@Item.anchors on the child item, as they are used /// > @@Item.height or @@Item.anchors on the child item, as they are used
/// > by WrapperItem to position it. Instead set @@Item.implicitWidth and /// > by WrapperItem to position it. Instead set @@Item.implicitWidth and
/// > @@Item.implicitHeight. /// > @@Item.implicitHeight.
ClippingRectangle { ClippingWrapperRectangleInternal {
id: root id: root
/// The default for @@topMargin, @@bottomMargin, @@leftMargin and @@rightMargin. /// The default for @@topMargin, @@bottomMargin, @@leftMargin and @@rightMargin.
@ -54,13 +54,10 @@ ClippingRectangle {
/// See @@WrapperManager.child for details. /// See @@WrapperManager.child for details.
property alias child: manager.child property alias child: manager.child
implicitWidth: root.contentItem.implicitWidth + (root.contentInsideBorder ? root.border.width * 2 : 0) border.width: 0
implicitHeight: root.contentItem.implicitHeight + (root.contentInsideBorder ? root.border.width * 2 : 0)
resources: [ __implicitWidthInternal: root.contentItem.implicitWidth + (root.contentInsideBorder ? root.border.width * 2 : 0)
MarginWrapperManager { __implicitHeightInternal: root.contentItem.implicitHeight + (root.contentInsideBorder ? root.border.width * 2 : 0)
id: manager
wrapper: root.contentItem MarginWrapperManager { id: manager }
}
]
} }

View file

@ -0,0 +1,7 @@
import QtQuick
ClippingRectangle {
id: root
property alias __implicitWidthInternal: root.implicitWidth
property alias __implicitHeightInternal: root.implicitHeight
}