mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:38:58 +08:00
WIP: add tooltip to connection status icon
wip: content and position CURA-7437
This commit is contained in:
parent
eef347ed6c
commit
2eaa366424
@ -35,7 +35,8 @@ Item
|
|||||||
property color headerActiveColor: UM.Theme.getColor("secondary")
|
property color headerActiveColor: UM.Theme.getColor("secondary")
|
||||||
property color headerHoverColor: UM.Theme.getColor("action_button_hovered")
|
property color headerHoverColor: UM.Theme.getColor("action_button_hovered")
|
||||||
|
|
||||||
property alias enabled: mouseArea.enabled
|
property alias mouseArea: headerMouseArea
|
||||||
|
property alias enabled: headerMouseArea.enabled
|
||||||
|
|
||||||
// Text to show when this component is disabled
|
// Text to show when this component is disabled
|
||||||
property alias disabledText: disabledLabel.text
|
property alias disabledText: disabledLabel.text
|
||||||
@ -139,6 +140,16 @@ Item
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: base.enabled
|
visible: base.enabled
|
||||||
|
|
||||||
|
MouseArea
|
||||||
|
{
|
||||||
|
id: headerMouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: toggleContent()
|
||||||
|
hoverEnabled: true
|
||||||
|
onEntered: background.color = headerHoverColor
|
||||||
|
onExited: background.color = base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled")
|
||||||
|
}
|
||||||
|
|
||||||
Loader
|
Loader
|
||||||
{
|
{
|
||||||
id: headerItemLoader
|
id: headerItemLoader
|
||||||
@ -180,15 +191,6 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea
|
|
||||||
{
|
|
||||||
id: mouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: toggleContent()
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: background.color = headerHoverColor
|
|
||||||
onExited: background.color = base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DropShadow
|
DropShadow
|
||||||
|
@ -60,6 +60,7 @@ Cura.ExpandablePopup
|
|||||||
|
|
||||||
UM.RecolorImage
|
UM.RecolorImage
|
||||||
{
|
{
|
||||||
|
id: connectionStatusImage
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
@ -106,6 +107,27 @@ Cura.ExpandablePopup
|
|||||||
color: UM.Theme.getColor("main_background")
|
color: UM.Theme.getColor("main_background")
|
||||||
z: parent.z - 1
|
z: parent.z - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea // Connection status tooltip hover area
|
||||||
|
{
|
||||||
|
id: connectionStatusTooltipHoverArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
enabled: true // todo
|
||||||
|
acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks
|
||||||
|
|
||||||
|
onEntered:
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
connectionStatusImage,
|
||||||
|
Qt.point(0, 0),
|
||||||
|
"blaat blaat"
|
||||||
|
); //todo
|
||||||
|
machineSelector.mouseArea.entered() // we want both this and the outer area to be entered
|
||||||
|
}
|
||||||
|
onExited: base.hideTooltip()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user