Warning, /plasma/libplasma/examples/applets/widgetgallery/contents/ui/Texts.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2011 Daker Fernandes Pinheiro <dakerfp@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import org.kde.plasma.components as PlasmaComponents
0009 import org.kde.plasma.extras as PlasmaExtras
0010 
0011 PlasmaComponents.Page {
0012     height: childrenRect.height
0013     property int implicitHeight: childrenRect.height
0014 
0015     tools: PlasmaComponents.ToolBarLayout {
0016         spacing: 5
0017         PlasmaComponents.ToolButton {
0018             visible: pageStack.depth > 1
0019             iconSource: "go-previous"
0020             onClicked: pageStack.pop()
0021         }
0022         PlasmaComponents.Label {
0023             text: "Text label:"
0024         }
0025         PlasmaComponents.TextField {
0026             placeholderText: "Place holder text"
0027         }
0028         PlasmaComponents.TextField {
0029             clearButtonShown: true
0030             text: "Text fields page"
0031         }
0032     }
0033 
0034     Flickable {
0035         id: flickable
0036         contentWidth: column.width
0037         contentHeight: column.height
0038         clip: true
0039         anchors.fill: parent
0040 
0041         Item {
0042             width: Math.max(flickable.width, column.width)
0043             height: column.height
0044             Column {
0045                 id: column
0046                 spacing: 20
0047                 anchors.horizontalCenter: parent.horizontalCenter
0048 
0049                 PlasmaComponents.Label {
0050                     text: "Text Fields"
0051                     font.pixelSize: 20
0052                 }
0053 
0054                 PlasmaExtras.Highlight {
0055                     width: 200
0056                     height: 100
0057                     Column {
0058                         spacing: 10
0059                         Row {
0060                             PlasmaComponents.Label {
0061                                 text: "Username: "
0062                                 anchors.verticalCenter: tf1.verticalCenter
0063                             }
0064                             PlasmaComponents.TextField {
0065                                 id: tf1
0066                                 placeholderText: "login"
0067                                 Keys.onTabPressed: tf2.forceActiveFocus();
0068                             }
0069                         }
0070 
0071                         Row {
0072                             PlasmaComponents.Label {
0073                                 text: "Password: "
0074                                 anchors.verticalCenter: tf2.verticalCenter
0075                             }
0076                             PlasmaComponents.TextField {
0077                                 id: tf2
0078                                 width: 120
0079                                 echoMode: TextInput.Password
0080                                 Keys.onTabPressed: loginButton.forceActiveFocus();
0081                             }
0082                         }
0083 
0084                         PlasmaComponents.Button {
0085                             id: loginButton
0086                             text: "Login"
0087                             anchors {
0088                                 right: parent.right
0089                                 rightMargin: 0
0090                             }
0091                             width: 100
0092                         }
0093                     }
0094                 }
0095 
0096                 PlasmaComponents.TextField {
0097                     width: 120
0098                     placeholderText: "Disabled Text Field"
0099                     Keys.onTabPressed: loginButton.forceActiveFocus();
0100                     enabled: false
0101                 }
0102 
0103                 PlasmaComponents.Label {
0104                     text: "Text Area"
0105                     font.pixelSize: 20
0106                 }
0107 
0108                 PlasmaComponents.TextArea {
0109                     width: 200
0110                     height: 200
0111                     placeholderText: "Lorem ipsum et dolor"
0112                     wrapMode: TextEdit.WordWrap
0113                     contentMaxWidth: 400
0114                     contentMaxHeight: 400
0115                 }
0116 
0117                 PlasmaComponents.TextArea {
0118                     width: 200
0119                     height: 100
0120                     enabled: false
0121                     wrapMode: TextEdit.WordWrap
0122                     text: "Disabled Text Area"
0123                 }
0124             }
0125         }
0126     }
0127 
0128     PlasmaComponents.ScrollBar {
0129         id: horizontalScrollBar
0130 
0131         flickableItem: flickable
0132         orientation: Qt.Horizontal
0133         anchors {
0134             left: parent.left
0135             right: verticalScrollBar.left
0136             bottom: parent.bottom
0137         }
0138     }
0139 
0140     PlasmaComponents.ScrollBar {
0141         id: verticalScrollBar
0142 
0143         orientation: Qt.Vertical
0144         flickableItem: flickable
0145         anchors {
0146             top: parent.top
0147             right: parent.right
0148             bottom: horizontalScrollBar.top
0149         }
0150     }
0151 }