Commit 3121da66 authored by Fushan Wen's avatar Fushan Wen Committed by Nate Graham
Browse files

taskmanager: Estimate the size of grouped tooltips

On Wayland, a tooltip has a significant resize process, so estimate the size first.

This also fixes the bug that in RTL environment, grouped task tooltips
don't resize correctly.

BUG: 452142
parent 923b9423
Pipeline #162816 passed with stage
in 3 minutes and 10 seconds
......@@ -90,8 +90,8 @@ Loader {
PlasmaComponents3.ScrollView {
// 2 * PlasmaCore.Units.smallSpacing is for the margin of tooltipDialog
implicitWidth: leftPadding + rightPadding + Math.min(Screen.desktopAvailableWidth - 2 * PlasmaCore.Units.smallSpacing, contentItem.contentItem.childrenRect.width)
implicitHeight: bottomPadding + Math.min(Screen.desktopAvailableHeight - 2 * PlasmaCore.Units.smallSpacing, contentItem.contentItem.childrenRect.height)
implicitWidth: leftPadding + rightPadding + Math.min(Screen.desktopAvailableWidth - 2 * PlasmaCore.Units.smallSpacing, Math.max(delegateModel.estimatedWidth, contentItem.contentItem.childrenRect.width))
implicitHeight: bottomPadding + Math.min(Screen.desktopAvailableHeight - 2 * PlasmaCore.Units.smallSpacing, Math.max(delegateModel.estimatedHeight, contentItem.contentItem.childrenRect.height))
// HACK: workaround for https://bugreports.qt.io/browse/QTBUG-83890
PlasmaComponents3.ScrollBar.horizontal.policy: isVerticalPanel ? PlasmaComponents3.ScrollBar.AlwaysOff : PlasmaComponents3.ScrollBar.AsNeeded
......@@ -101,6 +101,12 @@ Loader {
id: groupToolTipListView
model: DelegateModel {
id: delegateModel
// On Wayland, a tooltip has a significant resizing process, so estimate the size first.
readonly property int estimatedWidth: (toolTipDelegate.isVerticalPanel ? 1 : count) * (toolTipDelegate.tooltipInstanceMaximumWidth + PlasmaCore.Units.smallSpacing * 2) - PlasmaCore.Units.smallSpacing * 2
readonly property int estimatedHeight: (toolTipDelegate.isVerticalPanel ? count : 1) * (toolTipDelegate.tooltipInstanceMaximumWidth / 2 + PlasmaCore.Units.smallSpacing * 2) - PlasmaCore.Units.smallSpacing * 2
model: toolTipDelegate.hasRootIndex ? tasksModel : null
rootIndex: toolTipDelegate.rootIndex
......
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