mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-21 22:50:14 +03:00
Dont use empty areas in HeaderSwitch
--the user in order to activate/deactivate an element must click either the Text or the Swith elements
This commit is contained in:
parent
89e0eaa3ee
commit
f9091f3b6c
@ -72,31 +72,47 @@ Item {
|
||||
|
||||
signal pressed();
|
||||
|
||||
RowLayout {
|
||||
Item {
|
||||
id: row
|
||||
width: parent.width
|
||||
height: textElement.height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
LatteExtraControls.Header {
|
||||
id: headerText
|
||||
text: item.text
|
||||
enabled: item.checked
|
||||
visible: level === 1
|
||||
RowLayout {
|
||||
id: textElement
|
||||
anchors.left: level !== 2 ? parent.left : undefined
|
||||
anchors.horizontalCenter: level === 2 ? parent.horizontalCenter : undefined
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
LatteExtraControls.Header {
|
||||
id: headerText
|
||||
text: item.text
|
||||
enabled: item.checked
|
||||
visible: level === 1
|
||||
}
|
||||
|
||||
LatteExtraControls.SubHeader {
|
||||
id: subHeaderText
|
||||
text: item.text
|
||||
enabled: item.checked
|
||||
visible: level === 2
|
||||
isFirstSubCategory: item.isFirstSubCategory
|
||||
}
|
||||
|
||||
PlasmaComponents.Label {
|
||||
id: labelText
|
||||
text: item.text
|
||||
enabled: item.checked
|
||||
visible: level > 2
|
||||
}
|
||||
}
|
||||
|
||||
LatteExtraControls.SubHeader {
|
||||
id: subHeaderText
|
||||
text: item.text
|
||||
enabled: item.checked
|
||||
visible: level === 2
|
||||
isFirstSubCategory: item.isFirstSubCategory
|
||||
}
|
||||
MouseArea {
|
||||
id: textMouseArea
|
||||
anchors.fill: textElement
|
||||
hoverEnabled: true
|
||||
|
||||
PlasmaComponents.Label {
|
||||
id: labelText
|
||||
text: item.text
|
||||
enabled: item.checked
|
||||
visible: level > 2
|
||||
onClicked: item.pressed();
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,20 +123,20 @@ Item {
|
||||
checked: item.checked
|
||||
|
||||
style: Private.SwitchStyle {}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: itemMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
MouseArea {
|
||||
id: switchMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onClicked: item.pressed();
|
||||
onClicked: item.pressed();
|
||||
}
|
||||
}
|
||||
|
||||
ToolTip{
|
||||
parent: itemSwitch
|
||||
text: item.tooltip
|
||||
visible: itemMouseArea.containsMouse && text !==""
|
||||
visible: (switchMouseArea.containsMouse || textMouseArea.containsMouse) && text !==""
|
||||
delay: 7 * units.longDuration
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user