SettingsWindow.qml 3.11 KB
Newer Older
Ronan's avatar
Ronan committed
1
import QtQuick 2.7
2
import QtQuick.Controls 2.2
Ronan's avatar
Ronan committed
3 4 5
import QtQuick.Layouts 1.3

import Common 1.0
6
import Common.Styles 1.0
Ronan's avatar
Ronan committed
7 8 9 10 11 12

import App.Styles 1.0

// =============================================================================

ApplicationWindow {
13 14
  id: window

Ronan's avatar
Ronan committed
15

16 17
  minimumHeight: SettingsWindowStyle.height
  minimumWidth: SettingsWindowStyle.width
Ronan's avatar
Ronan committed
18 19

  title: qsTr('settingsTitle')
20 21 22 23 24 25 26 27 28

  // ---------------------------------------------------------------------------

  Shortcut {
    sequence: StandardKey.Close
    onActivated: window.hide()
  }

  // ---------------------------------------------------------------------------
Ronan's avatar
Ronan committed
29

30 31
  Rectangle {
    anchors.fill: parent
32
    color: SettingsWindowStyle.color
33 34
  }

Ronan's avatar
Ronan committed
35 36 37 38 39 40 41 42
  ColumnLayout {
    anchors.fill: parent
    spacing: 0

    // -------------------------------------------------------------------------
    // Navigation bar.
    // -------------------------------------------------------------------------

43
    RowLayout {
Ronan's avatar
Ronan committed
44
      Layout.fillWidth: true
45 46 47 48 49 50
      spacing: 0

      TabBar {
        id: tabBar

        TabButton {
51
          iconName: 'settings_sip_accounts'
52 53 54 55 56
          text: qsTr('sipAccountsTab')
          width: implicitWidth
        }

        TabButton {
57
          iconName: 'settings_audio'
58 59 60 61 62
          text: qsTr('audioTab')
          width: implicitWidth
        }

        TabButton {
63
          iconName: 'settings_video'
64 65 66 67 68
          text: qsTr('videoTab')
          width: implicitWidth
        }

        TabButton {
69
          iconName: 'settings_call'
70 71 72 73 74
          text: qsTr('callsAndChatTab')
          width: implicitWidth
        }

        TabButton {
75
          iconName: 'settings_network'
76 77 78 79 80
          text: qsTr('networkTab')
          width: implicitWidth
        }

        TabButton {
81
          iconName: 'settings_advanced'
82 83 84
          text: qsTr('uiTab')
          width: implicitWidth
        }
85 86

        TabButton {
87
          iconName: 'settings_advanced'
88 89 90
          text: qsTr('uiAdvanced')
          width: implicitWidth
        }
Ronan's avatar
Ronan committed
91 92
      }

93 94 95
      Rectangle {
        Layout.fillWidth: true
        Layout.preferredHeight: TabButtonStyle.text.height
Ronan's avatar
Ronan committed
96

97
        color: TabButtonStyle.backgroundColor.normal
Ronan's avatar
Ronan committed
98 99 100 101 102 103 104 105 106 107
      }
    }

    // -------------------------------------------------------------------------
    // Content.
    // -------------------------------------------------------------------------

    StackLayout {
      Layout.fillHeight: true
      Layout.fillWidth: true
108 109

      currentIndex: tabBar.currentIndex
Ronan's avatar
Ronan committed
110 111 112 113 114 115 116

      SettingsSipAccounts {}
      SettingsAudio {}
      SettingsVideo {}
      SettingsCallsChat {}
      SettingsNetwork {}
      SettingsUi {}
117
      SettingsAdvanced {}
Ronan's avatar
Ronan committed
118 119 120 121 122 123 124 125
    }

    // -------------------------------------------------------------------------
    // Buttons.
    // -------------------------------------------------------------------------

    TextButtonB {
      Layout.alignment: Qt.AlignRight
126
      Layout.topMargin: SettingsWindowStyle.validButton.topMargin
Ronan's avatar
Ronan committed
127 128 129 130
      Layout.bottomMargin: SettingsWindowStyle.validButton.bottomMargin
      Layout.rightMargin: SettingsWindowStyle.validButton.rightMargin

      text: qsTr('validButton')
131

132
      onClicked: window.close()
Ronan's avatar
Ronan committed
133 134 135
    }
  }
}