feat(SettingsWindow): disable video tab when video is not enabled at compile time

This commit is contained in:
Ronan Abhamon 2018-04-16 11:00:28 +02:00
parent 7f42542deb
commit d2999acacd
5 changed files with 33 additions and 12 deletions

View file

@ -240,6 +240,10 @@ void SettingsModel::setVideoDefinition (const QVariantMap &definition) {
emit videoDefinitionChanged(definition);
}
bool SettingsModel::getVideoSupported () const {
return CoreManager::getInstance()->getCore()->videoSupported();
}
// =============================================================================
// Chat & calls.
// =============================================================================

View file

@ -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;

View file

@ -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
}
// ---------------------------------------------------------------------------

View file

@ -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

View file

@ -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