diff --git a/app/qml/components/MMButtonInput.qml b/app/qml/components/MMButtonInput.qml deleted file mode 100644 index 92c35c598..000000000 --- a/app/qml/components/MMButtonInput.qml +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -Column { - id: control - - property alias title: titleItem.text - property alias text: textField.text - property alias placeholderText: textField.placeholderText - property url iconSource: "" - required property string buttonText - property string warningMsg - property string errorMsg - - signal clicked - - spacing: 6 * __dp - width: 280 * __dp - - Text { - id: titleItem - - width: parent.width - font: __style.p6 - wrapMode: Text.WordWrap - visible: text.length > 0 - } - - Rectangle { - id: rect - - height: 40 * __dp - width: parent.width - color: (errorMsg.length > 0 || warningMsg.length > 0) ? __style.errorBgInputColor : __style.whiteColor - border.color: errorMsg.length > 0 ? __style.negativeColor : warningMsg.length > 0 ? __style.warningColor : __style.forestColor - border.width: enabled ? (textField.activeFocus ? 2*__dp : textField.hovered ? 1*__dp : 0) : 0 - radius: parent.height - - Row { - id: row - - anchors.verticalCenter: parent.verticalCenter - leftPadding: 10 * __dp - - MMIcon { - id: leftIcon - - source: control.iconSource - color: errorMsg.length > 0 ? __style.negativeColor : - warningMsg.length > 0 ? __style.warningColor : - control.enabled ? __style.forestColor : __style.mediumGreenColor - height: rect.height - } - - TextField { - id: textField - - y: 2 * __dp - width: control.width - 2 * row.leftPadding - - (leftIcon.visible ? leftIcon.width : 0) - - (button.visible ? button.width : 0) - height: rect.height - 4 * __dp - color: control.enabled ? __style.nightColor : __style.mediumGreenColor - placeholderTextColor: __style.nightAlphaColor - font: __style.p5 - hoverEnabled: true - anchors.verticalCenter: parent.verticalCenter - background: Rectangle { - color: __style.transparentColor - } - } - - Button { - id: button - - anchors.verticalCenter: parent.verticalCenter - - contentItem: Text { - anchors.centerIn: button - font: __style.t5 - text: control.buttonText - leftPadding: 2 * __dp - rightPadding: 2 * __dp - topPadding: 2 * __dp - bottomPadding: 2 * __dp - color: __style.deepOceanColor - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - - background: Rectangle { - color: button.enabled ? __style.grassColor : __style.mediumGreenColor - radius: height / 2 - } - - onClicked: control.clicked() - } - } - } - - Item { - id: messageItem - - width: parent.width - height: msgRow.height - - Row { - id: msgRow - - spacing: 4 * __dp - - MMIcon { - id: msgIcon - - source: visible ? __style.errorIcon : "" - color: errorMsg.length > 0 ? __style.negativeColor : __style.warningColor - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - Text { - text: errorMsg.length > 0 ? errorMsg : warningMsg - font: __style.t4 - wrapMode: Text.WordWrap - width: messageItem.width - msgRow.spacing - msgIcon.width - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - } - } - - // add whole text to clipboard - function textToClipboard() { - textField.selectAll() - textField.copy() - textField.deselect() - } -} diff --git a/app/qml/components/MMComboBox.qml b/app/qml/components/MMComboBox.qml deleted file mode 100644 index d86b8548a..000000000 --- a/app/qml/components/MMComboBox.qml +++ /dev/null @@ -1,132 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -Item { - id: control - - property alias model: combobox.model - property string warningMsg - property string errorMsg - - signal activated(currentValue: string) - - width: 280 * __dp - height: combobox.height + messageItem.height - - ComboBox { - id: combobox - - width: parent.width - height: 40 * __dp - - indicator: MMIcon { - source: popup.visible ? __style.arrowUpIcon : __style.arrowDownIcon - color: control.enabled ? __style.forestColor : __style.mediumGreenColor - x: combobox.width - width - combobox.rightPadding - anchors.verticalCenter: parent.verticalCenter - } - - contentItem: Text { - leftPadding: 20 - rightPadding: combobox.indicator.width + combobox.spacing - - text: combobox.displayText - font: __style.p4 - color: control.enabled ? __style.nightColor : __style.mediumGreenColor - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - - background: Rectangle { - color: (errorMsg.length > 0 || warningMsg.length > 0) ? __style.errorBgInputColor : __style.whiteColor - border.color: (combobox.activeFocus || combobox.hovered) ? (errorMsg.length > 0 ? __style.negativeColor : - warningMsg.length > 0 ? __style.warningColor : - __style.forestColor) : __style.transparentColor - border.width: enabled ? (combobox.activeFocus ? 2*__dp : 1*__dp) : 0 - radius: parent.height - } - - popup: Popup { - id: popup - - y: combobox.height - 1 - x: 20 * __dp - width: combobox.width - 2 * x - implicitHeight: contentItem.implicitHeight - padding: 1 - - contentItem: ListView { - clip: true - implicitHeight: contentHeight - model: combobox.popup.visible ? combobox.delegateModel : null - currentIndex: combobox.highlightedIndex - ScrollIndicator.vertical: ScrollIndicator { } - } - - background: Rectangle { - border.color: __style.forestColor - radius: 2 - } - } - - delegate: ItemDelegate { - id: delegate - - width: popup.width - height: 30 * __dp - contentItem: Text { - text: modelData - color: combobox.highlightedIndex === index ? __style.grassColor : __style.forestColor - font: __style.p4 - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - background: Rectangle { - border.color: __style.whiteColor - } - } - - onActivated: control.activated(combobox.currentValue) - } - - Item { - id: messageItem - - width: parent.width - anchors.left: parent.left - anchors.top: combobox.bottom - anchors.topMargin: 6 * __dp - height: msgRow.height - - Row { - id: msgRow - - spacing: 4 * __dp - - MMIcon { - id: msgIcon - - source: visible ? __style.errorIcon : "" - color: errorMsg.length > 0 ? __style.negativeColor : __style.warningColor - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - Text { - text: errorMsg.length > 0 ? errorMsg : warningMsg - font: __style.t4 - wrapMode: Text.WordWrap - width: messageItem.width - msgRow.spacing - msgIcon.width - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - } - } -} diff --git a/app/qml/components/MMInput.qml b/app/qml/components/MMInput.qml deleted file mode 100644 index 169faff1c..000000000 --- a/app/qml/components/MMInput.qml +++ /dev/null @@ -1,125 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -Column { - id: control - - property alias title: titleItem.text - property alias text: textField.text - property alias placeholderText: textField.placeholderText - property url iconSource: "" - property string warningMsg - property string errorMsg - - spacing: 6 * __dp - width: 280 * __dp - - Text { - id: titleItem - - width: parent.width - font: __style.p6 - wrapMode: Text.WordWrap - visible: text.length > 0 - } - - Rectangle { - id: rect - - height: 40 * __dp - width: parent.width - color: (errorMsg.length > 0 || warningMsg.length > 0) ? __style.errorBgInputColor : __style.whiteColor - border.color: errorMsg.length > 0 ? __style.negativeColor : warningMsg.length > 0 ? __style.warningColor : __style.forestColor - border.width: enabled ? (textField.activeFocus ? 2*__dp : textField.hovered ? 1*__dp : 0) : 0 - radius: parent.height - - Row { - id: row - - anchors.verticalCenter: parent.verticalCenter - leftPadding: 10 * __dp - - MMIcon { - id: leftIcon - - source: control.iconSource - color: errorMsg.length > 0 ? __style.negativeColor : - warningMsg.length > 0 ? __style.warningColor : - control.enabled ? __style.forestColor : __style.mediumGreenColor - height: rect.height - } - - TextField { - id: textField - - y: 2 * __dp - width: control.width - 2 * row.leftPadding - - (leftIcon.visible ? leftIcon.width : 0) - - (clearButton.visible ? clearButton.width : 0) - height: rect.height - 4 * __dp - color: control.enabled ? __style.nightColor : __style.mediumGreenColor - placeholderTextColor: __style.nightAlphaColor - font: __style.p5 - hoverEnabled: true - anchors.verticalCenter: parent.verticalCenter - background: Rectangle { - color: __style.transparentColor - } - } - - MMIcon { - id: clearButton - - property bool pressed: false - source: __style.xMarkIcon - color: control.enabled ? __style.forestColor : __style.mediumGreenColor - width: visible ? height : 0 - height: rect.height - visible: textField.activeFocus && textField.text.length>0 - - MouseArea { - anchors.fill: parent - onClicked: textField.text = "" - } - } - } - } - - Item { - id: messageItem - - width: parent.width - height: msgRow.height - - Row { - id: msgRow - - spacing: 4 * __dp - - MMIcon { - id: msgIcon - - source: visible ? __style.errorIcon : "" - color: errorMsg.length > 0 ? __style.negativeColor : __style.warningColor - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - Text { - text: errorMsg.length > 0 ? errorMsg : warningMsg - font: __style.t4 - wrapMode: Text.WordWrap - width: messageItem.width - msgRow.spacing - msgIcon.width - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - } - } -} diff --git a/app/qml/components/MMPasswordInput.qml b/app/qml/components/MMPasswordInput.qml deleted file mode 100644 index 9a0ff0d58..000000000 --- a/app/qml/components/MMPasswordInput.qml +++ /dev/null @@ -1,151 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -Column { - id: control - - signal textEdited - - enum MsgShowBehaviour { - Never, - OnNotMatchingRegex, - Always - } - - property alias title: titleItem.text - property alias text: textField.text - property alias placeholderText: textField.placeholderText - property string regexp: '.*' - property int msgShowBehaviour: MMPasswordInput.OnNotMatchingRegex - property url iconSource: "" - property string warningMsg - property string errorMsg - - spacing: 6 * __dp - width: 280 * __dp - - Text { - id: titleItem - - width: parent.width - font: __style.p6 - wrapMode: Text.WordWrap - visible: text.length > 0 - } - - Rectangle { - id: rect - - height: 40 * __dp - width: parent.width - color: (errorMsg.length > 0 || warningMsg.length > 0) ? __style.errorBgInputColor : __style.whiteColor - border.color: isPasswordCorrect(textField.text) ? __style.forestColor : errorMsg.length > 0 ? __style.negativeColor : warningMsg.length > 0 ? __style.warningColor : __style.forestColor - border.width: enabled ? (textField.activeFocus ? 2*__dp : textField.hovered ? 1*__dp : 0) : 0 - radius: parent.height - - Row { - id: row - - anchors.verticalCenter: parent.verticalCenter - leftPadding: 10 * __dp - - MMIcon { - id: leftIcon - - source: control.iconSource - color: errorMsg.length > 0 ? __style.negativeColor : - warningMsg.length > 0 ? __style.warningColor : - control.enabled ? __style.forestColor : __style.mediumGreenColor - height: rect.height - } - - TextField { - id: textField - - y: 2 * __dp - width: control.width - 2 * row.leftPadding - - (leftIcon.visible ? leftIcon.width : 0) - - (eyeButton.visible ? eyeButton.width : 0) - height: rect.height - 4 * __dp - color: control.enabled ? __style.nightColor : __style.mediumGreenColor - placeholderTextColor: __style.nightAlphaColor - font: __style.p5 - hoverEnabled: true - anchors.verticalCenter: parent.verticalCenter - echoMode: eyeButton.pressed ? TextInput.Normal : TextInput.Password - background: Rectangle { - color: __style.transparentColor - } - - onTextEdited: { - control.textEdited() - } - } - - MMIcon { - id: eyeButton - - property bool pressed: false - source: pressed ? __style.hideIcon : __style.showIcon - color: control.enabled ? __style.forestColor : __style.mediumGreenColor - width: visible ? height : 0 - height: rect.height - - MouseArea { - anchors.fill: parent - onClicked: eyeButton.pressed = !eyeButton.pressed - } - } - } - } - - Item { - id: messageItem - - width: parent.width - height: msgRow.height - - Row { - id: msgRow - - spacing: 4 * __dp - - MMIcon { - id: msgIcon - - source: visible ? __style.errorIcon : "" - color: errorMsg.length > 0 ? __style.negativeColor : __style.warningColor - visible: msg.visible - } - Text { - id: msg - - text: errorMsg.length > 0 ? errorMsg : warningMsg - font: __style.t4 - wrapMode: Text.WordWrap - width: messageItem.width - msgRow.spacing - msgIcon.width - visible: (errorMsg.length > 0 || warningMsg.length > 0) && !isPasswordCorrect(textField.text) - } - } - } - - function isPasswordCorrect(pwd) { - if (msgShowBehaviour === MMPasswordInput.Never) - return true - else if (msgShowBehaviour === MMPasswordInput.Always) - return false - - let pwdRegexp = new RegExp(control.regexp) - return pwdRegexp.test(pwd) - } -} diff --git a/app/qml/components/MMTextArea.qml b/app/qml/components/MMTextArea.qml deleted file mode 100644 index 50c5b6ad9..000000000 --- a/app/qml/components/MMTextArea.qml +++ /dev/null @@ -1,84 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -Item { - id: control - - property int areaHeight - property alias text: textArea.text - property alias placeholderText: textArea.placeholderText - property string warningMsg - property string errorMsg - - // auto resize - property int minHeight: 50 - property int maxHeight: 150 - property bool autoHeight: false - - width: 280 * __dp - height: textArea.height + messageItem.height - - TextArea { - id: textArea - - property string warningMsg - property string errorMsg - - height: control.autoHeight ? ( contentHeight+10 > control.minHeight ? contentHeight+10 > control.maxHeight ? control.maxHeight : contentHeight+10 : control.minHeight ) : control.areaHeight - width: parent.width - hoverEnabled: true - placeholderTextColor: __style.nightAlphaColor - color: control.enabled ? __style.nightColor : __style.mediumGreenColor - font: __style.p5 - - background: Rectangle { - color: (errorMsg.length > 0 || warningMsg.length > 0) ? __style.errorBgInputColor : __style.whiteColor - border.color: (textArea.activeFocus || textArea.hovered) ? (errorMsg.length > 0 ? __style.negativeColor : - warningMsg.length > 0 ? __style.warningColor : - __style.forestColor) : __style.transparentColor - border.width: enabled ? (textArea.activeFocus ? 2*__dp : 1*__dp) : 0 - radius: 10 * __dp - } - } - - Item { - id: messageItem - - width: parent.width - anchors.left: parent.left - anchors.top: textArea.bottom - anchors.topMargin: 6 * __dp - height: msgRow.height - - Row { - id: msgRow - - spacing: 4 * __dp - - MMIcon { - id: msgIcon - - source: visible ? __style.errorIcon : "" - color: errorMsg.length > 0 ? __style.negativeColor : __style.warningColor - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - Text { - text: errorMsg.length > 0 ? errorMsg : warningMsg - font: __style.t4 - wrapMode: Text.WordWrap - width: messageItem.width - msgRow.spacing - msgIcon.width - visible: errorMsg.length > 0 || warningMsg.length > 0 - } - } - } -} diff --git a/app/qml/inputs/MMTextAreaEditor.qml b/app/qml/inputs/MMTextAreaEditor.qml index 3312679ef..81a0ad374 100644 --- a/app/qml/inputs/MMTextAreaEditor.qml +++ b/app/qml/inputs/MMTextAreaEditor.qml @@ -27,7 +27,11 @@ MMAbstractEditor { signal editorValueChanged( var newValue, var isNull ) hasFocus: textArea.activeFocus - contentItemHeight: textArea.y + textArea.contentHeight + 2 * textArea.verticalPadding + contentItemHeight: { + const minHeight = 85 * __dp // min height for 3 rows + var realHeight = textArea.y + textArea.contentHeight + 2 * textArea.verticalPadding + return realHeight < minHeight ? minHeight : realHeight + } content: TextArea { id: textArea diff --git a/gallery/qml.qrc b/gallery/qml.qrc index 6bf9a906f..60077ff74 100644 --- a/gallery/qml.qrc +++ b/gallery/qml.qrc @@ -6,19 +6,13 @@ qml/pages/StylePage.qml qml/pages/MiscPage.qml qml/pages/InitialGalleryPage.qml - qml/pages/InputsPage.qml qml/pages/ButtonsPage.qml - ../app/qml/components/MMInput.qml ../app/qml/components/MMButton.qml ../app/qml/components/MMLinkButton.qml ../app/qml/components/MMLink.qml ../app/qml/components/MMIcon.qml ../app/qml/components/MMRoundButton.qml ../app/qml/components/MMRoundLinkButton.qml - qml/pages/TextAreaPage.qml - ../app/qml/components/MMTextArea.qml - qml/pages/ComboBoxPage.qml - ../app/qml/components/MMComboBox.qml ../app/qml/components/MMRadioButton.qml ../app/qml/components/MMSwitch.qml qml/pages/NotificationPage.qml @@ -33,8 +27,6 @@ ../app/qml/components/MMMapButton.qml ../app/qml/components/MMShadow.qml ../app/qml/components/MMMapLabel.qml - ../app/qml/components/MMPasswordInput.qml - ../app/qml/components/MMButtonInput.qml ../app/qml/components/MMToolbarButton.qml ../app/qml/components/MMToolbar.qml qml/pages/ToolbarPage.qml diff --git a/gallery/qml/Main.qml b/gallery/qml/Main.qml index ecabb9d3b..c66975dba 100644 --- a/gallery/qml/Main.qml +++ b/gallery/qml/Main.qml @@ -121,18 +121,6 @@ ApplicationWindow { title: "Editors" source: "EditorsPage.qml" } - ListElement { - title: "Inputs" - source: "InputsPage.qml" - } - ListElement { - title: "Text areas" - source: "TextAreaPage.qml" - } - ListElement { - title: "Combo boxes" - source: "ComboBoxPage.qml" - } ListElement { title: "Checks" source: "ChecksPage.qml" diff --git a/gallery/qml/pages/ComboBoxPage.qml b/gallery/qml/pages/ComboBoxPage.qml deleted file mode 100644 index a37984cc8..000000000 --- a/gallery/qml/pages/ComboBoxPage.qml +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -import "../../app/qml/components" - -Column { - padding: 20 - spacing: 20 - - GroupBox { - title: "MMComboBox" - background: Rectangle { - color: "lightGray" - border.color: "gray" - } - label: Label { - color: "black" - text: parent.title - padding: 5 - } - - Column { - spacing: 20 - anchors.fill: parent - MMComboBox { - model: ["First", "Second", "Third"] - onActivated: (currentValue) => console.log("Selected " + currentValue) - } - MMComboBox { - model: ["First", "Second", "Third"] - enabled: false - } - MMComboBox { - model: ["First", "Second", "Third"] - warningMsg: "Be careful" - } - MMComboBox { - model: ["First", "Second", "Third"] - errorMsg: "Error message" - } - } - } -} diff --git a/gallery/qml/pages/InputsPage.qml b/gallery/qml/pages/InputsPage.qml deleted file mode 100644 index 7aa1ec2bf..000000000 --- a/gallery/qml/pages/InputsPage.qml +++ /dev/null @@ -1,122 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -import "../../app/qml/components" -import "../../app/qml/" - -ScrollView { - Column { - padding: 20 - spacing: 20 - - GroupBox { - title: "MMInput" - background: Rectangle { - color: "lightGray" - border.color: "gray" - } - label: Label { - color: "black" - text: parent.title - padding: 5 - } - - Column { - spacing: 10 - anchors.fill: parent - MMInput { - title: "Title" - placeholderText: "Place holder" - } - MMInput { - title: "Title" - text: "Disabled" - enabled: false - } - Column { - MMInput { - title: "Search ..." - placeholderText: "Search" - iconSource: __style.searchIcon - } - } - Column { - MMInput { - text: "Calendar" - iconSource: __style.calendarIcon - warningMsg: "Would you like to be so kind and select a date please?" - } - } - } - } - - GroupBox { - title: "MMPasswordInput" - background: Rectangle { - color: "lightGray" - border.color: "gray" - } - label: Label { - color: "black" - text: parent.title - padding: 5 - } - - Column { - spacing: 10 - anchors.fill: parent - MMPasswordInput { - title: "Username password" - text: "Password" - regexp: '(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{6,})' - errorMsg: "Password must contain at least 6 characters\nMinimum 1 number, uppercase and lowercase letter and special character" - } - MMPasswordInput { - text: "Password" - regexp: '(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{6,})' - enabled: false - } - } - } - - GroupBox { - title: "MMButtonInput" - background: Rectangle { - color: "lightGray" - border.color: "gray" - } - label: Label { - color: "black" - text: parent.title - padding: 5 - } - - Column { - spacing: 10 - anchors.fill: parent - MMButtonInput { - title: "Title" - text: "Copy text to clipboard" - buttonText: "Copy" - onClicked: { textToClipboard(); console.log("Text in clipboard") } - } - MMButtonInput { - text: "Send" - buttonText: "Send" - enabled: false - onClicked: console.log("Clicked") - } - } - } - } -} diff --git a/gallery/qml/pages/TextAreaPage.qml b/gallery/qml/pages/TextAreaPage.qml deleted file mode 100644 index e62a4cdd4..000000000 --- a/gallery/qml/pages/TextAreaPage.qml +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Basic - -import "../../app/qml/components" - -Column { - padding: 20 - spacing: 20 - - GroupBox { - title: "MMTextArea" - background: Rectangle { - color: "lightGray" - border.color: "gray" - } - label: Label { - color: "black" - text: parent.title - padding: 5 - } - - Column { - spacing: 20 - anchors.fill: parent - MMTextArea { - areaHeight: 50 - placeholderText: "Place holder" - } - MMTextArea { - areaHeight: 50 - text: "Disabled" - enabled: false - } - MMTextArea { - areaHeight: 50 - text: "Something important" - warningMsg: "Be careful" - } - MMTextArea { - areaHeight: 50 - text: "Something wrong" - errorMsg: "Error message" - } - MMTextArea { - areaHeight: 50 - text: "autoHeight: true\nminHeight: 50\nmaxHeight: 150" - minHeight: 50 - maxHeight: 150 - autoHeight: true - } - } - } -}