mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-16 17:22:45 -04:00
text: change default rendering back to Qt
This commit is contained in:
@@ -718,7 +718,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
text: root.gridEnabled ? I18n.tr("Grid: ON", "Widget grid snap status") : I18n.tr("Grid: OFF", "Widget grid snap status")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.family: Theme.fontFamily
|
||||
@@ -733,7 +733,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
text: root.gridSize + "px"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.family: Theme.fontFamily
|
||||
@@ -748,7 +748,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
text: I18n.tr("G: grid • Z/X: size", "Widget grid keyboard hints")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.family: Theme.fontFamily
|
||||
|
||||
@@ -16,38 +16,38 @@ Column {
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Component.onCompleted: {
|
||||
const settings = findSettings()
|
||||
const settings = findSettings();
|
||||
if (settings) {
|
||||
items = settings.loadValue(settingKey, defaultValue)
|
||||
items = settings.loadValue(settingKey, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
onItemsChanged: {
|
||||
const settings = findSettings()
|
||||
const settings = findSettings();
|
||||
if (settings) {
|
||||
settings.saveValue(settingKey, items)
|
||||
settings.saveValue(settingKey, items);
|
||||
}
|
||||
}
|
||||
|
||||
function findSettings() {
|
||||
let item = parent
|
||||
let item = parent;
|
||||
while (item) {
|
||||
if (item.saveValue !== undefined && item.loadValue !== undefined) {
|
||||
return item
|
||||
return item;
|
||||
}
|
||||
item = item.parent
|
||||
item = item.parent;
|
||||
}
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
function addItem(item) {
|
||||
items = items.concat([item])
|
||||
items = items.concat([item]);
|
||||
}
|
||||
|
||||
function removeItem(index) {
|
||||
const newItems = items.slice()
|
||||
newItems.splice(index, 1)
|
||||
items = newItems
|
||||
const newItems = items.slice();
|
||||
newItems.splice(index, 1);
|
||||
items = newItems;
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -123,7 +123,7 @@ Column {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
root.removeItem(index)
|
||||
root.removeItem(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,47 +18,47 @@ Column {
|
||||
property bool isLoading: false
|
||||
|
||||
Component.onCompleted: {
|
||||
loadValue()
|
||||
loadValue();
|
||||
}
|
||||
|
||||
function loadValue() {
|
||||
const settings = findSettings()
|
||||
const settings = findSettings();
|
||||
if (settings) {
|
||||
isLoading = true
|
||||
items = settings.loadValue(settingKey, defaultValue)
|
||||
isLoading = false
|
||||
isLoading = true;
|
||||
items = settings.loadValue(settingKey, defaultValue);
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
onItemsChanged: {
|
||||
if (isLoading) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
const settings = findSettings()
|
||||
const settings = findSettings();
|
||||
if (settings) {
|
||||
settings.saveValue(settingKey, items)
|
||||
settings.saveValue(settingKey, items);
|
||||
}
|
||||
}
|
||||
|
||||
function findSettings() {
|
||||
let item = parent
|
||||
let item = parent;
|
||||
while (item) {
|
||||
if (item.saveValue !== undefined && item.loadValue !== undefined) {
|
||||
return item
|
||||
return item;
|
||||
}
|
||||
item = item.parent
|
||||
item = item.parent;
|
||||
}
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
function addItem(item) {
|
||||
items = items.concat([item])
|
||||
items = items.concat([item]);
|
||||
}
|
||||
|
||||
function removeItem(index) {
|
||||
const newItems = items.slice()
|
||||
newItems.splice(index, 1)
|
||||
items = newItems
|
||||
const newItems = items.slice();
|
||||
newItems.splice(index, 1);
|
||||
items = newItems;
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -110,11 +110,11 @@ Column {
|
||||
placeholderText: modelData.placeholder || ""
|
||||
|
||||
Component.onCompleted: {
|
||||
inputRow.inputFields.push(this)
|
||||
inputRow.inputFields.push(this);
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
addButton.clicked()
|
||||
addButton.clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,32 +126,32 @@ Column {
|
||||
text: I18n.tr("Add")
|
||||
|
||||
onClicked: {
|
||||
let newItem = {}
|
||||
let hasValue = false
|
||||
let newItem = {};
|
||||
let hasValue = false;
|
||||
|
||||
for (let i = 0; i < root.fields.length; i++) {
|
||||
const field = root.fields[i]
|
||||
const input = inputRow.inputFields[i]
|
||||
const value = input.text.trim()
|
||||
const field = root.fields[i];
|
||||
const input = inputRow.inputFields[i];
|
||||
const value = input.text.trim();
|
||||
|
||||
if (value !== "") {
|
||||
hasValue = true
|
||||
hasValue = true;
|
||||
}
|
||||
|
||||
if (field.required && value === "") {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
newItem[field.id] = value || (field.default || "")
|
||||
newItem[field.id] = value || (field.default || "");
|
||||
}
|
||||
|
||||
if (hasValue) {
|
||||
root.addItem(newItem)
|
||||
root.addItem(newItem);
|
||||
for (let i = 0; i < inputRow.inputFields.length; i++) {
|
||||
inputRow.inputFields[i].text = ""
|
||||
inputRow.inputFields[i].text = "";
|
||||
}
|
||||
if (inputRow.inputFields.length > 0) {
|
||||
inputRow.inputFields[0].forceActiveFocus()
|
||||
inputRow.inputFields[0].forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,13 +200,13 @@ Column {
|
||||
required property var modelData
|
||||
|
||||
text: {
|
||||
const field = modelData
|
||||
const item = itemRow.itemData
|
||||
const field = modelData;
|
||||
const item = itemRow.itemData;
|
||||
if (!field || !field.id || !item) {
|
||||
return ""
|
||||
return "";
|
||||
}
|
||||
const value = item[field.id]
|
||||
return value || ""
|
||||
const value = item[field.id];
|
||||
return value || "";
|
||||
}
|
||||
color: Theme.surfaceText
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
@@ -239,7 +239,7 @@ Column {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
root.removeItem(index)
|
||||
root.removeItem(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,32 +20,32 @@ Column {
|
||||
spacing: Theme.spacingS
|
||||
|
||||
function loadValue() {
|
||||
const settings = findSettings()
|
||||
const settings = findSettings();
|
||||
if (settings && settings.pluginService) {
|
||||
value = settings.loadValue(settingKey, defaultValue)
|
||||
value = settings.loadValue(settingKey, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
loadValue()
|
||||
loadValue();
|
||||
}
|
||||
|
||||
onValueChanged: {
|
||||
const settings = findSettings()
|
||||
const settings = findSettings();
|
||||
if (settings) {
|
||||
settings.saveValue(settingKey, value)
|
||||
settings.saveValue(settingKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
function findSettings() {
|
||||
let item = parent
|
||||
let item = parent;
|
||||
while (item) {
|
||||
if (item.saveValue !== undefined && item.loadValue !== undefined) {
|
||||
return item
|
||||
return item;
|
||||
}
|
||||
item = item.parent
|
||||
item = item.parent;
|
||||
}
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -75,7 +75,7 @@ Column {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
root.value = newValue
|
||||
root.value = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,35 +17,36 @@ Row {
|
||||
property bool isInitialized: false
|
||||
|
||||
function loadValue() {
|
||||
const settings = findSettings()
|
||||
const settings = findSettings();
|
||||
if (settings && settings.pluginService) {
|
||||
const loadedValue = settings.loadValue(settingKey, defaultValue)
|
||||
value = loadedValue
|
||||
isInitialized = true
|
||||
const loadedValue = settings.loadValue(settingKey, defaultValue);
|
||||
value = loadedValue;
|
||||
isInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
Qt.callLater(loadValue)
|
||||
Qt.callLater(loadValue);
|
||||
}
|
||||
|
||||
onValueChanged: {
|
||||
if (!isInitialized) return
|
||||
const settings = findSettings()
|
||||
if (!isInitialized)
|
||||
return;
|
||||
const settings = findSettings();
|
||||
if (settings) {
|
||||
settings.saveValue(settingKey, value)
|
||||
settings.saveValue(settingKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
function findSettings() {
|
||||
let item = parent
|
||||
let item = parent;
|
||||
while (item) {
|
||||
if (item.saveValue !== undefined && item.loadValue !== undefined) {
|
||||
return item
|
||||
return item;
|
||||
}
|
||||
item = item.parent
|
||||
item = item.parent;
|
||||
}
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
Column {
|
||||
@@ -75,7 +76,7 @@ Row {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: root.value
|
||||
onToggled: isChecked => {
|
||||
root.value = isChecked
|
||||
root.value = isChecked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user