[applets]: Fix scrolling in ScrollViews

CCBUG: 448243
wilder-5.24
Carl Schwan 4 years ago committed by Nate Graham
parent f02adab757
commit 8d3ec2f898
  1. 12
      applets/batterymonitor/package/contents/ui/PopupDialog.qml
  2. 7
      applets/devicenotifier/package/contents/ui/FullRepresentation.qml
  3. 9
      applets/notifications/package/contents/ui/FullRepresentation.qml

@ -161,17 +161,7 @@ PlasmaComponents3.Page {
KeyNavigation.backtab: pmSwitch
delegate: BatteryItem {
// Add a padding between an item and the scroll bar.
// Anchors are well-behaved in RTL environments too.
anchors {
left: parent ? parent.left : undefined
right: parent ? parent.right : undefined
rightMargin: {
const scrollBar = batteryScrollView.PlasmaComponents3.ScrollBar.vertical;
const hasScrollBar = scrollBar !== null && scrollBar.visible;
return hasScrollBar ? (PlasmaCore.Units.smallSpacing * 2) : 0;
}
}
width: ListView.view.width
battery: model
remainingTime: dialog.remainingTime
matchHeightOfSlider: brightnessSlider.slider

@ -120,9 +120,6 @@ PlasmaExtras.Representation {
PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff
anchors.fill: parent
leftPadding: PlasmaCore.Units.smallSpacing * 2
rightPadding: PlasmaCore.Units.smallSpacing * 2
contentItem: ListView {
id: notifierDialog
@ -131,7 +128,7 @@ PlasmaExtras.Representation {
model: filterModel
delegate: DeviceItem {
width: notifierDialog.width - (scrollView.PlasmaComponents3.ScrollBar.vertical.visible ? PlasmaCore.Units.smallSpacing * 4 : 0)
width: ListView.view.width - PlasmaCore.Units.smallSpacing * 4
udi: DataEngineSource
}
highlight: PlasmaComponents.Highlight { }
@ -140,6 +137,8 @@ PlasmaExtras.Representation {
topMargin: PlasmaCore.Units.smallSpacing * 2
bottomMargin: PlasmaCore.Units.smallSpacing * 2
leftMargin: PlasmaCore.Units.smallSpacing * 2
rightMargin: PlasmaCore.Units.smallSpacing * 2
spacing: PlasmaCore.Units.smallSpacing
currentIndex: devicenotifier.currentIndex

@ -228,10 +228,6 @@ PlasmaExtras.Representation {
id: scrollView
anchors.fill: parent
background: null
leftPadding: PlasmaCore.Units.smallSpacing * 2
rightPadding: PlasmaCore.Units.smallSpacing * 2
// HACK: workaround for https://bugreports.qt.io/browse/QTBUG-83890
PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff
@ -239,8 +235,11 @@ PlasmaExtras.Representation {
id: list
model: historyModel
currentIndex: -1
topMargin: PlasmaCore.Units.smallSpacing * 2
bottomMargin: PlasmaCore.Units.smallSpacing * 2
leftMargin: PlasmaCore.Units.smallSpacing * 2
rightMargin: PlasmaCore.Units.smallSpacing * 2
spacing: PlasmaCore.Units.smallSpacing
Keys.onDeletePressed: {
@ -355,7 +354,7 @@ PlasmaExtras.Representation {
delegate: DraggableDelegate {
id: delegate
width: ListView.view.width - (scrollView.PlasmaComponents3.ScrollBar.vertical.visible ? PlasmaCore.Units.smallSpacing * 4 : 0)
width: ListView.view.width - PlasmaCore.Units.smallSpacing * 4
contentItem: delegateLoader
draggable: !model.isGroup && model.type != NotificationManager.Notifications.JobType

Loading…
Cancel
Save