Changeset View
Changeset View
Standalone View
Standalone View
src/kcm/package/contents/ui/Devices.qml
Show All 14 Lines | 1 | /* | |||
---|---|---|---|---|---|
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | import QtQuick.Controls 1.3 | 23 | import QtQuick.Controls 2.3 | ||
24 | 24 | | |||
25 | ScrollView { | 25 | ScrollView { | ||
26 | id: scrollView | 26 | id: scrollView | ||
27 | 27 | | |||
28 | contentWidth: contentLayout.width | ||||
29 | contentHeight: contentLayout.height | ||||
30 | clip: true | ||||
31 | | ||||
32 | // Show the frame | ||||
33 | Component.onCompleted: scrollView.background.visible = true; | ||||
34 | | ||||
28 | ColumnLayout { | 35 | ColumnLayout { | ||
29 | Component.onCompleted: { | 36 | id: contentLayout | ||
30 | // Normal binding causes binding loops | 37 | | ||
31 | width = Qt.binding(function() { | 38 | // This doesn't cause a binding loop with the QQC2 scrollview, | ||
32 | return scrollView.viewport.width; | 39 | // but it does cause a horizontal scrollbar because the scrollview | ||
33 | }); | 40 | // is a few pixels wider than its viewport area, and the QQC2 version | ||
34 | } | 41 | // doesn't expose that property to let us precisely match its width. | ||
42 | // To deal with this, we manually reduce the width a few pixels. | ||||
43 | width: scrollView.width - 4 | ||||
35 | 44 | | |||
36 | Header { | 45 | Header { | ||
37 | Layout.fillWidth: true | 46 | Layout.fillWidth: true | ||
38 | enabled: sinks.count > 0 | 47 | enabled: sinks.count > 0 | ||
39 | text: i18nd("kcm_pulseaudio", "Outputs") | 48 | text: i18nd("kcm_pulseaudio", "Outputs") | ||
40 | disabledText: i18ndc("kcm_pulseaudio", "@label", "No Output Devices Available") | 49 | disabledText: i18ndc("kcm_pulseaudio", "@label", "No Output Devices Available") | ||
41 | } | 50 | } | ||
42 | 51 | | |||
Show All 29 Lines |