Add tooltip color tokens
This commit is contained in:
+7
-4
@@ -46,9 +46,12 @@ Rectangle {
|
||||
property real verticalPadding: Style.spacing.controlPaddingY
|
||||
property bool leftAlign: false
|
||||
|
||||
// Tooltip palette. Auto-rendered if tooltipText is set.
|
||||
property color tooltipBackground: Color.background
|
||||
property color tooltipForeground: foreground
|
||||
// Tooltip palette. Auto-rendered if tooltipText is set. Defaults pull
|
||||
// from [tooltip] in shell.toml; override per-instance only when a button
|
||||
// intentionally wants a tooltip that diverges from the theme.
|
||||
property color tooltipBackground: Color.tooltip.background
|
||||
property color tooltipForeground: Color.tooltip.text
|
||||
property color tooltipBorder: Color.tooltip.border
|
||||
|
||||
signal clicked()
|
||||
signal rightClicked()
|
||||
@@ -102,7 +105,7 @@ Rectangle {
|
||||
padding: 0
|
||||
background: Rectangle {
|
||||
color: root.tooltipBackground
|
||||
border.color: root.tooltipForeground
|
||||
border.color: root.tooltipBorder
|
||||
border.width: Math.max(1, Style.normalBorderWidth)
|
||||
radius: 0
|
||||
opacity: 0.97
|
||||
|
||||
@@ -31,7 +31,6 @@ Rectangle {
|
||||
property string tooltipText: ""
|
||||
property color foreground: Color.foreground
|
||||
property color hoverColor: foreground
|
||||
property color panelBackground: Color.background
|
||||
property string fontFamily: Style.font.family
|
||||
property real fontSize: Style.font.icon
|
||||
property real size: Math.max(Style.space(22), fontSize + Style.spacing.sm * 2)
|
||||
@@ -99,8 +98,6 @@ Rectangle {
|
||||
PanelToolTip {
|
||||
visible: root.tooltipText !== "" && mouse.containsMouse
|
||||
text: root.tooltipText
|
||||
panelForeground: root.foreground
|
||||
panelBackground: root.panelBackground
|
||||
fontFamily: root.fontFamily
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,18 +7,20 @@ import qs.Commons
|
||||
// PanelToolTip {
|
||||
// visible: mouse.containsMouse
|
||||
// text: "Forget network"
|
||||
// panelForeground: bar.foreground
|
||||
// panelBackground: bar.background
|
||||
// fontFamily: bar.fontFamily
|
||||
// }
|
||||
//
|
||||
// Defaults pull from [tooltip] in shell.toml via Color.tooltip.*. Override
|
||||
// the panel* properties per-instance only when you need a tooltip that
|
||||
// intentionally diverges from the theme.
|
||||
//
|
||||
// Property names are prefixed `panel*` to avoid clashing with ToolTip's
|
||||
// built-in `background`/`font` properties.
|
||||
ToolTip {
|
||||
id: root
|
||||
|
||||
property color panelForeground: Color.foreground
|
||||
property color panelBackground: Color.background
|
||||
property color panelForeground: Color.tooltip.text
|
||||
property color panelBackground: Color.tooltip.background
|
||||
property color panelBorder: Color.tooltip.border
|
||||
property string fontFamily: Style.font.family
|
||||
property real fontSize: Style.font.bodySmall
|
||||
|
||||
@@ -27,7 +29,7 @@ ToolTip {
|
||||
|
||||
background: Rectangle {
|
||||
color: root.panelBackground
|
||||
border.color: Style.normalBorderFor(root.panelForeground, Color.accent)
|
||||
border.color: root.panelBorder
|
||||
border.width: Style.normalBorderWidth
|
||||
radius: Style.cornerRadius
|
||||
opacity: 0.97
|
||||
|
||||
Reference in New Issue
Block a user