mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2025-12-16 14:41:25 +08:00
TextEdits: fix minor ui issues
- Removed usage of secondary suffix icon - Fixes issue with moving info icon on edit select/deselect for UsernameTextExit Change-Id: Ic3c0bea7302007f9032bcb8ecd0dd48593a8460e
This commit is contained in:
@@ -44,8 +44,7 @@ TextField {
|
||||
property alias prefixIconColor: prefixIcon.color
|
||||
property string suffixIconSrc
|
||||
property alias suffixIconColor: suffixIcon.color
|
||||
property string suffixBisIconSrc
|
||||
property alias suffixBisIconColor: suffixBisIcon.color
|
||||
property int suffixIconRightPadding: 0
|
||||
property alias icon: container.data
|
||||
|
||||
property color accent: (isActive || hovered ? prefixIconColor : JamiTheme.passwordBaselineColor)
|
||||
@@ -57,6 +56,8 @@ TextField {
|
||||
property alias infoTipText: infoTip.text
|
||||
property alias infoTipLineText: infoTipLine.text
|
||||
|
||||
signal suffixIconClicked
|
||||
|
||||
//https://doc.qt.io/qt-6/qml-qtquick-textinput.html#maximumLength-prop
|
||||
property var maxCharacters: undefined
|
||||
maximumLength: maxCharacters ? maxCharacters : 32767
|
||||
@@ -74,10 +75,7 @@ TextField {
|
||||
if (!readOnly) {
|
||||
if (suffixIconSrc !== "")
|
||||
total = +30;
|
||||
if (suffixBisIconSrc !== "")
|
||||
total = +30;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
topPadding: 2
|
||||
@@ -185,12 +183,17 @@ TextField {
|
||||
id: container
|
||||
width: suffixIcon.width
|
||||
height: suffixIcon.height
|
||||
anchors.right: suffixBisIcon.left
|
||||
anchors.rightMargin: suffixBisIconSrc !== '' ? 5 : root.isActive ? 0 : 20
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: suffixIconRightPadding
|
||||
anchors.verticalCenter: root.verticalCenter
|
||||
anchors.verticalCenterOffset: -root.bottomPadding / 2
|
||||
visible: !readOnly
|
||||
|
||||
TapHandler {
|
||||
id: suffixTapHandler
|
||||
onTapped: root.suffixIconClicked()
|
||||
}
|
||||
|
||||
TextFieldIcon {
|
||||
id: suffixIcon
|
||||
size: 20
|
||||
@@ -207,24 +210,6 @@ TextField {
|
||||
}
|
||||
}
|
||||
|
||||
TextFieldIcon {
|
||||
id: suffixBisIcon
|
||||
size: 16
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: root.verticalCenter
|
||||
anchors.verticalCenterOffset: -root.bottomPadding / 2
|
||||
color: suffixBisIconColor
|
||||
source: suffixBisIconSrc
|
||||
opacity: 1
|
||||
|
||||
TapHandler {
|
||||
cursorShape: Qt.ArrowCursor
|
||||
onTapped: {
|
||||
modalTextEditRoot.icoClicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MaterialToolTip {
|
||||
id: infoTipLine
|
||||
|
||||
|
||||
@@ -25,8 +25,7 @@ Loader {
|
||||
property color prefixIconColor: JamiTheme.editLineColor
|
||||
property string suffixIconSrc: ""
|
||||
property color suffixIconColor: JamiTheme.buttonTintedBlue
|
||||
property string suffixBisIconSrc: ""
|
||||
property color suffixBisIconColor: JamiTheme.buttonTintedBlue
|
||||
property int suffixIconRightPadding: 0
|
||||
property color textColor: JamiTheme.textColor
|
||||
|
||||
required property string placeholderText
|
||||
@@ -96,11 +95,12 @@ Loader {
|
||||
isSwarmDetail: root.isSwarmDetail
|
||||
isSettings: root.isSettings
|
||||
textColor: root.textColor
|
||||
suffixBisIconSrc: root.suffixBisIconSrc
|
||||
suffixBisIconColor: root.suffixBisIconColor
|
||||
placeholderText: root.placeholderText
|
||||
prefixIconSrc: isSwarmDetail ? "" : root.prefixIconSrc
|
||||
prefixIconColor: root.prefixIconColor
|
||||
suffixIconSrc: root.suffixIconSrc
|
||||
suffixIconColor: root.suffixIconColor
|
||||
suffixIconRightPadding: root.suffixIconRightPadding
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,8 +118,7 @@ Loader {
|
||||
prefixIconColor: root.prefixIconColor
|
||||
suffixIconSrc: root.suffixIconSrc
|
||||
suffixIconColor: root.suffixIconColor
|
||||
suffixBisIconSrc: root.suffixBisIconSrc
|
||||
suffixBisIconColor: root.suffixBisIconColor
|
||||
suffixIconRightPadding: root.suffixIconRightPadding
|
||||
textColor: root.textColor
|
||||
font.pixelSize: root.fontPixelSize
|
||||
font.bold: root.fontBold
|
||||
|
||||
@@ -27,21 +27,31 @@ ModalTextEdit {
|
||||
|
||||
prefixIconSrc: firstEntry ? JamiResources.lock_svg : JamiResources.round_edit_24dp_svg
|
||||
|
||||
suffixBisIconSrc: echoMode == TextInput.Password ? JamiResources.eye_cross_svg : JamiResources.noun_eye_svg
|
||||
suffixBisIconColor: JamiTheme.passwordEyeIconColor
|
||||
suffixIconSrc: echoMode == TextInput.Password ? JamiResources.eye_cross_svg : JamiResources.noun_eye_svg
|
||||
suffixIconColor: JamiTheme.passwordEyeIconColor
|
||||
|
||||
placeholderText: JamiStrings.password
|
||||
infoTipText: firstEntry ? JamiStrings.password : ""
|
||||
staticText: ""
|
||||
echoMode: TextInput.Password
|
||||
|
||||
// Forward the suffix icon click to toggle password visibility
|
||||
Connections {
|
||||
target: item
|
||||
enabled: item !== null
|
||||
|
||||
function onSuffixIconClicked() {
|
||||
modalTextEditRoot.onIcoClicked();
|
||||
}
|
||||
}
|
||||
|
||||
onIcoClicked: {
|
||||
if (echoMode == TextInput.Normal) {
|
||||
echoMode = TextInput.Password;
|
||||
suffixBisIconSrc = JamiResources.eye_cross_svg;
|
||||
suffixIconSrc = JamiResources.eye_cross_svg;
|
||||
} else {
|
||||
echoMode = TextInput.Normal;
|
||||
suffixBisIconSrc = JamiResources.noun_eye_svg;
|
||||
suffixIconSrc = JamiResources.noun_eye_svg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ ModalTextEdit {
|
||||
}
|
||||
suffixIconSrc: JamiResources.outline_info_24dp_svg
|
||||
suffixIconColor: JamiTheme.buttonTintedBlue
|
||||
suffixIconRightPadding: 20
|
||||
|
||||
property bool isActive: false
|
||||
property string infohash: CurrentAccount.uri
|
||||
|
||||
Reference in New Issue
Block a user