Compare commits

...

3 commits

6 changed files with 44 additions and 18 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
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0) anchorItem: root
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
} }
// Solid background // Frosted base semi-transparent so the bar background bleeds through
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: M.Theme.base01 color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.55)
} }
// Accent gradient overlay // Frost sheen subtle white highlight, top-heavy
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
topLeftRadius: root._tlr topLeftRadius: root._tlr
@ -76,7 +76,26 @@ Item {
gradient: Gradient { gradient: Gradient {
GradientStop { GradientStop {
position: 0 position: 0
color: Qt.rgba(root.borderColor.r, root.borderColor.g, root.borderColor.b, 0.15) color: Qt.rgba(1, 1, 1, 0.07)
}
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 real anchorX required property Item anchorItem
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,7 +31,6 @@ 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
@ -44,8 +43,16 @@ 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
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0) anchorItem: root
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
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0) anchorItem: root
accentColor: root.accentColor accentColor: root.accentColor
panelNamespace: "nova-volume" panelNamespace: "nova-volume"
contentWidth: 220 contentWidth: 220

View file

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