mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
feat(SettingsWindow): disable video tab when video is not enabled at compile time
This commit is contained in:
parent
7f42542deb
commit
d2999acacd
5 changed files with 33 additions and 12 deletions
|
|
@ -240,6 +240,10 @@ void SettingsModel::setVideoDefinition (const QVariantMap &definition) {
|
|||
emit videoDefinitionChanged(definition);
|
||||
}
|
||||
|
||||
bool SettingsModel::getVideoSupported () const {
|
||||
return CoreManager::getInstance()->getCore()->videoSupported();
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Chat & calls.
|
||||
// =============================================================================
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ class SettingsModel : public QObject {
|
|||
|
||||
Q_PROPERTY(QVariantMap videoDefinition READ getVideoDefinition WRITE setVideoDefinition NOTIFY videoDefinitionChanged);
|
||||
|
||||
Q_PROPERTY(bool videoSupported READ getVideoSupported CONSTANT);
|
||||
|
||||
// Chat & calls. -------------------------------------------------------------
|
||||
|
||||
Q_PROPERTY(bool autoAnswerStatus READ getAutoAnswerStatus WRITE setAutoAnswerStatus NOTIFY autoAnswerStatusChanged);
|
||||
|
|
@ -192,6 +194,8 @@ public:
|
|||
QVariantMap getVideoDefinition () const;
|
||||
void setVideoDefinition (const QVariantMap &definition);
|
||||
|
||||
bool getVideoSupported () const;
|
||||
|
||||
// Chat & calls. -------------------------------------------------------------
|
||||
|
||||
bool getAutoAnswerStatus () const;
|
||||
|
|
|
|||
|
|
@ -24,13 +24,17 @@ Controls.TabButton {
|
|||
return TabButtonStyle.backgroundColor.selected
|
||||
}
|
||||
|
||||
return button.down
|
||||
? TabButtonStyle.backgroundColor.pressed
|
||||
: (
|
||||
button.hovered
|
||||
? TabButtonStyle.backgroundColor.hovered
|
||||
: TabButtonStyle.backgroundColor.normal
|
||||
return button.enabled
|
||||
? (
|
||||
button.down
|
||||
? TabButtonStyle.backgroundColor.pressed
|
||||
: (
|
||||
button.hovered
|
||||
? TabButtonStyle.backgroundColor.hovered
|
||||
: TabButtonStyle.backgroundColor.normal
|
||||
)
|
||||
)
|
||||
: TabButtonStyle.backgroundColor.disabled
|
||||
}
|
||||
|
||||
function _getTextColor () {
|
||||
|
|
@ -38,13 +42,17 @@ Controls.TabButton {
|
|||
return TabButtonStyle.text.color.selected
|
||||
}
|
||||
|
||||
return button.down
|
||||
? TabButtonStyle.text.color.pressed
|
||||
: (
|
||||
button.hovered
|
||||
? TabButtonStyle.text.color.hovered
|
||||
: TabButtonStyle.text.color.normal
|
||||
return button.enabled
|
||||
? (
|
||||
button.down
|
||||
? TabButtonStyle.text.color.pressed
|
||||
: (
|
||||
button.hovered
|
||||
? TabButtonStyle.text.color.hovered
|
||||
: TabButtonStyle.text.color.normal
|
||||
)
|
||||
)
|
||||
: TabButtonStyle.text.color.disabled
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ QtObject {
|
|||
property int spacing: 8
|
||||
|
||||
property QtObject backgroundColor: QtObject {
|
||||
property color disabled: Colors.i30
|
||||
property color hovered: Colors.s
|
||||
property color normal: Colors.i
|
||||
property color pressed: Colors.t
|
||||
|
|
@ -27,6 +28,7 @@ QtObject {
|
|||
property int rightPadding: 10
|
||||
|
||||
property QtObject color: QtObject {
|
||||
property color disabled: Colors.k
|
||||
property color hovered: Colors.k
|
||||
property color normal: Colors.k
|
||||
property color pressed: Colors.k
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3
|
|||
|
||||
import Common 1.0
|
||||
import Common.Styles 1.0
|
||||
import Linphone 1.0
|
||||
|
||||
import App.Styles 1.0
|
||||
|
||||
|
|
@ -59,6 +60,8 @@ ApplicationWindow {
|
|||
}
|
||||
|
||||
TabButton {
|
||||
enabled: SettingsModel.videoSupported
|
||||
|
||||
iconName: 'settings_video'
|
||||
text: qsTr('videoTab')
|
||||
width: implicitWidth
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue