mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix registration state ui in account list
This commit is contained in:
parent
ecf79d530a
commit
46f19d5d64
7 changed files with 55 additions and 54 deletions
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
|
|
@ -1764,19 +1764,19 @@ QUrl Utils::getRegistrationStateIcon(LinphoneEnums::RegistrationState state) {
|
|||
QUrl registrationStateIcon;
|
||||
switch (state) {
|
||||
case LinphoneEnums::RegistrationState::Refreshing:
|
||||
registrationStateIcon = Utils::getAppIcon("regitrationProgress");
|
||||
registrationStateIcon = Utils::getAppIcon("registrationProgress");
|
||||
break;
|
||||
case LinphoneEnums::RegistrationState::Progress:
|
||||
registrationStateIcon = Utils::getAppIcon("regitrationProgress");
|
||||
registrationStateIcon = Utils::getAppIcon("registrationProgress");
|
||||
break;
|
||||
case LinphoneEnums::RegistrationState::Failed:
|
||||
registrationStateIcon = Utils::getAppIcon("regitrationError");
|
||||
registrationStateIcon = Utils::getAppIcon("registrationError");
|
||||
break;
|
||||
case LinphoneEnums::RegistrationState::Cleared:
|
||||
registrationStateIcon = Utils::getAppIcon("regitrationDeactivated");
|
||||
registrationStateIcon = Utils::getAppIcon("registrationDeactivated");
|
||||
break;
|
||||
case LinphoneEnums::RegistrationState::None:
|
||||
registrationStateIcon = Utils::getAppIcon("regitrationDeactivated");
|
||||
registrationStateIcon = Utils::getAppIcon("registrationDeactivated");
|
||||
break;
|
||||
default:
|
||||
registrationStateIcon = QUrl();
|
||||
|
|
|
|||
|
|
@ -116,10 +116,10 @@ Loader{
|
|||
z: 1
|
||||
source: account
|
||||
? (account.core?.registrationState !== LinphoneEnums.RegistrationState.Ok
|
||||
? account.core?.registrationStateIcon
|
||||
? account.core?.registrationIcon
|
||||
: account.core?.presenceIcon)
|
||||
: (contact
|
||||
? contact.core?.presenceIcon
|
||||
? contact.core?.presenceIcon
|
||||
: "")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,52 +63,53 @@ Control.Control{
|
|||
Layout.maximumWidth: Math.round(150 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
|
||||
Layout.preferredWidth: presenceOrRegistrationText.implicitWidth + Math.round(50 * DefaultStyle.dp)
|
||||
contentItem:
|
||||
Rectangle{
|
||||
id: presenceBar
|
||||
property bool isRegistered: mainItem.account?.core.registrationState == LinphoneEnums.RegistrationState.Ok
|
||||
color: DefaultStyle.main2_200
|
||||
radius: Math.round(15 * DefaultStyle.dp)
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
Image {
|
||||
sourceSize.width: 11 * DefaultStyle.dp
|
||||
sourceSize.height: 11 * DefaultStyle.dp
|
||||
smooth: false
|
||||
Layout.preferredWidth: 11 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 11 * DefaultStyle.dp
|
||||
source: presenceBar.isRegistered
|
||||
? mainItem.account.core.presenceIcon
|
||||
: mainItem.account?.core.registrationStateIcon || ""
|
||||
Layout.leftMargin: 8 * DefaultStyle.dp
|
||||
}
|
||||
Text {
|
||||
id: presenceOrRegistrationText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
visible: mainItem.account
|
||||
// Test texts
|
||||
// Timer{
|
||||
// running: true
|
||||
// interval: 1000
|
||||
// repeat: true
|
||||
// onTriggered: text.mode = (++text.mode) % 4
|
||||
// }
|
||||
font.weight: Math.round(300 * DefaultStyle.dp)
|
||||
font.pixelSize: Math.round(12 * DefaultStyle.dp)
|
||||
color: presenceBar.isRegistered ? mainItem.account.core.presenceColor : mainItem.account?.core.registrationColor
|
||||
text: presenceBar.isRegistered ? mainItem.account.core.presenceStatus : mainItem.account?.core.humaneReadableRegistrationState
|
||||
}
|
||||
EffectImage {
|
||||
fillMode: Image.PreserveAspectFit
|
||||
imageSource: AppIcons.downArrow
|
||||
colorizationColor: DefaultStyle.main2_600
|
||||
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
|
||||
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
|
||||
Layout.rightMargin: 8 * DefaultStyle.dp
|
||||
}
|
||||
enabled: mainItem.account && mainItem.account.core.registrationState === LinphoneEnums.RegistrationState.Ok
|
||||
onEnabledChanged: if(!enabled) close()
|
||||
contentItem: Rectangle {
|
||||
id: presenceBar
|
||||
property bool isRegistered: mainItem.account?.core.registrationState === LinphoneEnums.RegistrationState.Ok
|
||||
color: DefaultStyle.main2_200
|
||||
radius: Math.round(15 * DefaultStyle.dp)
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
Image {
|
||||
sourceSize.width: 11 * DefaultStyle.dp
|
||||
sourceSize.height: 11 * DefaultStyle.dp
|
||||
smooth: false
|
||||
Layout.preferredWidth: 11 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 11 * DefaultStyle.dp
|
||||
source: presenceBar.isRegistered
|
||||
? mainItem.account.core.presenceIcon
|
||||
: mainItem.account?.core.registrationIcon || ""
|
||||
Layout.leftMargin: 8 * DefaultStyle.dp
|
||||
}
|
||||
Text {
|
||||
id: presenceOrRegistrationText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
visible: mainItem.account
|
||||
// Test texts
|
||||
// Timer{
|
||||
// running: true
|
||||
// interval: 1000
|
||||
// repeat: true
|
||||
// onTriggered: text.mode = (++text.mode) % 4
|
||||
// }
|
||||
font.weight: Math.round(300 * DefaultStyle.dp)
|
||||
font.pixelSize: Math.round(12 * DefaultStyle.dp)
|
||||
color: presenceBar.isRegistered ? mainItem.account.core.presenceColor : mainItem.account?.core.registrationColor
|
||||
text: presenceBar.isRegistered ? mainItem.account.core.presenceStatus : mainItem.account?.core.humaneReadableRegistrationState
|
||||
}
|
||||
EffectImage {
|
||||
fillMode: Image.PreserveAspectFit
|
||||
imageSource: AppIcons.downArrow
|
||||
colorizationColor: DefaultStyle.main2_600
|
||||
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
|
||||
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
|
||||
Layout.rightMargin: 8 * DefaultStyle.dp
|
||||
}
|
||||
}
|
||||
}
|
||||
popup.contentItem: Rectangle {
|
||||
implicitWidth: 280 * DefaultStyle.dp
|
||||
implicitHeight: 20 * DefaultStyle.dp + (setCustomStatus.visible ? 240 * DefaultStyle.dp : setPresence.implicitHeight)
|
||||
|
|
|
|||
|
|
@ -139,9 +139,9 @@ QtObject {
|
|||
property string appWindow: "image://internal/app-window.svg"
|
||||
property string bellMwi: "image://internal/bell-simple.svg"
|
||||
property string callForward: "image://internal/call-forward.svg"
|
||||
property string regitrationDeactivated: "image://internal/regitration_deactivated.svg"
|
||||
property string regitrationProgress: "image://internal/regitration_progress.svg"
|
||||
property string regitrationError: "image://internal/regitration_error.svg"
|
||||
property string registrationDeactivated: "image://internal/registration_deactivated.svg"
|
||||
property string registrationProgress: "image://internal/registration_progress.svg"
|
||||
property string registrationError: "image://internal/registration_error.svg"
|
||||
property string presenceOnline: "image://internal/presence_online.svg"
|
||||
property string presenceAway: "image://internal/presence_away.svg"
|
||||
property string presenceBusy: "image://internal/presence_busy.svg"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue