forked from Shinonome/dots-hyprland
wbar: add tooltip and stuff
This commit is contained in:
@@ -17,6 +17,7 @@ Singleton {
|
||||
|
||||
property real backgroundTransparency: 0.17
|
||||
property real contentTransparency: 0.25
|
||||
property real shadowTransparency: 0.6
|
||||
colors: QtObject {
|
||||
id: colors
|
||||
property color bg0: root.dark ? "#1C1C1C" : "#EEEEEE"
|
||||
@@ -33,7 +34,9 @@ Singleton {
|
||||
property color fg1: root.dark ? "#D1D1D1" : "#626262"
|
||||
property color danger: "#C42B1C"
|
||||
property color dangerActive: "#B62D1F"
|
||||
property color brand: Appearance.m3colors.m3primary
|
||||
// property color accent: root.dark ? "#A5C6D8" : "#5377A3"
|
||||
property color accent: Appearance.m3colors.m3primary
|
||||
property color accentUnfocused: root.dark ? "#989898" : "#848484"
|
||||
}
|
||||
|
||||
radius: QtObject {
|
||||
@@ -106,7 +109,7 @@ Singleton {
|
||||
|
||||
property Component move: Component {
|
||||
NumberAnimation {
|
||||
duration: 100
|
||||
duration: 170
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: transition.easing.bezierCurve.easeInOut
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.modules.common
|
||||
import qs.modules.common.functions
|
||||
import qs.modules.common.widgets
|
||||
import qs.modules.waffle.looks
|
||||
|
||||
PopupToolTip {
|
||||
id: root
|
||||
|
||||
property real padding: 2
|
||||
verticalPadding: padding
|
||||
horizontalPadding: padding
|
||||
|
||||
contentItem: Item {
|
||||
anchors.centerIn: parent
|
||||
implicitWidth: realContent.implicitWidth + root.verticalPadding * 2
|
||||
implicitHeight: realContent.implicitHeight + root.horizontalPadding * 2
|
||||
|
||||
Rectangle {
|
||||
id: ambientShadow
|
||||
z: 0
|
||||
anchors {
|
||||
fill: realContent
|
||||
margins: -border.width
|
||||
}
|
||||
border.color: ColorUtils.transparentize(Looks.colors.bg0Border, Looks.shadowTransparency)
|
||||
border.width: 1
|
||||
color: "transparent"
|
||||
radius: realContent.radius + border.width
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: realContent
|
||||
z: 1
|
||||
anchors.centerIn: parent
|
||||
implicitWidth: tooltipText.implicitWidth + 10 * 2
|
||||
implicitHeight: tooltipText.implicitHeight + 8 * 2
|
||||
color: Looks.colors.bg1
|
||||
radius: Looks.radius.medium
|
||||
|
||||
WText {
|
||||
id: tooltipText
|
||||
text: root.text
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user