Warning, /maui/mauikit/src/controls.5/PasswordField.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 * Copyright 2018 Camilo Higuita <milo.h@aol.com> 0003 * 0004 * This program is free software; you can redistribute it and/or modify 0005 * it under the terms of the GNU Library General Public License as 0006 * published by the Free Software Foundation; either version 2, or 0007 * (at your option) any later version. 0008 * 0009 * This program is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0012 * GNU General Public License for more details 0013 * 0014 * You should have received a copy of the GNU Library General Public 0015 * License along with this program; if not, write to the 0016 * Free Software Foundation, Inc., 0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 */ 0019 0020 import QtQuick 2.15 0021 import QtQuick.Controls 2.15 0022 0023 import org.mauikit.controls 1.3 as Maui 0024 import QtQuick.Layouts 1.3 0025 0026 /** 0027 * TextField 0028 * A global sidebar for the application window that can be collapsed. 0029 * 0030 * 0031 * 0032 * 0033 * 0034 * 0035 */ 0036 TextField 0037 { 0038 id: control 0039 echoMode: TextInput.Password 0040 passwordMaskDelay: 300 0041 property int previousEchoMode 0042 0043 icon.source: "lock" 0044 0045 actions: Action 0046 { 0047 icon.name: control.echoMode === TextInput.Normal ? "view-hidden" : "view-visible" 0048 icon.color: control.color 0049 onTriggered: 0050 { 0051 if(control.echoMode === TextInput.Normal) 0052 { 0053 control.echoMode = control.previousEchoMode 0054 }else 0055 { 0056 control.echoMode = TextInput.Normal 0057 } 0058 } 0059 } 0060 0061 Component.onCompleted: 0062 { 0063 control.previousEchoMode = control.echoMode 0064 } 0065 }