Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/TextArea.qml
Show All 17 Lines | |||||
18 | * ensure the GNU General Public License version 2.0 requirements will be | 18 | * ensure the GNU General Public License version 2.0 requirements will be | ||
19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | 19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | 22 | | |||
23 | import QtQuick 2.6 | 23 | import QtQuick 2.6 | ||
24 | import QtQuick.Window 2.1 | 24 | import QtQuick.Window 2.1 | ||
25 | import QtQuick.Templates 2.0 as T | 25 | import QtQuick.Templates 2.0 as T | ||
26 | import org.kde.kirigami 2.2 as Kirigami | ||||
26 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | 27 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | ||
27 | 28 | | |||
28 | T.TextArea { | 29 | T.TextArea { | ||
29 | id: controlRoot | 30 | id: controlRoot | ||
31 | Kirigami.Theme.colorSet: Kirigami.Theme.View | ||||
32 | Kirigami.Theme.inherit: false | ||||
30 | 33 | | |||
31 | implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, | 34 | implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, | ||
32 | background ? background.implicitWidth : 0, | 35 | background ? background.implicitWidth : 0, | ||
33 | placeholder.implicitWidth + leftPadding + rightPadding) | 36 | placeholder.implicitWidth + leftPadding + rightPadding) | ||
34 | implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, | 37 | implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, | ||
35 | background ? background.implicitHeight : 0, | 38 | background ? background.implicitHeight : 0, | ||
36 | placeholder.implicitHeight + topPadding + bottomPadding) | 39 | placeholder.implicitHeight + topPadding + bottomPadding) | ||
37 | 40 | | |||
38 | padding: 6 | 41 | padding: 6 | ||
39 | 42 | | |||
40 | color: StylePrivate.SystemPaletteSingleton.text(controlRoot.enabled) | 43 | color: Kirigami.Theme.textColor | ||
41 | selectionColor: StylePrivate.SystemPaletteSingleton.highlight(controlRoot.enabled) | 44 | selectionColor: Kirigami.Theme.highlightColor | ||
42 | selectedTextColor: StylePrivate.SystemPaletteSingleton.highlightedText(controlRoot.enabled) | 45 | selectedTextColor: Kirigami.Theme.highlightedTextColor | ||
43 | wrapMode: Text.WordWrap | 46 | wrapMode: Text.WordWrap | ||
44 | verticalAlignment: TextEdit.AlignTop | 47 | verticalAlignment: TextEdit.AlignTop | ||
45 | //Text.NativeRendering is broken on non integer pixel ratios | 48 | //Text.NativeRendering is broken on non integer pixel ratios | ||
46 | renderType: Window.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering | 49 | renderType: Window.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering | ||
47 | selectByMouse: true | 50 | selectByMouse: true | ||
48 | 51 | | |||
49 | Label { | 52 | Label { | ||
50 | id: placeholder | 53 | id: placeholder | ||
51 | x: controlRoot.leftPadding | 54 | x: controlRoot.leftPadding | ||
52 | y: controlRoot.topPadding | 55 | y: controlRoot.topPadding | ||
53 | width: controlRoot.width - (controlRoot.leftPadding + controlRoot.rightPadding) | 56 | width: controlRoot.width - (controlRoot.leftPadding + controlRoot.rightPadding) | ||
54 | height: controlRoot.height - (controlRoot.topPadding + controlRoot.bottomPadding) | 57 | height: controlRoot.height - (controlRoot.topPadding + controlRoot.bottomPadding) | ||
55 | 58 | | |||
56 | text: controlRoot.placeholderText | 59 | text: controlRoot.placeholderText | ||
57 | font: controlRoot.font | 60 | font: controlRoot.font | ||
58 | color: StylePrivate.SystemPaletteSingleton.text(false) | 61 | color: Kirigami.Theme.disabledTextColor | ||
59 | horizontalAlignment: controlRoot.horizontalAlignment | 62 | horizontalAlignment: controlRoot.horizontalAlignment | ||
60 | verticalAlignment: controlRoot.verticalAlignment | 63 | verticalAlignment: controlRoot.verticalAlignment | ||
61 | visible: !controlRoot.length && !controlRoot.preeditText && (!controlRoot.activeFocus || controlRoot.horizontalAlignment !== Qt.AlignHCenter) | 64 | visible: !controlRoot.length && !controlRoot.preeditText && (!controlRoot.activeFocus || controlRoot.horizontalAlignment !== Qt.AlignHCenter) | ||
62 | elide: Text.ElideRight | 65 | elide: Text.ElideRight | ||
63 | } | 66 | } | ||
64 | 67 | | |||
65 | background: StylePrivate.StyleItem { | 68 | background: StylePrivate.StyleItem { | ||
66 | id: style | 69 | id: style | ||
Show All 11 Lines |