Fix some toasts and notification position
This commit is contained in:
parent
b51e6a5e73
commit
0aa17ae18e
4 changed files with 35 additions and 9 deletions
|
|
@ -32,9 +32,12 @@ Variants {
|
||||||
|| (Settings.data.notifications.monitors.length === 0))
|
|| (Settings.data.notifications.monitors.length === 0))
|
||||||
&& (NotificationService.notificationModel.count > 0) : false
|
&& (NotificationService.notificationModel.count > 0) : false
|
||||||
|
|
||||||
anchors.top: true
|
// Position based on bar location
|
||||||
|
anchors.top: Settings.data.bar.position === "top"
|
||||||
|
anchors.bottom: Settings.data.bar.position === "bottom"
|
||||||
anchors.right: true
|
anchors.right: true
|
||||||
margins.top: (Style.barHeight + Style.marginM) * scaling
|
margins.top: Settings.data.bar.position === "top" ? (Style.barHeight + Style.marginM) * scaling : 0
|
||||||
|
margins.bottom: Settings.data.bar.position === "bottom" ? (Style.barHeight + Style.marginM) * scaling : 0
|
||||||
margins.right: Style.marginM * scaling
|
margins.right: Style.marginM * scaling
|
||||||
implicitWidth: 360 * scaling
|
implicitWidth: 360 * scaling
|
||||||
implicitHeight: Math.min(notificationStack.implicitHeight, (NotificationService.maxVisible * 120) * scaling)
|
implicitHeight: Math.min(notificationStack.implicitHeight, (NotificationService.maxVisible * 120) * scaling)
|
||||||
|
|
@ -57,7 +60,9 @@ Variants {
|
||||||
// Main notification container
|
// Main notification container
|
||||||
Column {
|
Column {
|
||||||
id: notificationStack
|
id: notificationStack
|
||||||
anchors.top: parent.top
|
// Position based on bar location
|
||||||
|
anchors.top: Settings.data.bar.position === "top" ? parent.top : undefined
|
||||||
|
anchors.bottom: Settings.data.bar.position === "bottom" ? parent.bottom : undefined
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginS * scaling
|
||||||
width: 360 * scaling
|
width: 360 * scaling
|
||||||
|
|
|
||||||
|
|
@ -17,15 +17,20 @@ Variants {
|
||||||
readonly property real scaling: ScalingService.scale(screen)
|
readonly property real scaling: ScalingService.scale(screen)
|
||||||
screen: modelData
|
screen: modelData
|
||||||
|
|
||||||
// Position at top, centered horizontally
|
// Position based on bar location, like Notification popup does
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: Settings.data.bar.position === "top"
|
||||||
|
bottom: Settings.data.bar.position === "bottom"
|
||||||
left: true
|
left: true
|
||||||
right: true
|
right: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set margins based on bar position
|
||||||
|
margins.top: Settings.data.bar.position === "top" ? (Style.barHeight + Style.marginS) * scaling : 0
|
||||||
|
margins.bottom: Settings.data.bar.position === "bottom" ? (Style.barHeight + Style.marginS) * scaling : 0
|
||||||
|
|
||||||
// Small height when hidden, appropriate height when visible
|
// Small height when hidden, appropriate height when visible
|
||||||
implicitHeight: toast.visible ? toast.height + Style.barHeight * scaling + Style.marginS * scaling : 1
|
implicitHeight: toast.visible ? toast.height + Style.marginS * scaling : 1
|
||||||
|
|
||||||
// Transparent background
|
// Transparent background
|
||||||
color: Color.transparent
|
color: Color.transparent
|
||||||
|
|
@ -39,8 +44,13 @@ Variants {
|
||||||
id: toast
|
id: toast
|
||||||
scaling: root.scaling
|
scaling: root.scaling
|
||||||
|
|
||||||
// Position just below where the bar would be
|
// Simple positioning - margins already account for bar
|
||||||
targetY: Style.barHeight * scaling + Style.marginS * scaling
|
targetY: Style.marginS * scaling
|
||||||
|
|
||||||
|
// Hidden position based on bar location
|
||||||
|
hiddenY: Settings.data.bar.position === "top"
|
||||||
|
? -toast.height - 20
|
||||||
|
: toast.height + 20
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Register this toast with the service
|
// Register this toast with the service
|
||||||
|
|
|
||||||
|
|
@ -141,4 +141,13 @@ Singleton {
|
||||||
device.trusted = true
|
device.trusted = true
|
||||||
device.connect()
|
device.connect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setBluetoothEnabled(enabled) {
|
||||||
|
if (!adapter) {
|
||||||
|
console.warn("BluetoothService: No adapter available")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter.enabled = enabled
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ PanelWindow {
|
||||||
readonly property real scaling: ScalingService.scale(screen)
|
readonly property real scaling: ScalingService.scale(screen)
|
||||||
|
|
||||||
property bool showOverlay: Settings.data.general.dimDesktop
|
property bool showOverlay: Settings.data.general.dimDesktop
|
||||||
property int topMargin: Style.barHeight * scaling
|
property int topMargin: Settings.data.bar.position === "top" ? Style.barHeight * scaling : 0
|
||||||
|
property int bottomMargin: Settings.data.bar.position === "bottom" ? Style.barHeight * scaling : 0
|
||||||
// Show dimming if this panel is opened OR if we're in a transition (to prevent flickering)
|
// Show dimming if this panel is opened OR if we're in a transition (to prevent flickering)
|
||||||
property color overlayColor: (showOverlay && (PanelService.openedPanel === root
|
property color overlayColor: (showOverlay && (PanelService.openedPanel === root
|
||||||
|| isTransitioning)) ? Color.applyOpacity(Color.mShadow,
|
|| isTransitioning)) ? Color.applyOpacity(Color.mShadow,
|
||||||
|
|
@ -60,6 +61,7 @@ PanelWindow {
|
||||||
anchors.right: true
|
anchors.right: true
|
||||||
anchors.bottom: true
|
anchors.bottom: true
|
||||||
margins.top: topMargin
|
margins.top: topMargin
|
||||||
|
margins.bottom: bottomMargin
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue