feat: sostituzione faux-cirillica (homoglyph) sui testi statici
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls 2.15 as QQC2
|
||||||
|
import "fauxcyrillic.js" as Faux
|
||||||
|
|
||||||
|
|
||||||
// Selettore a tendina etichettato in stile costruttivista.
|
// Selettore a tendina etichettato in stile costruttivista.
|
||||||
@@ -21,7 +22,7 @@ Column {
|
|||||||
spacing: 4
|
spacing: 4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: comboWrap.label
|
text: Faux.apply(comboWrap.label)
|
||||||
color: "#f0dfba"
|
color: "#f0dfba"
|
||||||
font.family: themeFont.name
|
font.family: themeFont.name
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
import "fauxcyrillic.js" as Faux
|
||||||
|
|
||||||
|
|
||||||
// Campo di input etichettato in stile costruttivista.
|
// Campo di input etichettato in stile costruttivista.
|
||||||
@@ -20,7 +21,7 @@ Column {
|
|||||||
spacing: 4
|
spacing: 4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: field.label
|
text: Faux.apply(field.label)
|
||||||
color: "#f0dfba"
|
color: "#f0dfba"
|
||||||
font.family: themeFont.name
|
font.family: themeFont.name
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
|
import "fauxcyrillic.js" as Faux
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
@@ -38,7 +39,7 @@ Rectangle {
|
|||||||
function tryLogin() {
|
function tryLogin() {
|
||||||
var username = userModel.count > 0 ? root.selectedUser : userField.text
|
var username = userModel.count > 0 ? root.selectedUser : userField.text
|
||||||
if (username.length === 0) {
|
if (username.length === 0) {
|
||||||
errorText.text = "INSERISCI L'UTENTE"
|
errorText.text = Faux.apply("INSERISCI L'UTENTE")
|
||||||
shake.start()
|
shake.start()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -137,7 +138,7 @@ Rectangle {
|
|||||||
Text {
|
Text {
|
||||||
id: dateText
|
id: dateText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
text: root.italianDate(new Date())
|
text: Faux.apply(root.italianDate(new Date()))
|
||||||
color: "#ef6a55"
|
color: "#ef6a55"
|
||||||
font.family: themeFont.name
|
font.family: themeFont.name
|
||||||
font.pixelSize: Math.max(13, Math.min(root.width * 0.014, 22))
|
font.pixelSize: Math.max(13, Math.min(root.width * 0.014, 22))
|
||||||
@@ -151,7 +152,7 @@ Rectangle {
|
|||||||
running: true
|
running: true
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
clockText.text = Qt.formatTime(new Date(), "HH:mm")
|
clockText.text = Qt.formatTime(new Date(), "HH:mm")
|
||||||
dateText.text = root.italianDate(new Date())
|
dateText.text = Faux.apply(root.italianDate(new Date()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,7 +209,7 @@ Rectangle {
|
|||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "ACCESSO"
|
text: Faux.apply("ACCESSO")
|
||||||
color: root.cream
|
color: root.cream
|
||||||
font.family: themeFont.name
|
font.family: themeFont.name
|
||||||
font.pixelSize: Math.max(20, Math.min(root.width * 0.024, 34))
|
font.pixelSize: Math.max(20, Math.min(root.width * 0.024, 34))
|
||||||
@@ -217,7 +218,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "INSERISCI LE CREDENZIALI"
|
text: Faux.apply("INSERISCI LE CREDENZIALI")
|
||||||
color: "#e85a48"
|
color: "#e85a48"
|
||||||
font.family: themeFont.name
|
font.family: themeFont.name
|
||||||
font.pixelSize: Math.max(10, Math.min(root.width * 0.011, 15))
|
font.pixelSize: Math.max(10, Math.min(root.width * 0.011, 15))
|
||||||
@@ -289,7 +290,7 @@ Rectangle {
|
|||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: "ENTRA"
|
text: Faux.apply("ENTRA")
|
||||||
color: root.paper
|
color: root.paper
|
||||||
font.bold: true
|
font.bold: true
|
||||||
font.letterSpacing: 3
|
font.letterSpacing: 3
|
||||||
@@ -392,7 +393,7 @@ Rectangle {
|
|||||||
Connections {
|
Connections {
|
||||||
target: sddm
|
target: sddm
|
||||||
function onLoginFailed() {
|
function onLoginFailed() {
|
||||||
errorText.text = "ACCESSO NEGATO"
|
errorText.text = Faux.apply("ACCESSO NEGATO")
|
||||||
passField.text = ""
|
passField.text = ""
|
||||||
shake.start()
|
shake.start()
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
import "fauxcyrillic.js" as Faux
|
||||||
|
|
||||||
|
|
||||||
// Pulsante di sistema (sospendi / riavvia / spegni).
|
// Pulsante di sistema (sospendi / riavvia / spegni).
|
||||||
@@ -21,7 +22,7 @@ Rectangle {
|
|||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: pbtn.label
|
text: Faux.apply(pbtn.label)
|
||||||
color: pbtn.enabled ? "#f0dfba" : "#aaf0dfba"
|
color: pbtn.enabled ? "#f0dfba" : "#aaf0dfba"
|
||||||
font.family: themeFont.name
|
font.family: themeFont.name
|
||||||
font.pixelSize: 13
|
font.pixelSize: 13
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -0,0 +1,23 @@
|
|||||||
|
// Sostituzione faux-cirillica: lettere latine → omologhe cirilliche
|
||||||
|
// visivamente identiche (homoglyph), per l'effetto manifesto sovietico.
|
||||||
|
// Le lettere senza omologo convincente (S, N, R, D, G, I, L, U, V, W, Z, F, Q, J)
|
||||||
|
// restano latine per mantenere la leggibilità.
|
||||||
|
.pragma library
|
||||||
|
|
||||||
|
var MAP = {
|
||||||
|
'A': '\u0410', 'B': '\u0412', 'E': '\u0415', 'K': '\u041A', 'M': '\u041C',
|
||||||
|
'H': '\u041D', 'O': '\u041E', 'P': '\u0420', 'C': '\u0421', 'T': '\u0422',
|
||||||
|
'X': '\u0425', 'Y': '\u0423',
|
||||||
|
'a': '\u0430', 'e': '\u0435', 'k': '\u043A', 'm': '\u043C', 'h': '\u043D',
|
||||||
|
'o': '\u043E', 'p': '\u0440', 'c': '\u0441', 't': '\u0442', 'x': '\u0445',
|
||||||
|
'y': '\u0443'
|
||||||
|
};
|
||||||
|
|
||||||
|
function apply(text) {
|
||||||
|
var out = '';
|
||||||
|
for (var i = 0; i < text.length; i++) {
|
||||||
|
var ch = text.charAt(i);
|
||||||
|
out += MAP[ch] !== undefined ? MAP[ch] : ch;
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user