styled tooltip
This commit is contained in:
parent
13e6345b1d
commit
b75a2a12c7
2 changed files with 30 additions and 1 deletions
19
components/StyledToolTip.qml
Normal file
19
components/StyledToolTip.qml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import qs.config
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
ToolTip {
|
||||||
|
id: control
|
||||||
|
text: qsTr("A descriptive tool tip of what the button does")
|
||||||
|
|
||||||
|
contentItem: Text {
|
||||||
|
text: control.text
|
||||||
|
font: control.font
|
||||||
|
color: Theme.palette.basecontent
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
radius: 8
|
||||||
|
color: Theme.palette.base200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ import Quickshell.Hyprland
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
StyledWindow {
|
StyledWindow {
|
||||||
|
|
@ -39,6 +40,15 @@ StyledWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {}
|
ColumnLayout {
|
||||||
|
Button {
|
||||||
|
id: toolTipButton
|
||||||
|
text: "Hello world!"
|
||||||
|
StyledToolTip {
|
||||||
|
visible: toolTipButton.hovered
|
||||||
|
text: qsTr("Save the active project")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue