NTooltip: subtle gradient, NToggle: onEnter, onExited

This commit is contained in:
quadbyte 2025-08-12 23:04:43 -04:00
parent ce22559ee2
commit 5c9c61cf81
4 changed files with 20 additions and 14 deletions

View file

@ -22,7 +22,6 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
ColumnLayout { ColumnLayout {
id: mainColumn
spacing: Style.marginTiniest * scaling spacing: Style.marginTiniest * scaling
Layout.fillWidth: true Layout.fillWidth: true
@ -38,7 +37,6 @@ ColumnLayout {
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
color: Colors.textSecondary color: Colors.textSecondary
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
Layout.fillWidth: true
} }
} }

View file

@ -19,7 +19,7 @@ PanelWindow {
} }
function show() { function show() {
// Ensure only one panel is visible at a time using Settings as ephemeral store // Ensure only one panel is visible at a time using PanelManager as ephemeral storage
try { try {
if (PanelManager.openedPanel && PanelManager.openedPanel !== root && PanelManager.openedPanel.hide) { if (PanelManager.openedPanel && PanelManager.openedPanel !== root && PanelManager.openedPanel.hide) {
PanelManager.openedPanel.hide() PanelManager.openedPanel.hide()

View file

@ -14,6 +14,8 @@ RowLayout {
property int baseSize: Style.baseWidgetSize property int baseSize: Style.baseWidgetSize
signal toggled(bool balue) signal toggled(bool balue)
signal entered
signal exited
Layout.fillWidth: true Layout.fillWidth: true
@ -69,8 +71,14 @@ RowLayout {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: true
onEntered: hovering = true onEntered: {
onExited: hovering = false hovering = true
root.entered()
}
onExited: {
hovering = false
root.exited()
}
onClicked: { onClicked: {
value = !value value = !value
root.toggled(value) root.toggled(value)

View file

@ -101,15 +101,15 @@ Window {
anchors.fill: parent anchors.fill: parent
radius: Style.radiusMedium * scaling radius: Style.radiusMedium * scaling
gradient: Gradient { gradient: Gradient {
GradientStop { GradientStop {
position: 0.0 position: 0.0
color: Colors.backgroundTertiary color: Colors.backgroundTertiary
} }
GradientStop { GradientStop {
position: 1.0 position: 1.0
color: Colors.backgroundSecondary color: Colors.backgroundSecondary
} }
} }
border.color: Colors.outline border.color: Colors.outline
border.width: Math.max(1, Style.borderThin * scaling) border.width: Math.max(1, Style.borderThin * scaling)
z: 1 z: 1