add click for text stack hlayout vlayout

This commit is contained in:
王劲鹏
2021-03-19 16:13:02 +08:00
committed by osborn
parent 0784fa844c
commit ace6d87bda
13 changed files with 52 additions and 13 deletions

View File

@@ -6,6 +6,8 @@ import "util.mjs" as Util
import "gravity.mjs" as Gravity
Rectangle {
property int wrapper: 0
property var tag: "HLayout"
property var uuid: Util.uuidv4()
@@ -29,7 +31,7 @@ Rectangle {
if (this.widthSpec === 2) {
this.width = parent.width
// children[0].width = parent.width
// children[1].width = parent.width
}
}
@@ -39,7 +41,7 @@ Rectangle {
if (this.heightSpec === 2) {
this.height = parent.height
children[0].height = parent.height
children[1].height = parent.height
}
}
@@ -60,6 +62,13 @@ Rectangle {
color: 'transparent'
MouseArea {
anchors.fill: parent
onClicked: {
mouseAreaBridge.onClick(wrapper)
}
}
RowLayout {
property int gravity: 0

View File

@@ -5,7 +5,10 @@ import QtQuick.Layouts 1.15
import "util.mjs" as Util
Rectangle {
property int wrapper: 0
property var uuid: Util.uuidv4()
property int widthSpec: 0
property int heightSpec: 0
property int childrenRectWidth: childrenRect.width
@@ -54,4 +57,11 @@ Rectangle {
}
color: 'transparent'
MouseArea {
anchors.fill: parent
onClicked: {
mouseAreaBridge.onClick(wrapper)
}
}
}

View File

@@ -5,6 +5,8 @@ import "util.mjs" as Util
import "gravity.mjs" as Gravity
Rectangle {
property int wrapper: 0
property var uuid: Util.uuidv4()
property int childrenRectWidth: childrenRect.width
property int childrenRectHeight: childrenRect.width
@@ -52,7 +54,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: {
mouseAreaBridge.onClick("index")
mouseAreaBridge.onClick(wrapper)
}
}
}

View File

@@ -6,6 +6,8 @@ import "util.mjs" as Util
import "gravity.mjs" as Gravity
Rectangle {
property int wrapper: 0
property var tag: "VLayout"
property var uuid: Util.uuidv4()
@@ -29,7 +31,7 @@ Rectangle {
if (this.widthSpec === 2) {
this.width = parent.width
children[0].width = parent.width
children[1].width = parent.width
}
}
@@ -39,7 +41,7 @@ Rectangle {
if (this.heightSpec === 2) {
this.height = parent.height
// children[0].height = parent.height
// children[1].height = parent.height
}
}
@@ -60,6 +62,13 @@ Rectangle {
color: 'transparent'
MouseArea {
anchors.fill: parent
onClicked: {
mouseAreaBridge.onClick(wrapper)
}
}
ColumnLayout {
property int gravity: 0