mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-03 10:56:16 +00:00
Merge pull request #629 from MrDowntempo/feat/lock-keys-tweaks
Feat/lock keys tweaks
This commit is contained in:
@@ -30,6 +30,7 @@ Rectangle {
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
|
||||
|
||||
readonly property string iconStyle: (widgetSettings.indicatorStyle !== undefined) ? widgetSettings.indicatorStyle : widgetMetadata.indicatorStyle
|
||||
readonly property bool showCaps: (widgetSettings.showCapsLock !== undefined) ? widgetSettings.showCapsLock : widgetMetadata.showCapsLock
|
||||
readonly property bool showNum: (widgetSettings.showNumLock !== undefined) ? widgetSettings.showNumLock : widgetMetadata.showNumLock
|
||||
readonly property bool showScroll: (widgetSettings.showScrollLock !== undefined) ? widgetSettings.showScrollLock : widgetMetadata.showScrollLock
|
||||
@@ -50,6 +51,8 @@ Rectangle {
|
||||
implicitWidth: rowLayout.visible ? rowLayout.implicitWidth : colLayout.implicitWidth
|
||||
implicitHeight: rowLayout.visible ? rowLayout.implicitHeight : colLayout.implicitHeight
|
||||
|
||||
readonly property var indicatorStyle: root.getIndicatorStyle(root.iconStyle)
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
visible: !root.isVertical
|
||||
@@ -57,17 +60,17 @@ Rectangle {
|
||||
|
||||
NIcon {
|
||||
visible: root.showCaps
|
||||
icon: "letter-c"
|
||||
icon: layout.indicatorStyle[0]
|
||||
color: LockKeysService.capsLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3)
|
||||
}
|
||||
NIcon {
|
||||
visible: root.showNum
|
||||
icon: "letter-n"
|
||||
icon: layout.indicatorStyle[1]
|
||||
color: LockKeysService.numLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3)
|
||||
}
|
||||
NIcon {
|
||||
visible: root.showScroll
|
||||
icon: "letter-s"
|
||||
icon: layout.indicatorStyle[2]
|
||||
color: LockKeysService.scrollLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3)
|
||||
}
|
||||
}
|
||||
@@ -79,19 +82,42 @@ Rectangle {
|
||||
|
||||
NIcon {
|
||||
visible: root.showCaps
|
||||
icon: "letter-c"
|
||||
icon: layout.indicatorStyle[0]
|
||||
color: LockKeysService.capsLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3)
|
||||
}
|
||||
NIcon {
|
||||
visible: root.showNum
|
||||
icon: "letter-n"
|
||||
icon: layout.indicatorStyle[1]
|
||||
color: LockKeysService.numLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3)
|
||||
}
|
||||
NIcon {
|
||||
visible: root.showScroll
|
||||
icon: "letter-s"
|
||||
icon: layout.indicatorStyle[2]
|
||||
color: LockKeysService.scrollLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getIndicatorStyle(styleName) {
|
||||
switch (styleName) {
|
||||
case "large":
|
||||
return ["letter-c", "letter-n", "letter-s"]
|
||||
case "small":
|
||||
return ["letter-c-small", "letter-n-small", "letter-s-small"]
|
||||
case "square":
|
||||
return ["square-letter-c", "square-letter-n", "square-letter-s"]
|
||||
case "square-round":
|
||||
return ["square-rounded-letter-c", "square-rounded-letter-n", "square-rounded-letter-s"]
|
||||
case "circle":
|
||||
return ["circle-letter-c", "circle-letter-n", "circle-letter-s"]
|
||||
case "circle-dash":
|
||||
return ["circle-dashed-letter-c", "circle-dashed-letter-n", "circle-dashed-letter-s"]
|
||||
case "circle-dot":
|
||||
return ["circle-dotted-letter-c", "circle-dotted-letter-n", "circle-dotted-letter-s"]
|
||||
case "hex":
|
||||
return ["hexagon-letter-c", "hexagon-letter-n", "hexagon-letter-s"]
|
||||
default:
|
||||
return ["letter-c", "letter-n", "letter-s"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user