Commit d34ae3f0 authored by Nate Graham's avatar Nate Graham
Browse files

[applet] Use section separator consistent with plasma-nm applet

This commit makes the Bluetooth applet use a single line separator
between the Connected and Available sections--just like the plasma-nm
applet does--which is consistent with the master System Tray applet
mockups.
parent a15e2cc8
......@@ -48,6 +48,8 @@ PlasmaComponents3.Page {
FocusScope {
anchors.fill: parent
anchors.topMargin: PlasmaCore.Units.smallSpacing
focus: true
PlasmaBt.DevicesProxyModel {
......@@ -71,8 +73,25 @@ PlasmaComponents3.Page {
enabled: btManager.bluetoothOperational
boundsBehavior: Flickable.StopAtBounds
section.property: "Section"
section.delegate: Header {
text: section == "Connected" ? i18n("Connected devices") : i18n("Available devices")
// We want to hide the section delegate for the "Connected"
// group because it's unnecessary; all we want to do here is
// separate the connected devices from the available ones
section.delegate: Loader {
active: section != "Connected"
sourceComponent: Item {
width: listView.width
height: PlasmaCore.Units.gridUnit
PlasmaCore.SvgItem {
width: parent.width - PlasmaCore.Units.gridUnit * 2
anchors.centerIn: parent
id: separatorLine
svg: PlasmaCore.Svg {
imagePath: "widgets/line"
}
elementId: "horizontal-line"
}
}
}
highlight: PlasmaComponents.Highlight { }
highlightMoveDuration: PlasmaCore.Units.longDuration
......
/*
SPDX-FileCopyrightText: 2013-2014 Jan Grulich <jgrulich@redhat.com>
SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents // for ListItem
import org.kde.plasma.components 3.0 as PlasmaComponents3
PlasmaComponents.ListItem {
id: header
property alias text: headerLabel.text
anchors {
left: parent.left
right: parent.right
}
height: headerLabel.height + PlasmaCore.Units.gridUnit
sectionDelegate: true
PlasmaComponents3.Label {
id: headerLabel
anchors.centerIn: parent
font.weight: Font.DemiBold
elide: Text.ElideRight
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment