Trying out a border on the sidepanel + fullhd fix

This commit is contained in:
quadbyte 2025-08-07 17:52:54 -04:00
parent 3161ac6c83
commit a41bd64cf6
2 changed files with 53 additions and 38 deletions

View file

@ -17,11 +17,11 @@ Singleton {
// Automatic scaling based on screen width // Automatic scaling based on screen width
function scale(currentScreen) { function scale(currentScreen) {
if (currentScreen !== undefined) { if (currentScreen !== undefined) {
var rawRatio = currentScreen.width / designScreenWidth var rawRatio = currentScreen.width / designScreenWidth;
// Apply dampening to reduce scaling for higher resolutions // Apply dampening to reduce scaling for higher resolutions
return Math.min(2.0, 1.0 + (rawRatio - 1.0) * scalingDampening) return Math.min(2.0, 1.0 + (rawRatio - 1.0) * scalingDampening);
} }
return 1.0 return 1.0;
} }
function applyOpacity(color, opacity) { function applyOpacity(color, opacity) {

View file

@ -40,9 +40,11 @@ PanelWithOverlay {
Rectangle { Rectangle {
// Access the shell's SettingsWindow instead of creating a new one // Access the shell's SettingsWindow instead of creating a new one
id: sidebarPopupRect id: sidebarPopupRect
// Necessary for the scaling to work on smaller screens
width: 530
property real slideOffset: width property real slideOffset: width
property bool isAnimating: false property bool isAnimating: false
property int leftPadding: 20 * Theme.scale(Screen) property int leftPadding: 20 * Theme.scale(Screen)
@ -50,21 +52,10 @@ PanelWithOverlay {
// Recording properties // Recording properties
property bool isRecording: false property bool isRecording: false
Process {
id: checkRecordingProcess
command: ["pgrep", "-f", "gpu-screen-recorder.*portal"]
onExited: function(exitCode, exitStatus) {
var isActuallyRecording = exitCode === 0
if (isRecording && !isActuallyRecording) {
isRecording = isActuallyRecording
}
}
}
function checkRecordingStatus() { function checkRecordingStatus() {
if (isRecording) { if (isRecording)
checkRecordingProcess.running = true checkRecordingProcess.running = true;
}
} }
function showAt() { function showAt() {
@ -79,6 +70,7 @@ PanelWithOverlay {
if (systemWidget) if (systemWidget)
systemWidget.panelVisible = true; systemWidget.panelVisible = true;
} }
} }
@ -86,8 +78,6 @@ PanelWithOverlay {
if (shell && shell.settingsWindow && shell.settingsWindow.visible) if (shell && shell.settingsWindow && shell.settingsWindow.visible)
shell.settingsWindow.visible = false; shell.settingsWindow.visible = false;
if (sidebarPopup.visible) { if (sidebarPopup.visible) {
slideAnim.from = 0; slideAnim.from = 0;
slideAnim.to = width; slideAnim.to = width;
@ -139,6 +129,18 @@ PanelWithOverlay {
} }
Process {
id: checkRecordingProcess
command: ["pgrep", "-f", "gpu-screen-recorder.*portal"]
onExited: function(exitCode, exitStatus) {
var isActuallyRecording = exitCode === 0;
if (isRecording && !isActuallyRecording)
isRecording = isActuallyRecording;
}
}
// Prevent closing when clicking in the panel bg // Prevent closing when clicking in the panel bg
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
@ -159,6 +161,7 @@ PanelWithOverlay {
if (systemWidget) if (systemWidget)
systemWidget.panelVisible = false; systemWidget.panelVisible = false;
} }
sidebarPopupRect.isAnimating = false; sidebarPopupRect.isAnimating = false;
} }
@ -170,15 +173,29 @@ PanelWithOverlay {
Rectangle { Rectangle {
id: mainRectangle id: mainRectangle
color: "transparent"
anchors.top: sidebarPopupRect.top
width: sidebarPopupRect.width - sidebarPopupRect.leftPadding width: sidebarPopupRect.width - sidebarPopupRect.leftPadding
height: sidebarPopupRect.height - sidebarPopupRect.bottomPadding height: sidebarPopupRect.height - sidebarPopupRect.bottomPadding
anchors.top: sidebarPopupRect.top
x: sidebarPopupRect.leftPadding + sidebarPopupRect.slideOffset x: sidebarPopupRect.leftPadding + sidebarPopupRect.slideOffset
y: 0 y: 0
color: Theme.backgroundPrimary
bottomLeftRadius: 20 * Theme.scale(Screen)
z: 0 z: 0
Rectangle {
color: Theme.backgroundPrimary
anchors.fill: parent
bottomLeftRadius: 20 * Theme.scale(Screen)
border.color: Theme.outline || "#444"
border.width: 1
anchors {
fill: parent
leftMargin: 0
rightMargin: -1
topMargin: -1
bottomMargin: 0
}
Behavior on x { Behavior on x {
enabled: !sidebarPopupRect.isAnimating enabled: !sidebarPopupRect.isAnimating
@ -191,7 +208,7 @@ PanelWithOverlay {
} }
}
// SettingsIcon component // SettingsIcon component
SettingsIcon { SettingsIcon {
@ -212,25 +229,26 @@ PanelWithOverlay {
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
anchors.margins: 20 * Theme.scale(Screen) anchors.margins: 20 * Theme.scale(Screen)
spacing: 4 * Theme.scale(Screen) spacing: 8 * Theme.scale(Screen)
System { System {
id: systemWidget id: systemWidget
settingsModal: settingsModal
settingsModal: settingsModal
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
z: 3 z: 3
} }
Weather { Weather {
id: weather id: weather
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
z: 2 z: 2
} }
// Music and System Monitor row // Music and System Monitor row
RowLayout { RowLayout {
spacing: 12 * Theme.scale(Screen) spacing: 8 * Theme.scale(Screen)
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -240,6 +258,7 @@ PanelWithOverlay {
SystemMonitor { SystemMonitor {
id: systemMonitor id: systemMonitor
z: 2 z: 2
} }
@ -279,8 +298,7 @@ PanelWithOverlay {
radius: 18 * Theme.scale(Screen) radius: 18 * Theme.scale(Screen)
border.color: Theme.accentPrimary border.color: Theme.accentPrimary
border.width: 1 * Theme.scale(Screen) border.width: 1 * Theme.scale(Screen)
color: sidebarPopupRect.isRecording ? Theme.accentPrimary : color: sidebarPopupRect.isRecording ? Theme.accentPrimary : (recordButtonArea.containsMouse ? Theme.accentPrimary : "transparent")
(recordButtonArea.containsMouse ? Theme.accentPrimary : "transparent")
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
@ -366,8 +384,6 @@ PanelWithOverlay {
} }
} }
Behavior on x { Behavior on x {
@ -382,7 +398,6 @@ PanelWithOverlay {
} }
} }
} }