More tweaking and standardization
This commit is contained in:
@@ -31,10 +31,10 @@ QtObject {
|
|||||||
readonly property color focusFillColor: Qt.rgba(Color.accent.r, Color.accent.g, Color.accent.b, 0.22)
|
readonly property color focusFillColor: Qt.rgba(Color.accent.r, Color.accent.g, Color.accent.b, 0.22)
|
||||||
readonly property int focusBorderWidth: 3
|
readonly property int focusBorderWidth: 3
|
||||||
|
|
||||||
// Convenience: the standard "hot" (hover or keyboard cursor) tint used by
|
// Convenience fills used by panel rows and pills. Hot is hover/keyboard
|
||||||
// PillButton, PanelActionButton, etc. Foreground at 0.12 alpha matches the
|
// cursor; selected is the persistent chosen/current item state.
|
||||||
// value PillButton was already painting before promotion.
|
readonly property color hotFill: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.08)
|
||||||
readonly property color hotFill: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.12)
|
readonly property color selectedFill: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.18)
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
hyprctlProc.running = true
|
hyprctlProc.running = true
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Rectangle {
|
|||||||
|
|
||||||
color: selected
|
color: selected
|
||||||
? Qt.rgba(accent.r, accent.g, accent.b, 0.18)
|
? Qt.rgba(accent.r, accent.g, accent.b, 0.18)
|
||||||
: ((mouse.containsMouse || hasCursor) ? Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12) : background)
|
: ((mouse.containsMouse || hasCursor) ? Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08) : background)
|
||||||
border.color: selected
|
border.color: selected
|
||||||
? accent
|
? accent
|
||||||
: (activeFocus ? foreground : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.4))
|
: (activeFocus ? foreground : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.4))
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ Rectangle {
|
|||||||
property bool current: false
|
property bool current: false
|
||||||
|
|
||||||
property color foreground: "#cacccc"
|
property color foreground: "#cacccc"
|
||||||
property color fill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12)
|
property color fill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08)
|
||||||
property color currentFill: fill
|
property color currentFill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.18)
|
||||||
|
|
||||||
radius: Style.cornerRadius
|
radius: Style.cornerRadius
|
||||||
color: hasCursor ? fill : (current ? currentFill : "transparent")
|
color: hasCursor ? fill : (current ? currentFill : "transparent")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Rectangle {
|
|||||||
property string tooltipText: ""
|
property string tooltipText: ""
|
||||||
property color foreground: "#cacccc"
|
property color foreground: "#cacccc"
|
||||||
property color background: "transparent"
|
property color background: "transparent"
|
||||||
property color hoverBackground: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12)
|
property color hoverBackground: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08)
|
||||||
property color pressedBackground: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.22)
|
property color pressedBackground: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.22)
|
||||||
property color tooltipBackground: "#101315"
|
property color tooltipBackground: "#101315"
|
||||||
property color tooltipForeground: foreground
|
property color tooltipForeground: foreground
|
||||||
|
|||||||
+4
-4
@@ -48,13 +48,13 @@ Rectangle {
|
|||||||
implicitWidth: 240
|
implicitWidth: 240
|
||||||
radius: Style.cornerRadius
|
radius: Style.cornerRadius
|
||||||
|
|
||||||
color: activeFocus || hasCursor
|
color: activeFocus
|
||||||
? Style.focusFillColor
|
? Style.focusFillColor
|
||||||
: (mouse.containsMouse ? Style.hotFill : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.03))
|
: ((hasCursor || mouse.containsMouse) ? Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08) : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.03))
|
||||||
border.color: activeFocus || hasCursor
|
border.color: activeFocus
|
||||||
? Style.focusBorderColor
|
? Style.focusBorderColor
|
||||||
: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12)
|
: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12)
|
||||||
border.width: activeFocus || hasCursor ? Style.focusBorderWidth : 1
|
border.width: activeFocus ? Style.focusBorderWidth : 1
|
||||||
|
|
||||||
Behavior on color { ColorAnimation { duration: 100 } }
|
Behavior on color { ColorAnimation { duration: 100 } }
|
||||||
|
|
||||||
|
|||||||
@@ -96,8 +96,11 @@ Item {
|
|||||||
property string focusSection: "output"
|
property string focusSection: "output"
|
||||||
property int selectedIndex: -1
|
property int selectedIndex: -1
|
||||||
|
|
||||||
readonly property color activeFill: bar
|
readonly property color hoverFill: bar
|
||||||
? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.12)
|
? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.08)
|
||||||
|
: "transparent"
|
||||||
|
readonly property color selectedFill: bar
|
||||||
|
? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.18)
|
||||||
: "transparent"
|
: "transparent"
|
||||||
|
|
||||||
function sectionCount(section) {
|
function sectionCount(section) {
|
||||||
@@ -692,7 +695,8 @@ Item {
|
|||||||
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(sinkRow)
|
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(sinkRow)
|
||||||
current: isActive
|
current: isActive
|
||||||
foreground: root.bar.foreground
|
foreground: root.bar.foreground
|
||||||
fill: root.activeFill
|
fill: root.hoverFill
|
||||||
|
currentFill: root.selectedFill
|
||||||
implicitHeight: sinkInner.implicitHeight + 10
|
implicitHeight: sinkInner.implicitHeight + 10
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
@@ -758,7 +762,8 @@ Item {
|
|||||||
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(sourceRow)
|
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(sourceRow)
|
||||||
current: isActive
|
current: isActive
|
||||||
foreground: root.bar.foreground
|
foreground: root.bar.foreground
|
||||||
fill: root.activeFill
|
fill: root.hoverFill
|
||||||
|
currentFill: root.selectedFill
|
||||||
implicitHeight: sourceInner.implicitHeight + 10
|
implicitHeight: sourceInner.implicitHeight + 10
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
@@ -828,7 +833,8 @@ Item {
|
|||||||
hasCursor: root.focusSection === "streams" && root.selectedIndex === rowIndex
|
hasCursor: root.focusSection === "streams" && root.selectedIndex === rowIndex
|
||||||
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(streamRow)
|
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(streamRow)
|
||||||
foreground: root.bar.foreground
|
foreground: root.bar.foreground
|
||||||
fill: root.activeFill
|
fill: root.hoverFill
|
||||||
|
currentFill: root.selectedFill
|
||||||
implicitHeight: streamColumn.implicitHeight + 8
|
implicitHeight: streamColumn.implicitHeight + 8
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|||||||
@@ -108,8 +108,11 @@ Item {
|
|||||||
// same device across reorders rather than the slot it used to occupy.
|
// same device across reorders rather than the slot it used to occupy.
|
||||||
property string focusedKnownAddress: ""
|
property string focusedKnownAddress: ""
|
||||||
|
|
||||||
readonly property color activeFill: bar
|
readonly property color hoverFill: bar
|
||||||
? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.12)
|
? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.08)
|
||||||
|
: "transparent"
|
||||||
|
readonly property color selectedFill: bar
|
||||||
|
? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.18)
|
||||||
: "transparent"
|
: "transparent"
|
||||||
|
|
||||||
function sectionCount(section) {
|
function sectionCount(section) {
|
||||||
@@ -557,8 +560,8 @@ Item {
|
|||||||
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(row)
|
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(row)
|
||||||
current: isConnected
|
current: isConnected
|
||||||
foreground: root.bar.foreground
|
foreground: root.bar.foreground
|
||||||
fill: root.activeFill
|
fill: root.hoverFill
|
||||||
currentFill: root.activeFill
|
currentFill: root.selectedFill
|
||||||
|
|
||||||
// 0 idle, 1 connecting, 2 disconnecting, 3 pairing, 4 failed.
|
// 0 idle, 1 connecting, 2 disconnecting, 3 pairing, 4 failed.
|
||||||
property int pendingAction: 0
|
property int pendingAction: 0
|
||||||
|
|||||||
@@ -498,20 +498,22 @@ Item {
|
|||||||
Repeater {
|
Repeater {
|
||||||
model: root.scaleValues
|
model: root.scaleValues
|
||||||
|
|
||||||
ChoiceButton {
|
CursorPill {
|
||||||
required property string modelData
|
required property string modelData
|
||||||
required property int index
|
required property int index
|
||||||
|
|
||||||
width: (panelColumn.width - 30) / 6
|
width: (panelColumn.width - 30) / 6
|
||||||
text: modelData + "x"
|
text: modelData + "x"
|
||||||
foreground: root.bar.foreground
|
foreground: root.bar.foreground
|
||||||
background: root.bar.background
|
background: "transparent"
|
||||||
accent: root.bar.foreground
|
tooltipBackground: root.bar.background
|
||||||
|
tooltipForeground: root.bar.foreground
|
||||||
fontFamily: root.bar.fontFamily
|
fontFamily: root.bar.fontFamily
|
||||||
fontSize: 11
|
fontSize: 11
|
||||||
selected: root.normalizeScale(root.monitorScale) === root.normalizeScale(modelData)
|
horizontalPadding: 0
|
||||||
|
verticalPadding: 6
|
||||||
|
active: root.normalizeScale(root.monitorScale) === root.normalizeScale(modelData)
|
||||||
hasCursor: root.focusSection === "scale" && root.selectedIndex === index
|
hasCursor: root.focusSection === "scale" && root.selectedIndex === index
|
||||||
borderlessHighlight: true
|
|
||||||
onClicked: root.setScale(modelData)
|
onClicked: root.setScale(modelData)
|
||||||
onHovered: function(h) {
|
onHovered: function(h) {
|
||||||
if (h) {
|
if (h) {
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ Item {
|
|||||||
// Mouse hover and keyboard nav both mutate this state at the root; items
|
// Mouse hover and keyboard nav both mutate this state at the root; items
|
||||||
// never read containsMouse for visuals. See CursorSurface for the
|
// never read containsMouse for visuals. See CursorSurface for the
|
||||||
// shared chrome (fill / border) shared by NetworkRow and DnsProviderPill.
|
// shared chrome (fill / border) shared by NetworkRow and DnsProviderPill.
|
||||||
readonly property color activeFill: bar ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.12) : "transparent"
|
readonly property color hoverFill: bar ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.08) : "transparent"
|
||||||
|
readonly property color selectedFill: bar ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.18) : "transparent"
|
||||||
|
|
||||||
// The panel below is its own layer-shell with Exclusive keyboard focus,
|
// The panel below is its own layer-shell with Exclusive keyboard focus,
|
||||||
// so Hyprland grants focus when the surface is mapped (popupOpen flips
|
// so Hyprland grants focus when the surface is mapped (popupOpen flips
|
||||||
@@ -577,7 +578,6 @@ iwctl station "$station" get-networks rssi-dbms 2>/dev/null \\
|
|||||||
text: root.icon
|
text: root.icon
|
||||||
horizontalMargin: 8.5
|
horizontalMargin: 8.5
|
||||||
rightExtraMargin: 2
|
rightExtraMargin: 2
|
||||||
tooltipText: root.networkTooltip()
|
|
||||||
|
|
||||||
onPressed: function(b) {
|
onPressed: function(b) {
|
||||||
if (b === Qt.RightButton) root.launchImpala()
|
if (b === Qt.RightButton) root.launchImpala()
|
||||||
@@ -956,7 +956,8 @@ iwctl station "$station" get-networks rssi-dbms 2>/dev/null \\
|
|||||||
hasCursor: isSelected
|
hasCursor: isSelected
|
||||||
current: isConnected
|
current: isConnected
|
||||||
foreground: root.bar.foreground
|
foreground: root.bar.foreground
|
||||||
fill: root.activeFill
|
fill: root.hoverFill
|
||||||
|
currentFill: root.selectedFill
|
||||||
// Gate on the matching *Kind/*Reason being non-empty so a hidden-SSID
|
// Gate on the matching *Kind/*Reason being non-empty so a hidden-SSID
|
||||||
// row (ssid == "") doesn't match the "" defaults of actionSsid etc.
|
// row (ssid == "") doesn't match the "" defaults of actionSsid etc.
|
||||||
readonly property bool isBusy: root.actionKind !== "" && root.actionSsid === (net ? net.ssid : "")
|
readonly property bool isBusy: root.actionKind !== "" && root.actionSsid === (net ? net.ssid : "")
|
||||||
|
|||||||
Reference in New Issue
Block a user