diff --git a/src/components/settings/SettingsModel.cpp b/src/components/settings/SettingsModel.cpp index 86117ee78..1a1ca87fb 100644 --- a/src/components/settings/SettingsModel.cpp +++ b/src/components/settings/SettingsModel.cpp @@ -240,6 +240,10 @@ void SettingsModel::setVideoDefinition (const QVariantMap &definition) { emit videoDefinitionChanged(definition); } +bool SettingsModel::getVideoSupported () const { + return CoreManager::getInstance()->getCore()->videoSupported(); +} + // ============================================================================= // Chat & calls. // ============================================================================= diff --git a/src/components/settings/SettingsModel.hpp b/src/components/settings/SettingsModel.hpp index e213bc666..a6b7cd9e4 100644 --- a/src/components/settings/SettingsModel.hpp +++ b/src/components/settings/SettingsModel.hpp @@ -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; diff --git a/ui/modules/Common/Form/Tab/TabButton.qml b/ui/modules/Common/Form/Tab/TabButton.qml index a47bb20b0..6a0a63353 100644 --- a/ui/modules/Common/Form/Tab/TabButton.qml +++ b/ui/modules/Common/Form/Tab/TabButton.qml @@ -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 } // --------------------------------------------------------------------------- diff --git a/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml b/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml index 636407323..e4badee9d 100644 --- a/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml +++ b/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml @@ -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 diff --git a/ui/views/App/Settings/SettingsWindow.qml b/ui/views/App/Settings/SettingsWindow.qml index 2076c4cef..75d7b54b0 100644 --- a/ui/views/App/Settings/SettingsWindow.qml +++ b/ui/views/App/Settings/SettingsWindow.qml @@ -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