Compare commits
No commits in common. "4c90b4a9a28928f782c9047c36b438f41c532225" and "ae3d55912f7790a0228d84ce13047b4142f86c62" have entirely different histories.
4c90b4a9a2
...
ae3d55912f
3 changed files with 5 additions and 45 deletions
|
|
@ -28,17 +28,19 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
anchors.fill: parent
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: Math.max(M.Theme.screenRadius + 2, 4)
|
||||||
|
|
||||||
onPaint: {
|
onPaint: {
|
||||||
const ctx = getContext("2d");
|
const ctx = getContext("2d");
|
||||||
const w = width;
|
const w = width;
|
||||||
const h = height;
|
|
||||||
const r = M.Theme.screenRadius;
|
const r = M.Theme.screenRadius;
|
||||||
const lw = 3;
|
const lw = 3;
|
||||||
const hw = lw / 2;
|
const hw = lw / 2;
|
||||||
|
|
||||||
ctx.clearRect(0, 0, w, h);
|
ctx.clearRect(0, 0, w, height);
|
||||||
|
|
||||||
// Opaque backing behind the stroke
|
// Opaque backing behind the stroke
|
||||||
ctx.fillStyle = M.Theme.base00.toString();
|
ctx.fillStyle = M.Theme.base00.toString();
|
||||||
|
|
@ -54,37 +56,6 @@ PanelWindow {
|
||||||
ctx.rect(0, 0, w, lw);
|
ctx.rect(0, 0, w, lw);
|
||||||
}
|
}
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
// Glow below the stroke — fades from gradient color to transparent
|
|
||||||
const glowH = h - lw;
|
|
||||||
if (glowH > 0) {
|
|
||||||
const glowGrad = ctx.createLinearGradient(0, lw, 0, h);
|
|
||||||
glowGrad.addColorStop(0, "rgba(255,255,255,0.06)");
|
|
||||||
glowGrad.addColorStop(1, "transparent");
|
|
||||||
|
|
||||||
// Use the horizontal gradient as a mask via compositing
|
|
||||||
const hGrad = ctx.createLinearGradient(0, 0, w, 0);
|
|
||||||
hGrad.addColorStop(0, M.Theme.base0C.toString());
|
|
||||||
hGrad.addColorStop(1, M.Theme.base09.toString());
|
|
||||||
|
|
||||||
// Draw vertical fade strip
|
|
||||||
ctx.globalAlpha = 0.12;
|
|
||||||
ctx.fillStyle = hGrad;
|
|
||||||
ctx.fillRect(0, lw, w, glowH);
|
|
||||||
|
|
||||||
// Erase bottom portion with transparent fade
|
|
||||||
ctx.globalAlpha = 1;
|
|
||||||
ctx.globalCompositeOperation = "destination-out";
|
|
||||||
const eraseGrad = ctx.createLinearGradient(0, lw, 0, h);
|
|
||||||
eraseGrad.addColorStop(0, "transparent");
|
|
||||||
eraseGrad.addColorStop(1, "black");
|
|
||||||
ctx.fillStyle = eraseGrad;
|
|
||||||
ctx.fillRect(0, lw, w, glowH);
|
|
||||||
ctx.globalCompositeOperation = "source-over";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gradient stroke
|
|
||||||
ctx.globalAlpha = 1;
|
|
||||||
const grad = ctx.createLinearGradient(0, 0, w, 0);
|
const grad = ctx.createLinearGradient(0, 0, w, 0);
|
||||||
grad.addColorStop(0, M.Theme.base0C.toString());
|
grad.addColorStop(0, M.Theme.base0C.toString());
|
||||||
grad.addColorStop(1, M.Theme.base09.toString());
|
grad.addColorStop(1, M.Theme.base09.toString());
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ Text {
|
||||||
id: root
|
id: root
|
||||||
property string icon: ""
|
property string icon: ""
|
||||||
property string tooltip: ""
|
property string tooltip: ""
|
||||||
property string minIcon: ""
|
|
||||||
property bool _hovered: false
|
property bool _hovered: false
|
||||||
property string _displayIcon: icon
|
property string _displayIcon: icon
|
||||||
property string _pendingIcon: ""
|
property string _pendingIcon: ""
|
||||||
|
|
@ -40,20 +39,11 @@ Text {
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
width: minIcon ? Math.max(implicitWidth, _minIconMetrics.width) : implicitWidth
|
|
||||||
horizontalAlignment: minIcon ? Text.AlignHCenter : Text.AlignLeft
|
|
||||||
color: M.Theme.base05
|
color: M.Theme.base05
|
||||||
font.pixelSize: M.Theme.fontSize + 1
|
font.pixelSize: M.Theme.fontSize + 1
|
||||||
font.family: M.Theme.iconFontFamily
|
font.family: M.Theme.iconFontFamily
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
TextMetrics {
|
|
||||||
id: _minIconMetrics
|
|
||||||
text: root.minIcon
|
|
||||||
font.pixelSize: root.font.pixelSize
|
|
||||||
font.family: root.font.family
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.enabled: _hovered && !(parent && parent._hovered === true)
|
layer.enabled: _hovered && !(parent && parent._hovered === true)
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
shadowEnabled: true
|
shadowEnabled: true
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,6 @@ M.BarSection {
|
||||||
|
|
||||||
M.BarIcon {
|
M.BarIcon {
|
||||||
icon: root._volumeIcon
|
icon: root._volumeIcon
|
||||||
minIcon: "\uF028"
|
|
||||||
color: root._volumeColor
|
color: root._volumeColor
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue