Compare commits

..

No commits in common. "8f09492fc21bce2c3f76b4158c0a5f736a004bd4" and "ffb869c5ccad159477c986bdaac062a0ca247f5b" have entirely different histories.

6 changed files with 18 additions and 44 deletions

View file

@ -99,7 +99,7 @@ M.BarSection {
id: hoverPanel id: hoverPanel
showPanel: root._showPanel showPanel: root._showPanel
screen: QsWindow.window?.screen ?? null screen: QsWindow.window?.screen ?? null
anchorItem: root anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
accentColor: root.accentColor accentColor: root.accentColor
panelNamespace: "nova-backlight" panelNamespace: "nova-backlight"
contentWidth: 200 contentWidth: 200

View file

@ -56,17 +56,17 @@ Item {
shadowHorizontalOffset: 0 shadowHorizontalOffset: 0
} }
// Frosted base semi-transparent so the bar background bleeds through // Solid background
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
topLeftRadius: root._tlr topLeftRadius: root._tlr
topRightRadius: root._trr topRightRadius: root._trr
bottomLeftRadius: root._blr bottomLeftRadius: root._blr
bottomRightRadius: root._brr bottomRightRadius: root._brr
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.55) color: M.Theme.base01
} }
// Frost sheen subtle white highlight, top-heavy // Accent gradient overlay
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
topLeftRadius: root._tlr topLeftRadius: root._tlr
@ -76,26 +76,7 @@ Item {
gradient: Gradient { gradient: Gradient {
GradientStop { GradientStop {
position: 0 position: 0
color: Qt.rgba(1, 1, 1, 0.07) color: Qt.rgba(root.borderColor.r, root.borderColor.g, root.borderColor.b, 0.15)
}
GradientStop {
position: 0.5
color: "transparent"
}
}
}
// Accent tint
Rectangle {
anchors.fill: parent
topLeftRadius: root._tlr
topRightRadius: root._trr
bottomLeftRadius: root._blr
bottomRightRadius: root._brr
gradient: Gradient {
GradientStop {
position: 0
color: Qt.rgba(root.borderColor.r, root.borderColor.g, root.borderColor.b, 0.12)
} }
GradientStop { GradientStop {
position: 1 position: 1

View file

@ -9,7 +9,7 @@ PanelWindow {
id: root id: root
required property bool showPanel required property bool showPanel
required property Item anchorItem required property real anchorX
required property color accentColor required property color accentColor
property string panelNamespace: "nova-panel" property string panelNamespace: "nova-panel"
property real contentWidth: 220 property real contentWidth: 220
@ -31,6 +31,7 @@ PanelWindow {
anchors.left: true anchors.left: true
margins.top: 0 margins.top: 0
margins.left: Math.max(0, Math.min(Math.round(anchorX - contentWidth / 2), (screen?.width ?? 1920) - contentWidth))
implicitWidth: panelContent.width implicitWidth: panelContent.width
implicitHeight: panelContent.height implicitHeight: panelContent.height
@ -43,16 +44,8 @@ PanelWindow {
} }
} }
function _updatePosition() {
const pt = anchorItem.mapToGlobal(anchorItem.width / 2, 0);
const scr = screen;
const sw = scr?.width ?? 1920;
margins.left = Math.max(0, Math.min(Math.round(pt.x - (scr?.x ?? 0) - contentWidth / 2), sw - contentWidth));
}
onShowPanelChanged: { onShowPanelChanged: {
if (showPanel) { if (showPanel) {
_updatePosition();
_winVisible = true; _winVisible = true;
hideAnim.stop(); hideAnim.stop();
showAnim.start(); showAnim.start();

View file

@ -99,7 +99,7 @@ M.BarSection {
id: hoverPanel id: hoverPanel
showPanel: root._showPanel showPanel: root._showPanel
screen: QsWindow.window?.screen ?? null screen: QsWindow.window?.screen ?? null
anchorItem: root anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
accentColor: root.accentColor accentColor: root.accentColor
panelNamespace: "nova-mpris" panelNamespace: "nova-mpris"
contentWidth: 280 contentWidth: 280

View file

@ -109,7 +109,7 @@ M.BarSection {
id: hoverPanel id: hoverPanel
showPanel: root._showPanel showPanel: root._showPanel
screen: QsWindow.window?.screen ?? null screen: QsWindow.window?.screen ?? null
anchorItem: root anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
accentColor: root.accentColor accentColor: root.accentColor
panelNamespace: "nova-volume" panelNamespace: "nova-volume"
contentWidth: 220 contentWidth: 220

View file

@ -22,11 +22,9 @@ float sdHexagon(vec2 p, float r) {
return length(p) * sign(p.y); return length(p) * sign(p.y);
} }
// Interpolate between three theme stops (t in [0,1]) // Rainbow from angle — color picker style
vec3 themeGradient(float t) { vec3 hsv2rgb(float h) {
return t < 0.5 return clamp(abs(mod(h * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0);
? mix(uC0.rgb, uC1.rgb, t * 2.0)
: mix(uC1.rgb, uC2.rgb, (t - 0.5) * 2.0);
} }
void main() { void main() {
@ -75,13 +73,15 @@ void main() {
float edgeWidth = 5.0; float edgeWidth = 5.0;
float edgeFactor = smoothstep(-edgeWidth, 0.0, d); // 0 at interior, 1 at edge float edgeFactor = smoothstep(-edgeWidth, 0.0, d); // 0 at interior, 1 at edge
if (wf > 0.01 && edgeFactor > 0.0) { if (wf > 0.01 && edgeFactor > 0.0) {
// Vary shimmer color across theme gradient using angle + position // Angle around hex center → hue
float angle = atan(p.y, p.x); float angle = atan(p.y, p.x);
float t = fract((angle + 3.14159) / 6.28318 + center.x * 0.003 + center.y * 0.005); float hue = (angle + 3.14159) / 6.28318;
vec3 shimmerColor = themeGradient(t); // Shift hue by position so neighboring hexes have different phase
hue = fract(hue + center.x * 0.003 + center.y * 0.005);
vec3 rainbow = hsv2rgb(hue);
float shimmer = edgeFactor * wf; float shimmer = edgeFactor * wf;
rgb = mix(rgb, shimmerColor, shimmer * 0.8); rgb = mix(rgb, rainbow, shimmer * 0.8);
a = mix(a, 0.5, shimmer * 0.6); a = mix(a, 0.5, shimmer * 0.6);
} }