fix(shell): scroll long tray menus
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import Quickshell.Services.SystemTray
|
||||
import qs.Commons
|
||||
@@ -446,9 +447,21 @@ BarWidget {
|
||||
contentWidth: trayMenuPopup.fittedContentWidth(Style.space(232))
|
||||
contentHeight: trayMenuPopup.fittedContentHeight(trayMenuColumn.implicitHeight, Style.space(420))
|
||||
|
||||
Flickable {
|
||||
id: trayMenuFlick
|
||||
anchors.fill: parent
|
||||
contentWidth: width
|
||||
contentHeight: trayMenuColumn.implicitHeight
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
interactive: contentHeight > height
|
||||
|
||||
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }
|
||||
|
||||
Column {
|
||||
id: trayMenuColumn
|
||||
anchors.fill: parent
|
||||
width: trayMenuFlick.width
|
||||
spacing: 0
|
||||
|
||||
Repeater {
|
||||
@@ -563,6 +576,7 @@ BarWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Renders a tray icon, recoloring symbolic icons to the bar foreground so
|
||||
// they stay visible on any theme (a raw symbolic icon keeps its baked-in
|
||||
|
||||
@@ -4,6 +4,11 @@ set -euo pipefail
|
||||
|
||||
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
|
||||
|
||||
if ! perl -0ne 'exit(/id:\s*trayMenuPopup.*?Flickable\s*\{.*?contentHeight:\s*trayMenuColumn\.implicitHeight.*?ScrollBar\.vertical:\s*ScrollBar/s ? 0 : 1)' "$ROOT/shell/plugins/bar/widgets/Tray.qml"; then
|
||||
fail "tray menu keeps capped content scrollable"
|
||||
fi
|
||||
pass "tray menu keeps capped content scrollable"
|
||||
|
||||
run_node_test "tray model helpers" <<'JS'
|
||||
const tray = requireFromRoot('shell/plugins/bar/widgets/TrayModel.js')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user