Коммит 6fb3a6aa создал по автору sgakerru's avatar sgakerru
Просмотр файлов

Улучшено отображения пользователей с длинным именем (в 2-3 строки) на форме входа в систему

Возникала ситуация, когда имя пользователя накладывалось на текстовое уведомление (например о некорректном вводе).
Улучшения сделаны как для маленьких разрешений (640x480), так и для больших.
владелец 9116ab05
......@@ -76,18 +76,23 @@ FocusScope {
UserList {
id: userListView
property bool isSmallSize: root.height < 600
visible: showUserList
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Layout.minimumHeight: implicitHeight
Layout.topMargin: PlasmaCore.Units.gridUnit * 0.5
Layout.bottomMargin: (constrainText && !isSmallSize) ? PlasmaCore.Units.gridUnit * 2 : 0
fontSize: root.fontSize
// bubble up the signal
onUserSelected: root.userSelected()
smallSize: root.height < 600
smallSize: isSmallSize
}
}
......
......@@ -20,6 +20,8 @@ Item {
property bool isCurrent: true
property bool smallSize: false
property string name
property string userName
property string avatarPath
......@@ -31,7 +33,7 @@ Item {
property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2
signal clicked()
property real faceSize: PlasmaCore.Units.gridUnit * 7
property real faceSize: smallSize ? PlasmaCore.Units.gridUnit * 4 : PlasmaCore.Units.gridUnit * 7
opacity: isCurrent ? 1.0 : 0.5
......@@ -158,7 +160,12 @@ Item {
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
wrapMode: Text.WordWrap
maximumLineCount: wrapper.constrainText ? 3 : 1
maximumLineCount:
{
if (wrapper.constrainText && !wrapper.smallSize) 3
else if (wrapper.constrainText && wrapper.smallSize) 2
else 1
}
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
//make an indication that this has active focus, this only happens when reached with keyboard navigation
......
......@@ -57,14 +57,13 @@ ListView {
interactive: count > 1
delegate: UserDelegate {
smallSize: view.smallSize
avatarPath: model.icon || ""
iconSource: model.iconName || "user-identity"
fontSize: view.fontSize
fontSize: smallSize ? view.fontSize - 3 : view.fontSize
needsPassword: model.needsPassword !== undefined ? model.needsPassword : true
vtNumber: model.vtNumber
faceSize: smallSize ? PlasmaCore.Units.gridUnit * 4 : PlasmaCore.Units.gridUnit * 7
name: {
const displayName = model.realName || model.name
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать