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

Implement unicode bidi controls and allow span selection to control whether it is visible.

Wolthera van Hövell tot Westerflier030de81c6a3e
diff --git a/libs/flake/text/lager/KoSvgTextPropertiesModel.cpp b/libs/flake/text/lager/KoSvgTextPropertiesModel.cpp
index f721b2fa08..c9481c5881 100644
--- a/libs/flake/text/lager/KoSvgTextPropertiesModel.cpp
+++ b/libs/flake/text/lager/KoSvgTextPropertiesModel.cpp
@@ -198,6 +198,8 @@ KoSvgTextPropertiesModel::KoSvgTextPropertiesModel(lager::cursor<KoSvgTextProper
, LAGER_QT(writingModeState) {textData.zoom(propertyModifyState(KoSvgTextProperties::WritingModeId))}
, LAGER_QT(direction) {textData.zoom(createTextProperty(KoSvgTextProperties::DirectionId)).zoom(integerProperty)}
, LAGER_QT(directionState) {textData.zoom(propertyModifyState(KoSvgTextProperties::DirectionId))}
+ , LAGER_QT(unicodeBidi) {textData.zoom(createTextProperty(KoSvgTextProperties::UnicodeBidiId)).zoom(integerProperty)}
+ , LAGER_QT(unicodeBidiState) {textData.zoom(propertyModifyState(KoSvgTextProperties::UnicodeBidiId))}
, LAGER_QT(textAlignAll) {textData.zoom(createTextProperty(KoSvgTextProperties::TextAlignAllId)).zoom(integerProperty)}
, LAGER_QT(textAlignAllState) {textData.zoom(propertyModifyState(KoSvgTextProperties::TextAlignAllId))}
, LAGER_QT(textAlignLast) {textData.zoom(createTextProperty(KoSvgTextProperties::TextAlignLastId)).zoom(integerProperty)}
diff --git a/libs/flake/text/lager/KoSvgTextPropertiesModel.h b/libs/flake/text/lager/KoSvgTextPropertiesModel.h
index 15ceeff951..03f23f7ff0 100644
--- a/libs/flake/text/lager/KoSvgTextPropertiesModel.h
+++ b/libs/flake/text/lager/KoSvgTextPropertiesModel.h
@@ -88,6 +88,8 @@ public:
LAGER_QT_CURSOR(PropertyState, writingModeState);
LAGER_QT_CURSOR(int, direction);
LAGER_QT_CURSOR(PropertyState, directionState);
+ LAGER_QT_CURSOR(int, unicodeBidi);
+ LAGER_QT_CURSOR(PropertyState, unicodeBidiState);
LAGER_QT_CURSOR(int, textAlignAll);
LAGER_QT_CURSOR(PropertyState, textAlignAllState);
LAGER_QT_CURSOR(int, textAlignLast);
diff --git a/plugins/dockers/textproperties/qml/AlignmentBaseline.qml b/plugins/dockers/textproperties/qml/AlignmentBaseline.qml
index 7dccf059e6..9ff403dfe5 100644
--- a/plugins/dockers/textproperties/qml/AlignmentBaseline.qml
+++ b/plugins/dockers/textproperties/qml/AlignmentBaseline.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label:listbox", "Alignment Baseline");
+ propertyType: TextPropertyBase.Character;
property int baselineSelection;
onPropertiesUpdated: {
diff --git a/plugins/dockers/textproperties/qml/BaselineShift.qml b/plugins/dockers/textproperties/qml/BaselineShift.qml
index f27dd084f1..d73075d19b 100644
--- a/plugins/dockers/textproperties/qml/BaselineShift.qml
+++ b/plugins/dockers/textproperties/qml/BaselineShift.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label", "Baseline-Shift")
+ propertyType: TextPropertyBase.Character;
property alias baselineShiftValue: baselineShiftSpn.value;
property int baselineShiftMode;
diff --git a/plugins/dockers/textproperties/qml/Direction.qml b/plugins/dockers/textproperties/qml/Direction.qml
index 97892b308c..c3ab60ec49 100644
--- a/plugins/dockers/textproperties/qml/Direction.qml
+++ b/plugins/dockers/textproperties/qml/Direction.qml
@@ -10,12 +10,18 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label:listbox", "Direction")
+ propertyType: TextPropertyBase.Mixed;
property int direction;
+ property int unicodeBidi;
onPropertiesUpdated: {
blockSignals = true;
direction = properties.direction;
- visible = properties.directionState !== KoSvgTextPropertiesModel.PropertyUnset;
+ unicodeBidi = properties.unicodeBidi;
+ var set = properties.directionState !== KoSvgTextPropertiesModel.PropertyUnset;
+ var pType = parentPropertyType === TextPropertyBase.Paragraph? !properties.spanSelection: properties.spanSelection;
+ console.log("set", set, "type matches", pType)
+ visible = set && pType;
blockSignals = false;
}
@@ -26,9 +32,17 @@ TextPropertyBase {
}
}
- RowLayout {
+ onUnicodeBidiChanged: {
+ unicodeBidiCmb.currentIndex = unicodeBidiCmb.indexOfValue(unicodeBidi);
+ if (!blockSignals) {
+ properties.unicodeBidi = unicodeBidi;
+ }
+ }
+
+ GridLayout {
id: row
- spacing: columnSpacing;
+ columns: 3
+ columnSpacing: parent.columnSpacing;
width: parent.width;
RevertPropertyButton {
@@ -53,5 +67,35 @@ TextPropertyBase {
valueRole: "value";
onActivated: direction = currentValue;
}
+
+ RevertPropertyButton {
+ visible: parentPropertyType === TextPropertyBase.Character;
+ revertEnabled: properties.unicodeBidiState === KoSvgTextPropertiesModel.PropertySet;
+ onClicked: properties.unicodeBidiState = KoSvgTextPropertiesModel.PropertyUnset;
+ }
+
+ Label {
+ text: i18nc("@label:listbox", "Unicode-Bidi");
+ elide: Text.ElideRight;
+ Layout.fillWidth: true;
+ visible: parentPropertyType === TextPropertyBase.Character;
+ }
+
+ ComboBox {
+ id: unicodeBidiCmb
+ visible: parentPropertyType === TextPropertyBase.Character;
+ Layout.fillWidth: true;
+ model: [
+ {text: i18nc("@label:inlistbox", "Normal"), value: KoSvgText.BidiNormal},
+ {text: i18nc("@label:inlistbox", "Embed"), value: KoSvgText.BidiEmbed},
+ {text: i18nc("@label:inlistbox", "Override"), value: KoSvgText.BidiOverride},
+ {text: i18nc("@label:inlistbox", "Isolate"), value: KoSvgText.BidiIsolate},
+ {text: i18nc("@label:inlistbox", "Isolate-Override"), value: KoSvgText.BidiIsolateOverride},
+ {text: i18nc("@label:inlistbox", "Plain Text"), value: KoSvgText.BidiPlainText}
+ ]
+ textRole: "text";
+ valueRole: "value";
+ onActivated: unicodeBidi = currentValue;
+ }
}
}
diff --git a/plugins/dockers/textproperties/qml/DominantBaseline.qml b/plugins/dockers/textproperties/qml/DominantBaseline.qml
index 4836be5347..65b11b2c87 100644
--- a/plugins/dockers/textproperties/qml/DominantBaseline.qml
+++ b/plugins/dockers/textproperties/qml/DominantBaseline.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label:listbox", "Dominant Baseline")
+ propertyType: TextPropertyBase.Paragraph;
property int baselineSelection
onPropertiesUpdated: {
diff --git a/plugins/dockers/textproperties/qml/FontFamily.qml b/plugins/dockers/textproperties/qml/FontFamily.qml
index 06f2766a14..b7b5f2159e 100644
--- a/plugins/dockers/textproperties/qml/FontFamily.qml
+++ b/plugins/dockers/textproperties/qml/FontFamily.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
CollapsibleGroupProperty {
propertyName: i18nc("@label", "Font Family");
+ propertyType: TextPropertyBase.Character;
property var fontFamilies: [];
property var fontFamilyModel : [];
diff --git a/plugins/dockers/textproperties/qml/FontSize.qml b/plugins/dockers/textproperties/qml/FontSize.qml
index 75cf2c02f2..20ce130568 100644
--- a/plugins/dockers/textproperties/qml/FontSize.qml
+++ b/plugins/dockers/textproperties/qml/FontSize.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label:spinbox", "Font Size");
+ propertyType: TextPropertyBase.Character;
property alias fontSize: fontSizeSpn.value;
diff --git a/plugins/dockers/textproperties/qml/FontStyle.qml b/plugins/dockers/textproperties/qml/FontStyle.qml
index 8f1a0b7180..ca0a030232 100644
--- a/plugins/dockers/textproperties/qml/FontStyle.qml
+++ b/plugins/dockers/textproperties/qml/FontStyle.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
CollapsibleGroupProperty {
propertyName: i18nc("@label", "Font Style");
+ propertyType: TextPropertyBase.Character;
property alias fontWeight: fontWeightSpn.value;
property alias fontWidth: fontStretchSpn.value;
diff --git a/plugins/dockers/textproperties/qml/HangingPunctuation.qml b/plugins/dockers/textproperties/qml/HangingPunctuation.qml
index 4ce06f8f17..160a3617fb 100644
--- a/plugins/dockers/textproperties/qml/HangingPunctuation.qml
+++ b/plugins/dockers/textproperties/qml/HangingPunctuation.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label", "Hanging-punctuation");
+ propertyType: TextPropertyBase.Paragraph;
property alias hangStart: paragraphStartCbx.checked;
property alias hangEnd: paragraphEndCbx.checked;
property int hangComma: KoSvgTextPropertiesModel.NoHang;
diff --git a/plugins/dockers/textproperties/qml/LetterSpacing.qml b/plugins/dockers/textproperties/qml/LetterSpacing.qml
index fa3bf41110..fd95ff3ee9 100644
--- a/plugins/dockers/textproperties/qml/LetterSpacing.qml
+++ b/plugins/dockers/textproperties/qml/LetterSpacing.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label:spinbox", "Letter Spacing");
+ propertyType: TextPropertyBase.Character;
property alias letterSpacing: letterSpacingSpn.value;
onPropertiesUpdated: {
diff --git a/plugins/dockers/textproperties/qml/LineBreak.qml b/plugins/dockers/textproperties/qml/LineBreak.qml
index af3c90ee46..ebd2d1d1d0 100644
--- a/plugins/dockers/textproperties/qml/LineBreak.qml
+++ b/plugins/dockers/textproperties/qml/LineBreak.qml
@@ -12,6 +12,7 @@ TextPropertyBase {
property int breakType;
propertyName: i18nc("@label:listbox", "Line Break");
+ propertyType: TextPropertyBase.Character;
onPropertiesUpdated: {
blockSignals = true;
diff --git a/plugins/dockers/textproperties/qml/LineHeight.qml b/plugins/dockers/textproperties/qml/LineHeight.qml
index 9af426b96c..cc76e7a5fb 100644
--- a/plugins/dockers/textproperties/qml/LineHeight.qml
+++ b/plugins/dockers/textproperties/qml/LineHeight.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label", "Line Height");
+ propertyType: TextPropertyBase.Character;
property alias isNormal: lineHeightNormalCbx.checked;
property alias lineHeight: lineHeightSpn.value;
property int lineHeightUnit: LineHeightModel.Lines;
diff --git a/plugins/dockers/textproperties/qml/TabSize.qml b/plugins/dockers/textproperties/qml/TabSize.qml
index bfde0fb4e2..427dfc9a73 100644
--- a/plugins/dockers/textproperties/qml/TabSize.qml
+++ b/plugins/dockers/textproperties/qml/TabSize.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@title:group", "Tab Size");
+ propertyType: TextPropertyBase.Paragraph;
property alias tabSize: tabSizeSpn.value;
property int tabSizeUnit: TabSizeModel.Spaces;
diff --git a/plugins/dockers/textproperties/qml/TextAlign.qml b/plugins/dockers/textproperties/qml/TextAlign.qml
index a71de6ba9e..9a85c54b36 100644
--- a/plugins/dockers/textproperties/qml/TextAlign.qml
+++ b/plugins/dockers/textproperties/qml/TextAlign.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
CollapsibleGroupProperty {
propertyName: i18nc("@title:group", "Text Align");
+ propertyType: TextPropertyBase.Paragraph;
property int textAlignAll: 1;
property int textAlignLast: 0;
diff --git a/plugins/dockers/textproperties/qml/TextDecoration.qml b/plugins/dockers/textproperties/qml/TextDecoration.qml
index 497bbcf32a..c073598ed4 100644
--- a/plugins/dockers/textproperties/qml/TextDecoration.qml
+++ b/plugins/dockers/textproperties/qml/TextDecoration.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@title:group", "Text Decoration");
+ propertyType: TextPropertyBase.Character;
visible: properties.textDecorationLineState !== KoSvgTextPropertiesModel.PropertyUnset
property alias underline: underlineCbx.checked;
diff --git a/plugins/dockers/textproperties/qml/TextIndent.qml b/plugins/dockers/textproperties/qml/TextIndent.qml
index 09631f8c0b..3e180353db 100644
--- a/plugins/dockers/textproperties/qml/TextIndent.qml
+++ b/plugins/dockers/textproperties/qml/TextIndent.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
CollapsibleGroupProperty {
propertyName: i18nc("@title:group", "Text Indent");
+ propertyType: TextPropertyBase.Paragraph;
property alias textIndentValue: textIndentSpn.value;
property alias hanging: indentHangingCkb.checked;
diff --git a/plugins/dockers/textproperties/qml/TextProperties.qml b/plugins/dockers/textproperties/qml/TextProperties.qml
index 5fd00f15c8..446cc3e049 100644
--- a/plugins/dockers/textproperties/qml/TextProperties.qml
+++ b/plugins/dockers/textproperties/qml/TextProperties.qml
@@ -4,7 +4,6 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.0
-import QtQml.Models 2.1
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.12
import org.krita.flake.text 1.0
@@ -20,39 +19,9 @@ Rectangle {
colorGroup: SystemPalette.Active
}
- ListModel {
- id: characterPropertyList;
- }
- ListModel {
- id: paragraphPropertyList;
- }
-
- Component.onCompleted: fillPropertyModels();
-
- function fillPropertyModels() {
- for (var i = 0; i < characterPropertiesModel.count; i++) {
- characterPropertyList.append({"name": characterPropertiesModel.get(i).propertyName,
- "tooltip": characterPropertiesModel.get(i).toolTip,
- "searchTerms": characterPropertiesModel.get(i).searchTerms,
- "visible": characterPropertiesModel.get(i).visible,
- "item": characterPropertiesModel.get(i)});
- }
- for (var l = 0; l < paragraphPropertiesModel.count; l++) {
- paragraphPropertyList.append({"name": paragraphPropertiesModel.get(l).propertyName,
- "tooltip": paragraphPropertiesModel.get(l).toolTip,
- "searchTerms": paragraphPropertiesModel.get(l).searchTerms,
- "visible": paragraphPropertiesModel.get(l).visible,
- "item": paragraphPropertiesModel.get(l)});
- }
- }
-
function setProperties() {
- for (var i = 0; i < characterPropertiesModel.count; i++) {
- characterPropertiesModel.get(i).propertiesUpdated();
- }
- for (var l = 0; l < paragraphPropertiesModel.count; l++) {
- paragraphPropertiesModel.get(l).propertiesUpdated();
- }
+ characterPropertyList.updateProperties()
+ paragraphPropertyList.updateProperties()
}
TabBar {
@@ -75,125 +44,14 @@ Rectangle {
anchors.left: parent.left;
anchors.top: tabs.bottom;
- ColumnLayout {
- Frame {
- id: characterFrame;
- Layout.fillHeight: true;
- Layout.fillWidth: true;
- clip: true;
- padding: 0;
-
- ListView {
- id: characterProperties
-
- anchors.fill: parent;
- ScrollBar.vertical: ScrollBar {
- }
-
- model: ObjectModel {
- id: characterPropertiesModel;
- FontSize {
- }
- FontFamily {
- fontFamilyModel: fontFamiliesModel;
- }
- FontStyle {
- }
- LetterSpacing {
- }
- WordSpacing {
- }
- LineHeight {
- }
- LineBreak {
- }
- WordBreak {
- }
- TextTransform {
- }
- TextDecoration {
- }
- /*
- OTLigatures {
- }
- OTPosition {
- }
- OTNumeric {
- }
- OTCaps {
- }
- OTEastAsian {
- }*/
- BaselineShift {
- }
- AlignmentBaseline {
- }
- }
- }
- }
-
- ComboBox {
- Layout.fillWidth: true;
- Layout.minimumHeight: implicitHeight;
- model: characterPropertyList;
- textRole: "name";
- displayText: i18nc("@label:listbox", "Add Property");
- onActivated: {
- model.get(currentIndex).item.visible = true;
- }
- }
+ TextPropertyBaseList {
+ id: characterPropertyList;
+ propertyType: TextPropertyBase.Character;
}
- ColumnLayout {
- Frame {
- Layout.fillHeight: true;
- Layout.fillWidth: true;
- clip: true;
- padding: 0;
-
- ListView {
- id: paragraphProperties;
-
- clip: true;
- anchors.fill: parent;
- ScrollBar.vertical: ScrollBar {
- }
-
- model: ObjectModel {
- id: paragraphPropertiesModel;
- WritingMode {
- }
- Direction{
- enabled: !properties.spanSelection;
- }
- TextIndent{
- }
- TextAlign{
- }
- DominantBaseline {
- }
- /*
- WhiteSpace {
- }
- UnderlinePosition {
- }*/
- HangingPunctuation {
- }
- TabSize {
- }
- }
- }
- }
- ComboBox {
- Layout.fillWidth: true;
- Layout.minimumHeight: implicitHeight;
- model: paragraphPropertyList;
- textRole: "name";
- displayText: i18nc("@label:listbox", "Add Property");
- onActivated: {
- model.get(currentIndex).item.visible = true;
- }
- }
+ TextPropertyBaseList {
+ id: paragraphPropertyList;
+ propertyType: TextPropertyBase.Paragraph;
}
}
}
diff --git a/plugins/dockers/textproperties/qml/TextPropertyBase.qml b/plugins/dockers/textproperties/qml/TextPropertyBase.qml
index e518e7c9bd..8be0d0949a 100644
--- a/plugins/dockers/textproperties/qml/TextPropertyBase.qml
+++ b/plugins/dockers/textproperties/qml/TextPropertyBase.qml
@@ -14,12 +14,20 @@ Column {
width: parent? parent.width - (padding*2): 100;
height: visible? childrenRect.height+padding: 0;
+ enum PropertyType {
+ Character, ///< This property can be applied on a character level.
+ Paragraph, ///< This property only does something when applied to a paragraph.
+ Mixed ///< This property can be in either.
+ }
+
property KoSvgTextPropertiesModel properties : textPropertiesModel;
signal propertiesUpdated; ///< Used by each text property panel to update the data on the controls.
property bool blockSignals; ///< When setting the data on the controls, this needs to be enabled and checked while returning data from the controls.
property string propertyName;
+ property int propertyType;
+ property int parentPropertyType;
property string toolTip;
property var searchTerms: [];
diff --git a/plugins/dockers/textproperties/qml/TextPropertyBaseList.qml b/plugins/dockers/textproperties/qml/TextPropertyBaseList.qml
new file mode 100644
index 0000000000..0c5fe9a503
--- /dev/null
+++ b/plugins/dockers/textproperties/qml/TextPropertyBaseList.qml
@@ -0,0 +1,127 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.15
+import QtQml.Models 2.1
+
+ColumnLayout {
+ property int propertyType: TextPropertyBase.Character;
+
+ ListModel {
+ id: propertyList;
+ }
+
+ Component.onCompleted: fillPropertyList();
+
+ function fillPropertyList() {
+ for (var i = 0; i < propertyWidgetModel.count; i++) {
+ propertyWidgetModel.get(i).parentPropertyType = propertyType;
+ if (propertyWidgetModel.get(i).propertyType === propertyType ||
+ propertyWidgetModel.get(i).propertyType === TextPropertyBase.Mixed) {
+ propertyList.append({"name": propertyWidgetModel.get(i).propertyName,
+ "tooltip": propertyWidgetModel.get(i).toolTip,
+ "searchTerms": propertyWidgetModel.get(i).searchTerms,
+ "visible": propertyWidgetModel.get(i).visible,
+ "item": propertyWidgetModel.get(i)});
+ } else {
+ propertyWidgetModel.get(i).visible = false;
+ }
+ }
+ }
+
+ function updateProperties() {
+ for (var i = 0; i < propertyWidgetModel.count; i++) {
+ if (propertyWidgetModel.get(i).propertyType === propertyType ||
+ propertyWidgetModel.get(i).propertyType === TextPropertyBase.Mixed) {
+ propertyWidgetModel.get(i).propertiesUpdated();
+ } else {
+ propertyWidgetModel.get(i).visible = false;
+ }
+ }
+ }
+
+ Frame {
+ id: frame;
+ Layout.fillHeight: true;
+ Layout.fillWidth: true;
+ clip: true;
+ padding: 0;
+
+ ListView {
+ id: propertiesWidgetView
+
+ anchors.fill: parent;
+ ScrollBar.vertical: ScrollBar {
+ }
+
+ model: ObjectModel {
+ id: propertyWidgetModel;
+ WritingMode {
+ }
+ Direction {
+ }
+ TextIndent{
+ }
+ TextAlign{
+ }
+ DominantBaseline {
+ }
+ /*
+ WhiteSpace {
+ }
+ UnderlinePosition {
+ }*/
+ HangingPunctuation {
+ }
+ TabSize {
+ }
+ FontSize {
+ }
+ FontFamily {
+ fontFamilyModel: fontFamiliesModel;
+ }
+ FontStyle {
+ }
+ LetterSpacing {
+ }
+ WordSpacing {
+ }
+ LineHeight {
+ }
+ LineBreak {
+ }
+ WordBreak {
+ }
+ TextTransform {
+ }
+ TextDecoration {
+ }
+ /*
+ OTLigatures {
+ }
+ OTPosition {
+ }
+ OTNumeric {
+ }
+ OTCaps {
+ }
+ OTEastAsian {
+ }*/
+ BaselineShift {
+ }
+ AlignmentBaseline {
+ }
+ }
+ }
+ }
+
+ ComboBox {
+ Layout.fillWidth: true;
+ Layout.minimumHeight: implicitHeight;
+ model: propertyList;
+ textRole: "name";
+ displayText: i18nc("@label:listbox", "Add Property");
+ onActivated: {
+ model.get(currentIndex).item.visible = true;
+ }
+ }
+}
diff --git a/plugins/dockers/textproperties/qml/TextTransform.qml b/plugins/dockers/textproperties/qml/TextTransform.qml
index e3a2b1afff..99f6ed4952 100644
--- a/plugins/dockers/textproperties/qml/TextTransform.qml
+++ b/plugins/dockers/textproperties/qml/TextTransform.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@title:group", "Text Transform");
+ propertyType: TextPropertyBase.Character;
property alias fullWidth: fullWidthChk.checked;
property alias fullSizeKana: fullSizeKanaChk.checked;
property int capitals;
diff --git a/plugins/dockers/textproperties/qml/UnderlinePosition.qml b/plugins/dockers/textproperties/qml/UnderlinePosition.qml
index db45ff0306..2239e08613 100644
--- a/plugins/dockers/textproperties/qml/UnderlinePosition.qml
+++ b/plugins/dockers/textproperties/qml/UnderlinePosition.qml
@@ -8,6 +8,7 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
TextPropertyBase {
+ propertyType: TextPropertyBase.Paragraph;
GridLayout {
columns: 2;
columnSpacing: columnSpacing;
diff --git a/plugins/dockers/textproperties/qml/WordBreak.qml b/plugins/dockers/textproperties/qml/WordBreak.qml
index 15f8a6a9d4..4d7b2ce12f 100644
--- a/plugins/dockers/textproperties/qml/WordBreak.qml
+++ b/plugins/dockers/textproperties/qml/WordBreak.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label:listbox", "Word Break");
+ propertyType: TextPropertyBase.Character;
property int breakType;
diff --git a/plugins/dockers/textproperties/qml/WordSpacing.qml b/plugins/dockers/textproperties/qml/WordSpacing.qml
index 9240f7d32a..24cecf0559 100644
--- a/plugins/dockers/textproperties/qml/WordSpacing.qml
+++ b/plugins/dockers/textproperties/qml/WordSpacing.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@title:group", "Word Spacing");
+ propertyType: TextPropertyBase.Character;
property alias wordSpacing: wordSpacingSpn.value;
visible: properties.wordSpacingState !== KoSvgTextPropertiesModel.PropertyUnset;
diff --git a/plugins/dockers/textproperties/qml/WritingMode.qml b/plugins/dockers/textproperties/qml/WritingMode.qml
index 8252c06590..5355cc1673 100644
--- a/plugins/dockers/textproperties/qml/WritingMode.qml
+++ b/plugins/dockers/textproperties/qml/WritingMode.qml
@@ -10,6 +10,7 @@ import org.krita.flake.text 1.0
TextPropertyBase {
propertyName: i18nc("@label:listbox", "Writing Mode");
+ propertyType: TextPropertyBase.Paragraph;
property int writingMode;
onPropertiesUpdated: {
diff --git a/plugins/dockers/textproperties/textproperties.qrc b/plugins/dockers/textproperties/textproperties.qrc
index 2fda58c6ed..1fafea8d1f 100644
--- a/plugins/dockers/textproperties/textproperties.qrc
+++ b/plugins/dockers/textproperties/textproperties.qrc
@@ -30,5 +30,6 @@
<file alias="WhiteSpace.qml">qml/WhiteSpace.qml</file>
<file alias="UnderlinePosition.qml">qml/UnderlinePosition.qml</file>
<file alias="RevertPropertyButton.qml">qml/RevertPropertyButton.qml</file>
+ <file alias="TextPropertyBaseList.qml">qml/TextPropertyBaseList.qml</file>
</qresource>
</RCC>
diff --git a/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp b/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
index 29283f6317..d1b5753c1e 100644
--- a/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
+++ b/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
@@ -1982,7 +1982,7 @@ void DefaultToolTextPropertiesInterface::setPropertiesOnSelected(KoSvgTextProper
bool DefaultToolTextPropertiesInterface::spanSelection()
{
- return true;
+ return false;
}
void DefaultToolTextPropertiesInterface::notifyCursorPosChanged(int pos, int anchor)