Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

qml: Blurred indicator & menu drop downs #456

Open
wants to merge 1 commit into
base: xenial
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions qml/Panel/MenuContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ import Utils 0.1
import "../Components"
import "Indicators"

Rectangle {
Item {
id: content

property QtObject model: null
property int currentMenuIndex: -1
property Component pageDelegate

color: theme.palette.normal.background

width: units.gu(40)
height: units.gu(42)

Expand Down
15 changes: 15 additions & 0 deletions qml/Panel/Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import "Indicators"

Item {
id: root

readonly property real panelHeight: panelArea.y + minimizedPanelHeight
readonly property bool fullyClosed: indicators.fullyClosed && applicationMenus.fullyClosed

Expand All @@ -49,6 +50,8 @@ Item {
property bool hasKeyboard: false
property bool supportsMultiColorLed: true

property var blurSource : null

// Whether our expanded menus should take up the full width of the panel
property bool partialWidth: width >= units.gu(60)

Expand Down Expand Up @@ -273,6 +276,11 @@ Item {
enableHint: !callHint.active && !fullscreenMode
showOnClick: false
panelColor: panelAreaBackground.color
blurSource: root.blurSource
blurRect: Qt.rect(x,
0,
root.width,
root.height)

onShowTapped: {
if (callHint.active) {
Expand Down Expand Up @@ -322,6 +330,7 @@ Item {
enabled: d.enableTouchMenus
opacity: d.showTouchMenu ? 1 : 0
visible: opacity != 0
clip: true
Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }

onEnabledChanged: {
Expand Down Expand Up @@ -395,6 +404,11 @@ Item {
enableHint: !callHint.active && !fullscreenMode
showOnClick: !callHint.visible
panelColor: panelAreaBackground.color
blurSource: root.blurSource
blurRect: Qt.rect(x,
0,
root.width,
root.height)

// On small screens, the Indicators' handle area is the entire top
// bar unless there is an application menu. In that case, our handle
Expand Down Expand Up @@ -463,6 +477,7 @@ Item {

enabled: !applicationMenus.expanded
opacity: !callHint.visible && !applicationMenus.expanded ? 1 : 0
clip: true
Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }

onEnabledChanged: {
Expand Down
19 changes: 19 additions & 0 deletions qml/Panel/PanelMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ Showable {
property alias rowItemDelegate: bar.rowItemDelegate
property alias pageDelegate: content.pageDelegate

property var blurSource : null
property rect blurRect : Qt.rect(0, 0, 0, 0)

readonly property real unitProgress: Math.max(0, (height - minimizedPanelHeight) / (openedHeight - minimizedPanelHeight))
readonly property bool fullyOpened: unitProgress >= 1
readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0
Expand Down Expand Up @@ -89,6 +92,17 @@ Showable {

onUnitProgressChanged: d.updateState()

BackgroundBlur {
x: 0
y: 0
width: root.blurRect.width
height: root.blurRect.height
visible: root.height > root.minimizedPanelHeight
sourceItem: root.blurSource
blurRect: root.blurRect
occluding: false
}

Item {
anchors {
left: parent.left
Expand All @@ -98,6 +112,11 @@ Showable {
}
clip: root.partiallyOpened

Rectangle {
color: "#BF000000"
anchors.fill: parent
}

// eater
MouseArea {
anchors.fill: content
Expand Down
1 change: 1 addition & 0 deletions qml/Shell.qml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ StyledItem {
id: panel
objectName: "panel"
anchors.fill: parent //because this draws indicator menus
blurSource: greeter.shown ? greeter : stages

mode: shell.usageScenario == "desktop" ? "windowed" : "staged"
minimizedPanelHeight: units.gu(3)
Expand Down