mirror of
https://github.com/status-im/StatusQ.git
synced 2025-02-24 18:48:16 +00:00
This moves the `StatusToolTip` component into `StatusQ` and applies some of the changes done by @jrainville in https://github.com/status-im/status-desktop/pull/2447. Usage: ``` import StatusQ.Controls 0.1 Button { text: "Hover me!" StatusToolTip { visible: parent.hovered text: "Top" orientation: StatusToolTip.Orientation.Top // default: Top } } ``` Closes #14
54 lines
1.3 KiB
QML
54 lines
1.3 KiB
QML
import QtQuick 2.14
|
|
import QtQuick.Controls 2.14
|
|
import QtQuick.Layouts 1.14
|
|
import StatusQ.Core 0.1
|
|
import StatusQ.Core.Theme 0.1
|
|
import StatusQ.Controls 0.1
|
|
|
|
GridLayout {
|
|
columns: 6
|
|
columnSpacing: 5
|
|
rowSpacing: 5
|
|
property ThemePalette theme
|
|
|
|
StatusIconTabButton {
|
|
icon.name: "chat"
|
|
}
|
|
|
|
StatusIconTabButton {
|
|
icon.source: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
|
}
|
|
|
|
StatusIconTabButton {
|
|
name: "#status"
|
|
}
|
|
|
|
Button {
|
|
text: "Hover me!"
|
|
StatusToolTip {
|
|
visible: parent.hovered
|
|
text: "Top"
|
|
}
|
|
StatusToolTip {
|
|
visible: parent.hovered
|
|
text: "Right"
|
|
orientation: StatusToolTip.Orientation.Right
|
|
x: parent.width + 16
|
|
y: parent.height / 2 - height / 2 + 4
|
|
}
|
|
StatusToolTip {
|
|
visible: parent.hovered
|
|
text: "Bottom"
|
|
orientation: StatusToolTip.Orientation.Bottom
|
|
y: parent.height + 12
|
|
}
|
|
StatusToolTip {
|
|
visible: parent.hovered
|
|
text: "Left"
|
|
orientation: StatusToolTip.Orientation.Left
|
|
x: -parent.width /2 -8
|
|
y: parent.height / 2 - height / 2 + 4
|
|
}
|
|
}
|
|
}
|