mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Merge branch 'noctalia-dev:main' into main
This commit is contained in:
@@ -106,6 +106,16 @@ Item {
|
||||
signal opened
|
||||
signal closed
|
||||
|
||||
Connections {
|
||||
target: Style
|
||||
|
||||
function onUiScaleRatioChanged() {
|
||||
if (root.isPanelOpen && root.isPanelVisible) {
|
||||
root.setPosition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Panel visibility and sizing
|
||||
visible: isPanelVisible
|
||||
width: parent ? parent.width : 0
|
||||
|
||||
@@ -86,8 +86,8 @@ Variants {
|
||||
// Margins for PanelWindow (not anchors.topMargin!)
|
||||
margins.top: isTop ? Style.marginM + barOffset : 0
|
||||
margins.bottom: isBottom ? Style.marginM + barOffset : 0
|
||||
margins.left: isLeft ? -Style.marginXL * 1.65 + barOffset : 0
|
||||
margins.right: isRight ? -Style.marginXL * 1.65 + barOffset : 0
|
||||
margins.left: isLeft ? Style.marginM + barOffset : 0
|
||||
margins.right: isRight ? Style.marginM + barOffset : 0
|
||||
|
||||
implicitWidth: notifWidth
|
||||
implicitHeight: notificationStack.implicitHeight + Style.marginL
|
||||
|
||||
+16
-6
@@ -73,17 +73,29 @@ Variants {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Get maximum value for current OSD type
|
||||
function getMaxValue() {
|
||||
if (currentOSDType === "volume" || currentOSDType === "inputVolume") {
|
||||
return Settings.data.audio.volumeOverdrive ? 1.5 : 1.0
|
||||
} else if (currentOSDType === "brightness") {
|
||||
return 1.0
|
||||
}
|
||||
return 1.0
|
||||
}
|
||||
|
||||
// Get display percentage
|
||||
function getDisplayPercentage() {
|
||||
if (currentOSDType === "volume") {
|
||||
if (isMuted)
|
||||
return "0%"
|
||||
const pct = Math.round(Math.min(1.0, currentVolume) * 100)
|
||||
const max = getMaxValue()
|
||||
const pct = Math.round(Math.min(max, currentVolume) * 100)
|
||||
return pct + "%"
|
||||
} else if (currentOSDType === "inputVolume") {
|
||||
if (isInputMuted)
|
||||
return "0%"
|
||||
const pct = Math.round(Math.min(1.0, currentInputVolume) * 100)
|
||||
const max = getMaxValue()
|
||||
const pct = Math.round(Math.min(max, currentInputVolume) * 100)
|
||||
return pct + "%"
|
||||
} else if (currentOSDType === "brightness") {
|
||||
const pct = Math.round(Math.min(1.0, currentBrightness) * 100)
|
||||
@@ -304,7 +316,7 @@ Variants {
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width * Math.min(1.0, root.getCurrentValue())
|
||||
width: parent.width * Math.min(1.0, root.getCurrentValue() / root.getMaxValue())
|
||||
radius: parent.radius
|
||||
color: root.getProgressColor()
|
||||
|
||||
@@ -333,8 +345,6 @@ Variants {
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
Layout.preferredWidth: Math.round(50 * Style.uiScaleRatio)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.verticalCenterOffset: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -393,7 +403,7 @@ Variants {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: parent.height * Math.min(1.0, root.getCurrentValue())
|
||||
height: parent.height * Math.min(1.0, root.getCurrentValue() / root.getMaxValue())
|
||||
radius: parent.radius
|
||||
color: root.getProgressColor()
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ SmartPanel {
|
||||
panelAnchorBottom: !shouldCenter && controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("bottom_")
|
||||
panelAnchorTop: !shouldCenter && controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("top_")
|
||||
|
||||
preferredWidth: Math.round(440 * Style.uiScaleRatio)
|
||||
preferredWidth: Math.round(460 * Style.uiScaleRatio)
|
||||
preferredHeight: {
|
||||
var height = 0
|
||||
var count = 0
|
||||
|
||||
@@ -179,8 +179,8 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginS
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - (Style.marginS * 2)
|
||||
spacing: Style.marginM
|
||||
|
||||
Item {
|
||||
|
||||
@@ -85,6 +85,7 @@ ColumnLayout {
|
||||
border.color: Color.mOutline
|
||||
border.width: Style.borderS
|
||||
implicitHeight: contentCol.implicitHeight + Style.marginL * 2
|
||||
clip: true
|
||||
|
||||
ColumnLayout {
|
||||
id: contentCol
|
||||
|
||||
@@ -349,7 +349,7 @@ SmartPanel {
|
||||
return
|
||||
}
|
||||
wallpapersList = WallpaperService.getWallpapersList(targetScreen.name)
|
||||
Logger.i("WallpaperPanel", "Got", wallpapersList.length, "wallpapers for screen", targetScreen.name)
|
||||
Logger.d("WallpaperPanel", "Got", wallpapersList.length, "wallpapers for screen", targetScreen.name)
|
||||
|
||||
// Pre-compute basenames once for better performance
|
||||
wallpapersWithNames = wallpapersList.map(function (p) {
|
||||
@@ -426,6 +426,50 @@ SmartPanel {
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AsNeeded
|
||||
parent: wallpaperGridView
|
||||
x: wallpaperGridView.mirrored ? 0 : wallpaperGridView.width - width
|
||||
y: 0
|
||||
height: wallpaperGridView.height
|
||||
|
||||
property color handleColor: Qt.alpha(Color.mHover, 0.8)
|
||||
property color handleHoverColor: handleColor
|
||||
property color handlePressedColor: handleColor
|
||||
property real handleWidth: 6
|
||||
property real handleRadius: Style.radiusM
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: parent.handleWidth
|
||||
implicitHeight: 100
|
||||
radius: parent.handleRadius
|
||||
color: parent.pressed ? parent.handlePressedColor : parent.hovered ? parent.handleHoverColor : parent.handleColor
|
||||
opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 1.0 : 0.0
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Style.animationFast
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Style.animationFast
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.handleWidth
|
||||
implicitHeight: 100
|
||||
color: Color.transparent
|
||||
opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 0.3 : 0.0
|
||||
radius: parent.handleRadius / 2
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Style.animationFast
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
|
||||
@@ -35,6 +35,16 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "calendar"
|
||||
function toggle() {
|
||||
root.withTargetScreen(screen => {
|
||||
var calendarPanel = PanelService.getPanel("calendarPanel", screen)
|
||||
calendarPanel.toggle(null, "Clock")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "notifications"
|
||||
function toggleHistory() {
|
||||
|
||||
Reference in New Issue
Block a user