mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-27 02:54:36 +00:00
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:
3 files changed
+14
-9
No files matched your search
@@ -14,6 +14,7 @@ qt_add_qml_module(quickshell-widgets
|
||||
WrapperMouseArea.qml
|
||||
WrapperRectangle.qml
|
||||
ClippingWrapperRectangle.qml
|
||||
ClippingWrapperRectangleInternal.qml
|
||||
)
|
||||
|
||||
qt6_add_shaders(quickshell-widgets "widgets-cliprect"
|
||||
|
||||
@@ -11,7 +11,7 @@ import QtQuick
|
||||
/// > @@Item.height or @@Item.anchors on the child item, as they are used
|
||||
/// > by WrapperItem to position it. Instead set @@Item.implicitWidth and
|
||||
/// > @@Item.implicitHeight.
|
||||
ClippingRectangle {
|
||||
ClippingWrapperRectangleInternal {
|
||||
id: root
|
||||
|
||||
/// The default for @@topMargin, @@bottomMargin, @@leftMargin and @@rightMargin.
|
||||
@@ -54,13 +54,10 @@ ClippingRectangle {
|
||||
/// See @@WrapperManager.child for details.
|
||||
property alias child: manager.child
|
||||
|
||||
implicitWidth: root.contentItem.implicitWidth + (root.contentInsideBorder ? root.border.width * 2 : 0)
|
||||
implicitHeight: root.contentItem.implicitHeight + (root.contentInsideBorder ? root.border.width * 2 : 0)
|
||||
border.width: 0
|
||||
|
||||
resources: [
|
||||
MarginWrapperManager {
|
||||
id: manager
|
||||
wrapper: root.contentItem
|
||||
}
|
||||
]
|
||||
__implicitWidthInternal: root.contentItem.implicitWidth + (root.contentInsideBorder ? root.border.width * 2 : 0)
|
||||
__implicitHeightInternal: root.contentItem.implicitHeight + (root.contentInsideBorder ? root.border.width * 2 : 0)
|
||||
|
||||
MarginWrapperManager { id: manager }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import QtQuick
|
||||
|
||||
ClippingRectangle {
|
||||
id: root
|
||||
property alias __implicitWidthInternal: root.implicitWidth
|
||||
property alias __implicitHeightInternal: root.implicitHeight
|
||||
}
|
||||
Reference in new issue
Block a user