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++

Add some more polish to resource dropdown.

Wolthera van Hövell tot Westerfliere76b9db58484
diff --git a/qmlmodules/components/qml/ResourceView.qml b/qmlmodules/components/qml/ResourceView.qml
index 4f554eee43..f6f161bb71 100644
--- a/qmlmodules/components/qml/ResourceView.qml
+++ b/qmlmodules/components/qml/ResourceView.qml
@@ -23,6 +23,7 @@ Control {
target: modelWrapper;
function onCurrentIndexChanged() {
control.highlightedIndex = modelWrapper.currentIndex;
+ view.positionViewAtIndex(modelWrapper.currentIndex, ListView.Center);
}
function onResourceTypeChanged() {
control.resourceType = modelWrapper.resourceType;
@@ -208,11 +209,18 @@ Control {
id: newTagName;
placeholderText: i18nc("@info:placeholder", "New Tag Name...");
Layout.fillWidth: true;
+ onAccepted: {
+ addTagButton.addTag();
+ }
}
ToolButton {
+ id: addTagButton;
icon.source: "qrc:///light_list-add.svg";
icon.color: palette.text;
onClicked: {
+ addTag();
+ }
+ function addTag() {
modelWrapper.addNewTag(newTagName.text, tagActionsContextMenu.resourceIndex);
newTagName.text = "";
tagActionsContextMenu.updateAndDismiss();