Skip to content

Commit

Permalink
Disable ScreenBlanker while notification buttons are animating
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMcInnes committed Aug 2, 2024
1 parent 89d9231 commit 7457eb4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ApplicationContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Item {

ScreenBlanker {
id: screenBlanker
enabled: !Global.splashScreenVisible && !(!!Global.notifications && Global.notifications.alert)
enabled: !Global.splashScreenVisible && !(!!Global.pageManager && Global.pageManager.statusBar.notificationButtonVisible)
displayOffTime: displayOffItem.isValid ? 1000*displayOffItem.value : 0.0
property VeQuickItem displayOffItem: VeQuickItem {
uid: !!Global.systemSettings ? Global.systemSettings.serviceUid + "/Settings/Gui/DisplayOff" : ""
Expand Down
19 changes: 18 additions & 1 deletion components/StatusBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Rectangle {
property int leftButton: VenusOS.StatusBar_LeftButton_None
property int rightButton: VenusOS.StatusBar_RightButton_None
property bool notificationButtonsEnabled
readonly property bool notificationButtonVisible: alertButton.enabled || alertButton.animating || alarmButton.enabled || alarmButton.animating

property bool animationEnabled

Expand Down Expand Up @@ -57,14 +58,22 @@ Rectangle {
}

component NotificationButton : Button {
readonly property bool animating: animator.running

leftPadding: Theme.geometry_silenceAlarmButton_horizontalPadding
rightPadding: Theme.geometry_silenceAlarmButton_horizontalPadding
height: Theme.geometry_notificationsPage_snoozeButton_height
radius: Theme.geometry_button_radius
opacity: enabled ? 1 : 0
font.family: Global.fontFamily
font.pixelSize: Theme.font_size_caption
Behavior on opacity { OpacityAnimator { duration: Theme.animation_toastNotification_fade_duration } }
Behavior on opacity {
OpacityAnimator {
id: animator

duration: Theme.animation_toastNotification_fade_duration
}
}
}


Expand Down Expand Up @@ -103,9 +112,17 @@ Rectangle {
rightMargin: Theme.geometry_statusBar_rightSideRow_horizontalMargin
verticalCenter: parent.verticalCenter
}
width: Math.max(20, implicitWidth)
}

Rectangle {
anchors.fill: rightSideRow
color: "pink"
}

NotificationButton {
id: alertButton

anchors {
right: rightSideRow.right
verticalCenter: parent.verticalCenter
Expand Down

0 comments on commit 7457eb4

Please sign in to comment.