Very early KDE 6 release.

This commit is contained in:
wackyideas 2024-08-09 03:20:25 +02:00
parent 7cc4ccabbc
commit 686046d4f7
6272 changed files with 140920 additions and 529657 deletions

View file

@ -0,0 +1,10 @@
import QtQuick 2.12
import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("General")
icon: "configure"
source: "configGeneral.qml"
}
}

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name=""/>
<group name="General">
<entry name="displayStyle" type="Enum">
<label>Whether to show text, a flag, or both on the compact representation.</label>
<choices>
<choice name="Label"/>
<choice name="Flag"/>
<choice name="LabelOverFlag"/>
</choices>
<default>0</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,127 @@
/*
SPDX-FileCopyrightText: 2021 Andrey Butirsky <butirsky@gmail.com>
SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import org.kde.kirigami 2.20 as Kirigami
import org.kde.plasma.workspace.keyboardlayout 1.0
import org.kde.plasma.workspace.components 2.0 as WorkspaceComponents
import org.kde.plasma.private.kcm_keyboard as KCMKeyboard
import org.kde.kcmutils
SimpleKCM {
id: root
property int cfg_displayStyle
readonly property string layoutShortName: keyboardLayout.layoutsList.length ? keyboardLayout.layoutsList[keyboardLayout.layout].shortName
: ""
readonly property string displayName: keyboardLayout.layoutsList.length ? keyboardLayout.layoutsList[keyboardLayout.layout].displayName
: ""
KeyboardLayout { id: keyboardLayout }
Kirigami.FormLayout {
RadioButton {
id: showLabel
Kirigami.FormData.label: i18n("Display style:")
text: root.displayName.length > 0 ? root.displayName: root.layoutShortName
checked: cfg_displayStyle === 0
onToggled: cfg_displayStyle = 0;
}
RadioButton {
id: showFlag
checked: cfg_displayStyle === 1
onToggled: cfg_displayStyle = 1;
contentItem: Item {
implicitWidth: childrenRect.width + showFlag.indicator.width
implicitHeight: childrenRect.height
// Deliberately using this instead of Image to preserve visual fidelity
// with what the widget will show
Kirigami.Icon {
id: flagImage
width: Kirigami.Units.iconSizes.medium
height: Kirigami.Units.iconSizes.medium
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
source: KCMKeyboard.Flags.getIcon(root.layoutShortName)
visible: valid
}
RowLayout {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: Kirigami.Units.smallSpacing
width: visible ? implicitWidth : 0
height: visible ? implicitHeight : 0
visible: !flagImage.visible
Kirigami.Icon {
implicitWidth: Kirigami.Units.iconSizes.smallMedium
implicitHeight: Kirigami.Units.iconSizes.smallMedium
source: "emblem-warning"
}
Label {
text: i18nc("@info:placeholder Make this translation as short as possible", "No flag available")
}
}
}
}
RadioButton {
id: showLabelOverFlag
checked: cfg_displayStyle === 2
onToggled: cfg_displayStyle = 2;
contentItem: Item {
implicitWidth: childrenRect.width + showLabelOverFlag.indicator.width
implicitHeight: childrenRect.height
// Deliberately using this instead of Image to preserve visual fidelity
// with what the widget will show
Kirigami.Icon {
width: Kirigami.Units.iconSizes.medium
height: Kirigami.Units.iconSizes.medium
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
source: KCMKeyboard.Flags.getIcon(root.layoutShortName)
visible: valid
WorkspaceComponents.BadgeOverlay {
anchors.bottom: parent.bottom
anchors.right: parent.right
text: showLabel.text
icon: parent
}
}
}
}
Kirigami.Separator {
Kirigami.FormData.isSection: true
}
Button {
Kirigami.FormData.label: i18n("Layouts:")
text: i18n("Configure…")
icon.name: "configure"
onClicked: KCMLauncher.openSystemSettings("kcm_keyboard", "--tab=layouts")
}
Component.onCompleted: {
// hide Keyboard Shortcuts tab
var appletConfiguration = app
while (appletConfiguration.parent) {
appletConfiguration = appletConfiguration.parent
}
if (appletConfiguration && typeof appletConfiguration.globalConfigModel !== "undefined") {
appletConfiguration.globalConfigModel.removeCategoryAt(0)
}
}
}
}

View file

@ -0,0 +1,153 @@
/*
SPDX-FileCopyrightText: 2020 Andrey Butirsky <butirsky@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.15
import Qt.labs.platform 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.workspace.components 2.0
import org.kde.plasma.private.kcm_keyboard as KCMKeyboard
import org.kde.kirigami 2.20 as Kirigami
import org.kde.ksvg as KSvg
import QtQuick.Layouts
PlasmoidItem {
id: root
signal layoutSelected(int layoutIndex)
preferredRepresentation: fullRepresentation
toolTipMainText: Plasmoid.title
toolTipSubText: fullRepresentationItem ? fullRepresentationItem.layoutNames.longName : ""
fullRepresentation: KeyboardLayoutSwitcher {
id: switcher
hoverEnabled: true
Plasmoid.status: hasMultipleKeyboardLayouts ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus
property int widgetWidth: 24
Layout.minimumWidth: widgetWidth
Layout.maximumWidth: widgetWidth
Layout.preferredWidth: widgetWidth
PlasmaCore.ToolTipArea {
anchors.fill: parent
mainText: root.toolTipMainText
subText: root.toolTipSubText
}
Instantiator {
id: actionsInstantiator
model: switcher.keyboardLayout.layoutsList
delegate: PlasmaCore.Action {
text: modelData.longName
icon.icon: KCMKeyboard.Flags.getIcon(modelData.shortName)
onTriggered: {
layoutSelected(index);
}
}
onObjectAdded: (index, object) => {
Plasmoid.contextualActions.push(object)
}
onObjectRemoved: (index, object) => {
Plasmoid.contextualActions.splice(Plasmoid.contextualActions.indexOf(object), 1)
}
}
Connections {
target: switcher.keyboardLayout
function onLayoutChanged() {
root.Plasmoid.activated();
}
}
Connections {
target: root
function onLayoutSelected(layoutIndex) {
switcher.keyboardLayout.layout = layoutIndex;
}
}
Kirigami.Icon {
id: flag
anchors.fill: parent
visible: valid && (Plasmoid.configuration.displayStyle === 1 || Plasmoid.configuration.displayStyle === 2)
active: containsMouse
source: KCMKeyboard.Flags.getIcon(layoutNames.shortName)
BadgeOverlay {
anchors.bottom: parent.bottom
anchors.right: parent.right
visible: !countryCode.visible && Plasmoid.configuration.displayStyle === 2
text: countryCode.text
icon: flag
}
}
PlasmaComponents3.Label {
id: countryCode
anchors.fill: parent
visible: Plasmoid.configuration.displayStyle === 0 || !flag.valid
anchors.bottomMargin: Kirigami.Units.smallSpacing*2
anchors.topMargin: Kirigami.Units.smallSpacing*2 - Kirigami.Units.smallSpacing/2
minimumPointSize: 8
font.pointSize: countryCode.height * 0.75
font.capitalization: Font.AllUppercase
fontSizeMode: Text.Fit
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: layoutNames.displayName || layoutNames.shortName
rightPadding: Kirigami.Units.smallSpacing
leftPadding: Kirigami.Units.smallSpacing
}
MouseArea {
id: ma
property int margin: Kirigami.Units.smallSpacing/2+((0.4*switcher.height) - 9)
anchors.fill: parent
anchors.topMargin: margin
anchors.bottomMargin: margin
hoverEnabled: true
propagateComposedEvents: true
onClicked: (mouse) => {
mouse.accepted = false;
}
}
KSvg.FrameSvgItem {
id: decorationButton
z: -1
anchors.fill: parent
anchors.topMargin: ma.margin
anchors.bottomMargin: ma.margin
imagePath: Qt.resolvedUrl("svgs/button.svg")
visible: ma.containsMouse
prefix: {
var x = "keyboard-";
if(ma.containsMouse && !ma.containsPress) return x+"hover";
else if(ma.containsMouse && ma.containsPress) return x+"pressed";
else return "keyboard-hover";
}
}
}
function actionTriggered(actionName) {
const layoutIndex = parseInt(actionName);
if (!isNaN(layoutIndex)) {
layoutSelected(layoutIndex);
}
}
}

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 203 KiB

View file

@ -0,0 +1,197 @@
{
"KPackageStructure": "Plasma/Applet",
"KPlugin": {
"Authors": [
{
"Email": "butirsky@gmail.com",
"Name": "Andrey Butirsky",
"Name[ar]": "Andrey Butirsky",
"Name[az]": "Andrey Butirsky",
"Name[be]": "Andrey Butirsky",
"Name[bg]": "Andrey Butirsky",
"Name[ca@valencia]": "Andrey Butirsky",
"Name[ca]": "Andrey Butirsky",
"Name[cs]": "Andrey Butirsky",
"Name[da]": "Andrey Butirsky",
"Name[de]": "Andrey Butirsky",
"Name[en_GB]": "Andrey Butirsky",
"Name[eo]": "Andrey Butirsky",
"Name[es]": "Andrey Butirsky",
"Name[et]": "Andrey Butirsky",
"Name[eu]": "Andrey Butirsky",
"Name[fi]": "Andrey Butirsky",
"Name[fr]": "Andrey Butirsky",
"Name[gl]": "Andrey Butirsky",
"Name[he]": "אנדריי בוטירסקי",
"Name[hu]": "Andrey Butirsky",
"Name[ia]": "Andrey Butirsky",
"Name[id]": "Andrey Butirsky",
"Name[ie]": "Andrey Butirsky",
"Name[is]": "Andrey Butirsky",
"Name[it]": "Andrey Butirsky",
"Name[ja]": "Andrey Butirsky",
"Name[ka]": "ანდრეი ბუტირსკი",
"Name[ko]": "Andrey Butirsky",
"Name[lt]": "Andrey Butirsky",
"Name[lv]": "Andrey Butirsky",
"Name[nl]": "Andrey Butirsky",
"Name[nn]": "Andrey Butirsky",
"Name[pl]": "Andrey Butirsky",
"Name[pt]": "Andrey Butirsky",
"Name[pt_BR]": "Andrey Butirsky",
"Name[ro]": "Andrey Butirsky",
"Name[ru]": "Андрей Бутырский",
"Name[sk]": "Andrey Butirsky",
"Name[sl]": "Andrey Butirsky",
"Name[sv]": "Andrey Butirsky",
"Name[ta]": "ஆன்டிரே புடிர்ஸ்கி",
"Name[tr]": "Andrey Butirsky",
"Name[uk]": "Андрєй Бутирскій",
"Name[vi]": "Andrey Butirsky",
"Name[x-test]": "xxAndrey Butirskyxx",
"Name[zh_CN]": "Andrey Butirsky",
"Name[zh_TW]": "Andrey Butirsky"
}
],
"BugReportUrl": "https://bugs.kde.org/enter_bug.cgi?product=plasmashell&component=Keyboard%20Layout",
"Description": "Show/switch keyboard layout",
"Description[ar]": "اعرض/بدّل بين تخطيطات لوحات المفاتيح",
"Description[az]": "Klaviatura qatını göstərmək/dəyişmək",
"Description[be]": "Паказ і пераключэнне раскладкі клавіятуры",
"Description[bg]": "Превключване клавиатурна подредба",
"Description[ca@valencia]": "Mostra/canvia la disposició del teclat",
"Description[ca]": "Mostra/commuta la disposició del teclat",
"Description[cs]": "Zobrazit/přepnout rozvržení klávesnice",
"Description[da]": "Vis/skift tastaturlayout",
"Description[de]": "Tastaturbelegungen anzeigen/umschalten",
"Description[en_GB]": "Show/switch keyboard layout",
"Description[eo]": "Montri/ŝalti klavararanĝon",
"Description[es]": "Mostrar o cambiar la distribución del teclado",
"Description[et]": "Klaviatuuripaigutuste näitamine ja nende vahel lülitamine",
"Description[eu]": "Erakutsi/aldatu teklatu-antolaera",
"Description[fi]": "Näytä tai vaihda näppäimistöasettelu",
"Description[fr]": "Afficher / Basculer une disposition de clavier",
"Description[gl]": "Amosar ou alternar a disposición de teclado.",
"Description[he]": "הצגת/החלפת פריסת מקלדת",
"Description[hu]": "Billentyűzetkiosztások megjelenítése/váltása",
"Description[ia]": "Monstra/commuta disposition de claviero",
"Description[id]": "Tampilkan/alihkan tata letak keyboard",
"Description[ie]": "Monstrar o alterar li arangeament del tastatura",
"Description[is]": "Sýna/skipta um lyklaborðsskipan",
"Description[it]": "Mostra/Cambia la mappatura della tastiera",
"Description[ja]": "キーボードレイアウトの表示/切り替え",
"Description[ka]": "კლავიატურის განლაგების ჩვენების ჩართ/გამორთ",
"Description[ko]": "키보드 레이아웃 표시/전환",
"Description[lt]": "Rodyti/perjungti klaviatūros išdėstymą",
"Description[lv]": "Parādīt/pārslēgties starp tastatūras izkārtojumiem",
"Description[nl]": "Toon/schakel tussen toetsenbordindelingen",
"Description[nn]": "Vis/byt tastaturoppsett",
"Description[pa]": "ਕੀਬੋਰਡ ਲੇਆਉਟ ਵੇਖੋ/ਬਦਲੋ",
"Description[pl]": "Pokaż/przełącz układ klawiatury",
"Description[pt]": "Mostrar/mudar de disposição de teclado",
"Description[pt_BR]": "Mostrar/trocar o layout de teclado",
"Description[ro]": "Arată/schimbă aranjamentul de tastatură",
"Description[ru]": "Просмотр и переключение между раскладками клавиатуры",
"Description[sk]": "Zobraziť/prepnúť rozloženie klávesnice",
"Description[sl]": "Oglej/preklopi razporeditev tipk",
"Description[sv]": "Visa och byt tangentbordslayout",
"Description[ta]": "விசைப்பலகை தளவமைப்பை காட்டு/மாற்று",
"Description[tr]": "Klavye yerleşimini görüntüle/geçiş yap",
"Description[uk]": "Показати/Перемкнути розкладку клавіатури",
"Description[vi]": "Hiện/chuyển bố cục bàn phím",
"Description[x-test]": "xxShow/switch keyboard layoutxx",
"Description[zh_CN]": "显示/切换键盘布局",
"Description[zh_TW]": "顯示/切換鍵盤佈局",
"EnabledByDefault": true,
"Icon": "input-keyboard",
"Id": "org.kde.plasma.keyboardlayout",
"License": "GPL-2.0+",
"Name": "Keyboard Layout",
"Name[af]": "Sleutelbord Uitleg",
"Name[ar]": "تخطيط لوحة المفاتيح",
"Name[az]": "Klaviatura qatı",
"Name[be@latin]": "Vykład klavijatury",
"Name[be]": "Раскладка клавіятуры",
"Name[bg]": "Клавиатурни подредби",
"Name[bn]": "কীবোর্ড বিন্যাস",
"Name[bn_IN]": "কি-বোর্ড বিন্যাস",
"Name[br]": "Reizhadur ar stokellaoueg",
"Name[ca@valencia]": "Disposició del teclat",
"Name[ca]": "Disposició del teclat",
"Name[cs]": "Rozvržení klávesnice",
"Name[csb]": "Ùstôw klawiaturë",
"Name[cy]": "Cynllun Bysellfwrdd",
"Name[da]": "Tastaturlayout",
"Name[de]": "Tastaturbelegung",
"Name[el]": "Διάταξη πληκτρολογίου",
"Name[en_GB]": "Keyboard Layout",
"Name[eo]": "Klavararanĝo",
"Name[es]": "Distribución del teclado",
"Name[et]": "Klaviatuuri paigutus",
"Name[eu]": "Teklatu-diseinua",
"Name[fa]": "طرح‌بندی صفحه کلید",
"Name[fi]": "Näppäinasettelu",
"Name[fr]": "Disposition du clavier",
"Name[fy]": "Toetseboerdyndieling",
"Name[ga]": "Leagan Amach Méarchláir",
"Name[gl]": "Disposición do teclado",
"Name[gu]": "કીબોર્ડ દેખાવ",
"Name[he]": "פריסת מקלדת",
"Name[hi]": "कुंजीपट ख़ाका",
"Name[hne]": "कुंजीपट खाका",
"Name[hr]": "Raspored tipkovnice",
"Name[hsb]": "Tastaturowy layout",
"Name[hu]": "Billentyűzetkiosztás",
"Name[ia]": "Disposition de claviero",
"Name[id]": "Tata Letak Keyboard",
"Name[ie]": "Arangeament de tastatura",
"Name[is]": "Lyklaborðsskipan",
"Name[it]": "Mappatura della tastiera",
"Name[ja]": "キーボード配列",
"Name[ka]": "კლავიატურის განლაგება",
"Name[kk]": "Перенетақта сәйкестігі",
"Name[km]": "ប្លង់​ក្ដារចុច",
"Name[kn]": "ಕೀಲಿಮಣೆ ವಿನ್ಯಾಸ",
"Name[ko]": "키보드 레이아웃",
"Name[ku]": "Rengê Klavyeyê",
"Name[lt]": "Klaviatūros išdėstymas",
"Name[lv]": "Tastatūras izkārtojums",
"Name[mai]": "कीबोर्ड लेआउट",
"Name[mk]": "Распоред на тастатура",
"Name[mr]": "कळफलक रचना",
"Name[nds]": "Tasttoornen",
"Name[ne]": "कुञ्जीपाटी सजावट",
"Name[nl]": "Toetsenbordindeling",
"Name[nn]": "Tastatur­oppsett",
"Name[oc]": "Disposicion del clavièr",
"Name[or]": "କିବୋର୍ଡ଼ ବିନ୍ୟାସ",
"Name[pa]": "ਕੀ-ਬੋਰਡ ਲੇਆਉਟ",
"Name[pl]": "Układ klawiatury",
"Name[pt]": "Disposição do Teclado",
"Name[pt_BR]": "Layout do teclado",
"Name[ro]": "Aranjament de tastatură",
"Name[ru]": "Раскладка клавиатуры",
"Name[si]": "යතුරුපුවරු ආකෘතිය",
"Name[sk]": "Rozloženie klávesnice",
"Name[sl]": "Razporeditev tipk",
"Name[sv]": "Tangentbordslayout",
"Name[ta]": "விசைப்பலகை தளவமைப்பு",
"Name[te]": "కీబోర్డ్ కూర్పు",
"Name[tg]": "Тугмабандии клавиатура",
"Name[th]": "ผังแป้นพิมพ์",
"Name[tr]": "Klavye Yerleşimi",
"Name[ug]": "ھەرپتاختا ئورۇنلاشتۇرۇلۇشى",
"Name[uk]": "Розкладка клавіатури",
"Name[uz@cyrillic]": "Тугмалар тартиби",
"Name[uz]": "Tugmalar tartibi",
"Name[vi]": "Bố cục bàn phím",
"Name[wa]": "Adjinçmint del taprece",
"Name[x-test]": "xxKeyboard Layoutxx",
"Name[xh]": "Ubeko Lwebhodi yezitshixo",
"Name[zh_CN]": "键盘布局",
"Name[zh_TW]": "鍵盤佈局",
"Website": "https://kde.org/plasma-desktop/"
},
"X-Plasma-API-Minimum-Version": "6.0",
"X-Plasma-NotificationAreaCategory": "Hardware"
}