KeyboardLayout: increase font size and make it all caps
This commit is contained in:
parent
e4b54e518c
commit
be0b568f1f
5 changed files with 62 additions and 3 deletions
|
|
@ -13,6 +13,26 @@ Item {
|
||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
|
property string barSection: ""
|
||||||
|
property int sectionWidgetIndex: -1
|
||||||
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
|
property var widgetSettings: {
|
||||||
|
var section = barSection.replace("Section", "").toLowerCase()
|
||||||
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
var widgets = Settings.data.bar.widgets[section]
|
||||||
|
if (widgets && sectionWidgetIndex < widgets.length) {
|
||||||
|
return widgets[sectionWidgetIndex]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property bool forceOpen: (widgetSettings.forceOpen !== undefined) ? widgetSettings.forceOpen : widgetMetadata.forceOpen
|
||||||
|
|
||||||
// Use the shared service for keyboard layout
|
// Use the shared service for keyboard layout
|
||||||
property string currentLayout: KeyboardLayoutService.currentLayout
|
property string currentLayout: KeyboardLayoutService.currentLayout
|
||||||
|
|
||||||
|
|
@ -26,8 +46,10 @@ Item {
|
||||||
rightOpen: BarWidgetRegistry.getNPillDirection(root)
|
rightOpen: BarWidgetRegistry.getNPillDirection(root)
|
||||||
icon: "keyboard"
|
icon: "keyboard"
|
||||||
autoHide: false // Important to be false so we can hover as long as we want
|
autoHide: false // Important to be false so we can hover as long as we want
|
||||||
text: currentLayout
|
text: currentLayout.toUpperCase()
|
||||||
tooltipText: "Keyboard layout: " + currentLayout
|
tooltipText: "Keyboard layout: " + currentLayout.toUpperCase()
|
||||||
|
forceOpen: root.forceOpen
|
||||||
|
fontSize: Style.fontSizeS // Use larger font size
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ Popup {
|
||||||
"Brightness": "WidgetSettings/BrightnessSettings.qml",
|
"Brightness": "WidgetSettings/BrightnessSettings.qml",
|
||||||
"Clock": "WidgetSettings/ClockSettings.qml",
|
"Clock": "WidgetSettings/ClockSettings.qml",
|
||||||
"CustomButton": "WidgetSettings/CustomButtonSettings.qml",
|
"CustomButton": "WidgetSettings/CustomButtonSettings.qml",
|
||||||
|
"KeyboardLayout": "WidgetSettings/KeyboardLayoutSettings.qml",
|
||||||
"MediaMini": "WidgetSettings/MediaMiniSettings.qml",
|
"MediaMini": "WidgetSettings/MediaMiniSettings.qml",
|
||||||
"Microphone": "WidgetSettings/MicrophoneSettings.qml",
|
"Microphone": "WidgetSettings/MicrophoneSettings.qml",
|
||||||
"NotificationHistory": "WidgetSettings/NotificationHistorySettings.qml",
|
"NotificationHistory": "WidgetSettings/NotificationHistorySettings.qml",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import qs.Commons
|
||||||
|
import qs.Widgets
|
||||||
|
import qs.Services
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
spacing: Style.marginM * scaling
|
||||||
|
|
||||||
|
// Properties to receive data from parent
|
||||||
|
property var widgetData: null
|
||||||
|
property var widgetMetadata: null
|
||||||
|
|
||||||
|
// Local state
|
||||||
|
property bool valueForceOpen: widgetData.forceOpen !== undefined ? widgetData.forceOpen : widgetMetadata.forceOpen
|
||||||
|
|
||||||
|
function saveSettings() {
|
||||||
|
var settings = Object.assign({}, widgetData || {})
|
||||||
|
settings.forceOpen = valueForceOpen
|
||||||
|
return settings
|
||||||
|
}
|
||||||
|
|
||||||
|
NToggle {
|
||||||
|
label: "Force open"
|
||||||
|
description: "Keep the keyboard layout widget always expanded."
|
||||||
|
checked: valueForceOpen
|
||||||
|
onToggled: checked => valueForceOpen = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -104,6 +104,10 @@ Singleton {
|
||||||
"Volume": {
|
"Volume": {
|
||||||
"allowUserSettings": true,
|
"allowUserSettings": true,
|
||||||
"alwaysShowPercentage": false
|
"alwaysShowPercentage": false
|
||||||
|
},
|
||||||
|
"KeyboardLayout": {
|
||||||
|
"allowUserSettings": true,
|
||||||
|
"forceOpen": false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ Item {
|
||||||
property bool disableOpen: false
|
property bool disableOpen: false
|
||||||
property bool rightOpen: false
|
property bool rightOpen: false
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
|
property real fontSize: Style.fontSizeXS
|
||||||
|
|
||||||
// Effective shown state (true if hovered/animated open or forced)
|
// Effective shown state (true if hovered/animated open or forced)
|
||||||
readonly property bool revealed: forceOpen || showPill
|
readonly property bool revealed: forceOpen || showPill
|
||||||
|
|
@ -69,7 +70,7 @@ Item {
|
||||||
return centerX + offset
|
return centerX + offset
|
||||||
}
|
}
|
||||||
text: root.text
|
text: root.text
|
||||||
font.pointSize: Style.fontSizeXS * scaling
|
font.pointSize: root.fontSize * scaling
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
color: Color.mPrimary
|
color: Color.mPrimary
|
||||||
visible: revealed
|
visible: revealed
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue