-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notifications: Don't display 'acknowledge all' after clicking 'silenc… #1349
Changes from 1 commit
9e1645b
066f674
89d9231
09eab2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
** Copyright (C) 2024 Victron Energy B.V. | ||
** See LICENSE.txt for license information. | ||
*/ | ||
|
||
import QtQuick | ||
import Victron.VenusOS | ||
|
||
Button { | ||
id: root | ||
|
||
property alias contentItemChildren: row.children | ||
|
||
anchors { | ||
right: parent ? parent.rightSideRow.right : undefined | ||
verticalCenter: parent.verticalCenter | ||
} | ||
parent: !!Global.pageManager ? Global.pageManager.statusBar : undefined | ||
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 | ||
Behavior on opacity { OpacityAnimator { duration: Theme.animation_toastNotification_fade_duration } } | ||
|
||
contentItem: Row { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
instead of overriding the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated as suggested There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has the side effect of the button text color changing while the button is pressed, as per our default Button behaviour. Looks ok to me. |
||
id: row | ||
|
||
anchors.verticalCenter: parent.verticalCenter | ||
spacing: Theme.geometry_notificationsPage_snoozeButton_spacing | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button used to be parented to
Global.pageManager.statusBar.rightSideRow
, I had to change to toGlobal.pageManager.statusBar
and anchor it to the RHS ofGlobal.pageManager.statusBar.rightSideRow
, asRow
doesn't re-layout itself in a timely manner when its children's visibility changes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if other buttons (aside from Display Sleep etc) get added to the rightSideRow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to add other stuff to rightSideRow, we will have to revisit this. It would depend how the new button is supposed to behave.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving the buttons to
StatusBar.qml
and defining the NotificationButton component inline (like howStatusBarButton
is defined there)? That way the buttons are defined directly within the layout in StatusBar.qml, and we wouldn't need awkward alias properties like Global.pageManager.statusBar.rightSideRow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as suggested.