Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Make Style Preset add/edit buttons layout a bit nicer.

Wolthera van Hövell tot Westerflier242ab4a55fa6
diff --git a/plugins/dockers/textproperties/qml/ResourceView.qml b/plugins/dockers/textproperties/qml/ResourceView.qml
index 5fe1a7ab3e..bd7be72290 100644
--- a/plugins/dockers/textproperties/qml/ResourceView.qml
+++ b/plugins/dockers/textproperties/qml/ResourceView.qml
@@ -20,7 +20,7 @@ Control {
property alias resourceDelegate : view.delegate;
property alias addResourceRow: addResourceRow;
- property alias additionalAddResourceRow: addResourceRowExtra.data;
+ property alias additionalAddResourceRow: addResourceRow.data;
function openContextMenu(x, y, resourceName, resourceIndex) {
tagActionsContextMenu.resourceName = resourceName;
@@ -212,17 +212,18 @@ Control {
RowLayout {
id: addResourceRow;
- height: visible? implicitContentHeight: 0;
+ height: visible? implicitHeight: 0;
ToolButton {
id: importResource;
palette: control.palette;
icon.source: "qrc:///light_document-import-16.svg";
icon.width: 16;
- icon.height: 16;
icon.color: palette.text;
hoverEnabled: true;
ToolTip.text: i18nc("@info:tooltip", "Import Resource");
+ display: AbstractButton.IconOnly;
+ text: ToolTip.text;
ToolTip.visible: hovered;
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval;
@@ -234,21 +235,16 @@ Control {
palette: control.palette;
icon.source: "qrc:///light_edit-delete.svg";
icon.width: 16;
- icon.height: 16;
icon.color: palette.text;
hoverEnabled: true;
ToolTip.text: i18nc("@info:tooltip", "Remove Resource");
+ display: AbstractButton.IconOnly;
+ text: ToolTip.text;
ToolTip.visible: hovered;
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval;
onClicked: modelWrapper.removeResource();
}
-
- Item {
- id: addResourceRowExtra;
- Layout.fillWidth: true;
- Layout.fillHeight: true;
- }
}
}
}
diff --git a/plugins/dockers/textproperties/qml/TextProperties.qml b/plugins/dockers/textproperties/qml/TextProperties.qml
index b40357714f..a93d68c8ef 100644
--- a/plugins/dockers/textproperties/qml/TextProperties.qml
+++ b/plugins/dockers/textproperties/qml/TextProperties.qml
@@ -143,20 +143,39 @@ Rectangle {
}
}
additionalAddResourceRow: RowLayout {
+ height: implicitHeight;
+ width: parent.width;
+ Layout.alignment: Qt.AlignRight;
+
+ Item {
+ Layout.fillWidth: true;
+ }
+
ToolButton {
text: i18nc("@label:button", "Add Style Preset");
+ display: AbstractButton.IconOnly;
icon.source: "qrc:///light_list-add.svg";
icon.color: palette.text;
icon.width: 16;
icon.height: 16;
onClicked: mainWindow.createNewPresetFromSettings();
+ hoverEnabled: true;
+ ToolTip.text: text;
+ ToolTip.visible: hovered;
+ ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval;
}
ToolButton {
+ text: i18nc("@label:button", "Edit Style Preset");
+ display: AbstractButton.IconOnly;
icon.source: "qrc:///16_light_edit-rename.svg";
icon.color: palette.text;
icon.width: 16;
icon.height: 16;
onClicked: mainWindow.editPreset(presetView.currentResource);
+ hoverEnabled: true;
+ ToolTip.visible: hovered;
+ ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval;
+ ToolTip.text: text;
}
}
}