Commit b2ccb21c authored by Noah Davis's avatar Noah Davis 🌵

Move TabBar to header, maximize volume to footer

After recieving complaints that the UI was being changed too frequently
for reasons that aren't easy to guess, I've moved the controls around once again.

This layout is similar to older versions of the plasma-pa applet, but keeps the maximize volume checkbox in the footer.

To users using the stable version of Plasma,
the mute and configure buttons will have been moved to the header
and the maximize volume checkbox will stay in the footer

We should stop rearranging the UI of this applet for a while after this commit.
parent 839223aa
......@@ -433,33 +433,27 @@ Item {
header: PlasmaExtras.PlasmoidHeading {
// Make this toolbar's buttons align vertically with the ones above
rightPadding: -PlasmaCore.Units.devicePixelRatio
// Allow tabbar to touch the header's bottom border
bottomPadding: -bottomInset
RowLayout {
anchors.fill: parent
PlasmaComponents3.CheckBox {
id: raiseMaximumVolumeCheckbox
checked: plasmoid.configuration.raiseMaximumVolume
onToggled: {
plasmoid.configuration.raiseMaximumVolume = checked
if (!checked) {
for (var i = 0; i < paSinkModel.rowCount(); i++) {
if (paSinkModel.data(paSinkModel.index(i, 0), paSinkModel.role("Volume")) > PulseAudio.NormalVolume) {
paSinkModel.setData(paSinkModel.index(i, 0), PulseAudio.NormalVolume, paSinkModel.role("Volume"));
}
}
for (var i = 0; i < paSourceModel.rowCount(); i++) {
if (paSourceModel.data(paSourceModel.index(i, 0), paSourceModel.role("Volume")) > PulseAudio.NormalVolume) {
paSourceModel.setData(paSourceModel.index(i, 0), PulseAudio.NormalVolume, paSourceModel.role("Volume"));
}
}
}
PlasmaComponents.TabBar {
id: tabBar
Layout.fillWidth: true
activeFocusOnTab: true
tabPosition: Qt.TopEdge
PlasmaComponents.TabButton {
id: devicesTab
text: i18n("Devices")
}
text: i18n("Raise maximum volume")
}
Item {
Layout.fillWidth: true
PlasmaComponents.TabButton {
id: streamsTab
text: i18n("Applications")
}
}
PlasmaComponents3.ToolButton {
......@@ -640,29 +634,30 @@ Item {
}
footer: PlasmaExtras.PlasmoidHeading {
height: parent.header.height
location: PlasmaExtras.PlasmoidHeading.Location.Footer
// Allow tabbar to touch the footer's top border
topPadding: -topInset
RowLayout {
anchors.fill: parent
PlasmaComponents.TabBar {
id: tabBar
Layout.fillWidth: true
activeFocusOnTab: true
tabPosition: Qt.BottomEdge
PlasmaComponents.TabButton {
id: devicesTab
text: i18n("Devices")
}
PlasmaComponents.TabButton {
id: streamsTab
text: i18n("Applications")
PlasmaComponents3.CheckBox {
id: raiseMaximumVolumeCheckbox
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
checked: plasmoid.configuration.raiseMaximumVolume
onToggled: {
plasmoid.configuration.raiseMaximumVolume = checked
if (!checked) {
for (var i = 0; i < paSinkModel.rowCount(); i++) {
if (paSinkModel.data(paSinkModel.index(i, 0), paSinkModel.role("Volume")) > PulseAudio.NormalVolume) {
paSinkModel.setData(paSinkModel.index(i, 0), PulseAudio.NormalVolume, paSinkModel.role("Volume"));
}
}
for (var i = 0; i < paSourceModel.rowCount(); i++) {
if (paSourceModel.data(paSourceModel.index(i, 0), paSourceModel.role("Volume")) > PulseAudio.NormalVolume) {
paSourceModel.setData(paSourceModel.index(i, 0), PulseAudio.NormalVolume, paSourceModel.role("Volume"));
}
}
}
}
text: i18n("Raise maximum volume")
}
}
}
......
Markdown is supported
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