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;
|
QUrl registrationStateIcon;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case LinphoneEnums::RegistrationState::Refreshing:
|
case LinphoneEnums::RegistrationState::Refreshing:
|
||||||
registrationStateIcon = Utils::getAppIcon("regitrationProgress");
|
registrationStateIcon = Utils::getAppIcon("registrationProgress");
|
||||||
break;
|
break;
|
||||||
case LinphoneEnums::RegistrationState::Progress:
|
case LinphoneEnums::RegistrationState::Progress:
|
||||||
registrationStateIcon = Utils::getAppIcon("regitrationProgress");
|
registrationStateIcon = Utils::getAppIcon("registrationProgress");
|
||||||
break;
|
break;
|
||||||
case LinphoneEnums::RegistrationState::Failed:
|
case LinphoneEnums::RegistrationState::Failed:
|
||||||
registrationStateIcon = Utils::getAppIcon("regitrationError");
|
registrationStateIcon = Utils::getAppIcon("registrationError");
|
||||||
break;
|
break;
|
||||||
case LinphoneEnums::RegistrationState::Cleared:
|
case LinphoneEnums::RegistrationState::Cleared:
|
||||||
registrationStateIcon = Utils::getAppIcon("regitrationDeactivated");
|
registrationStateIcon = Utils::getAppIcon("registrationDeactivated");
|
||||||
break;
|
break;
|
||||||
case LinphoneEnums::RegistrationState::None:
|
case LinphoneEnums::RegistrationState::None:
|
||||||
registrationStateIcon = Utils::getAppIcon("regitrationDeactivated");
|
registrationStateIcon = Utils::getAppIcon("registrationDeactivated");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
registrationStateIcon = QUrl();
|
registrationStateIcon = QUrl();
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ Loader{
|
||||||
z: 1
|
z: 1
|
||||||
source: account
|
source: account
|
||||||
? (account.core?.registrationState !== LinphoneEnums.RegistrationState.Ok
|
? (account.core?.registrationState !== LinphoneEnums.RegistrationState.Ok
|
||||||
? account.core?.registrationStateIcon
|
? account.core?.registrationIcon
|
||||||
: account.core?.presenceIcon)
|
: account.core?.presenceIcon)
|
||||||
: (contact
|
: (contact
|
||||||
? contact.core?.presenceIcon
|
? contact.core?.presenceIcon
|
||||||
|
|
|
||||||
|
|
@ -63,52 +63,53 @@ Control.Control{
|
||||||
Layout.maximumWidth: Math.round(150 * DefaultStyle.dp)
|
Layout.maximumWidth: Math.round(150 * DefaultStyle.dp)
|
||||||
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
|
||||||
Layout.preferredWidth: presenceOrRegistrationText.implicitWidth + Math.round(50 * DefaultStyle.dp)
|
Layout.preferredWidth: presenceOrRegistrationText.implicitWidth + Math.round(50 * DefaultStyle.dp)
|
||||||
contentItem:
|
enabled: mainItem.account && mainItem.account.core.registrationState === LinphoneEnums.RegistrationState.Ok
|
||||||
Rectangle{
|
onEnabledChanged: if(!enabled) close()
|
||||||
id: presenceBar
|
contentItem: Rectangle {
|
||||||
property bool isRegistered: mainItem.account?.core.registrationState == LinphoneEnums.RegistrationState.Ok
|
id: presenceBar
|
||||||
color: DefaultStyle.main2_200
|
property bool isRegistered: mainItem.account?.core.registrationState === LinphoneEnums.RegistrationState.Ok
|
||||||
radius: Math.round(15 * DefaultStyle.dp)
|
color: DefaultStyle.main2_200
|
||||||
RowLayout {
|
radius: Math.round(15 * DefaultStyle.dp)
|
||||||
anchors.fill: parent
|
RowLayout {
|
||||||
Image {
|
anchors.fill: parent
|
||||||
sourceSize.width: 11 * DefaultStyle.dp
|
Image {
|
||||||
sourceSize.height: 11 * DefaultStyle.dp
|
sourceSize.width: 11 * DefaultStyle.dp
|
||||||
smooth: false
|
sourceSize.height: 11 * DefaultStyle.dp
|
||||||
Layout.preferredWidth: 11 * DefaultStyle.dp
|
smooth: false
|
||||||
Layout.preferredHeight: 11 * DefaultStyle.dp
|
Layout.preferredWidth: 11 * DefaultStyle.dp
|
||||||
source: presenceBar.isRegistered
|
Layout.preferredHeight: 11 * DefaultStyle.dp
|
||||||
? mainItem.account.core.presenceIcon
|
source: presenceBar.isRegistered
|
||||||
: mainItem.account?.core.registrationStateIcon || ""
|
? mainItem.account.core.presenceIcon
|
||||||
Layout.leftMargin: 8 * DefaultStyle.dp
|
: mainItem.account?.core.registrationIcon || ""
|
||||||
}
|
Layout.leftMargin: 8 * DefaultStyle.dp
|
||||||
Text {
|
}
|
||||||
id: presenceOrRegistrationText
|
Text {
|
||||||
verticalAlignment: Text.AlignVCenter
|
id: presenceOrRegistrationText
|
||||||
horizontalAlignment: Text.AlignHCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
visible: mainItem.account
|
horizontalAlignment: Text.AlignHCenter
|
||||||
// Test texts
|
visible: mainItem.account
|
||||||
// Timer{
|
// Test texts
|
||||||
// running: true
|
// Timer{
|
||||||
// interval: 1000
|
// running: true
|
||||||
// repeat: true
|
// interval: 1000
|
||||||
// onTriggered: text.mode = (++text.mode) % 4
|
// repeat: true
|
||||||
// }
|
// onTriggered: text.mode = (++text.mode) % 4
|
||||||
font.weight: Math.round(300 * DefaultStyle.dp)
|
// }
|
||||||
font.pixelSize: Math.round(12 * DefaultStyle.dp)
|
font.weight: Math.round(300 * DefaultStyle.dp)
|
||||||
color: presenceBar.isRegistered ? mainItem.account.core.presenceColor : mainItem.account?.core.registrationColor
|
font.pixelSize: Math.round(12 * DefaultStyle.dp)
|
||||||
text: presenceBar.isRegistered ? mainItem.account.core.presenceStatus : mainItem.account?.core.humaneReadableRegistrationState
|
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
|
EffectImage {
|
||||||
imageSource: AppIcons.downArrow
|
fillMode: Image.PreserveAspectFit
|
||||||
colorizationColor: DefaultStyle.main2_600
|
imageSource: AppIcons.downArrow
|
||||||
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
|
colorizationColor: DefaultStyle.main2_600
|
||||||
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
|
||||||
Layout.rightMargin: 8 * DefaultStyle.dp
|
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
|
||||||
}
|
Layout.rightMargin: 8 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
popup.contentItem: Rectangle {
|
popup.contentItem: Rectangle {
|
||||||
implicitWidth: 280 * DefaultStyle.dp
|
implicitWidth: 280 * DefaultStyle.dp
|
||||||
implicitHeight: 20 * DefaultStyle.dp + (setCustomStatus.visible ? 240 * DefaultStyle.dp : setPresence.implicitHeight)
|
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 appWindow: "image://internal/app-window.svg"
|
||||||
property string bellMwi: "image://internal/bell-simple.svg"
|
property string bellMwi: "image://internal/bell-simple.svg"
|
||||||
property string callForward: "image://internal/call-forward.svg"
|
property string callForward: "image://internal/call-forward.svg"
|
||||||
property string regitrationDeactivated: "image://internal/regitration_deactivated.svg"
|
property string registrationDeactivated: "image://internal/registration_deactivated.svg"
|
||||||
property string regitrationProgress: "image://internal/regitration_progress.svg"
|
property string registrationProgress: "image://internal/registration_progress.svg"
|
||||||
property string regitrationError: "image://internal/regitration_error.svg"
|
property string registrationError: "image://internal/registration_error.svg"
|
||||||
property string presenceOnline: "image://internal/presence_online.svg"
|
property string presenceOnline: "image://internal/presence_online.svg"
|
||||||
property string presenceAway: "image://internal/presence_away.svg"
|
property string presenceAway: "image://internal/presence_away.svg"
|
||||||
property string presenceBusy: "image://internal/presence_busy.svg"
|
property string presenceBusy: "image://internal/presence_busy.svg"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue