Skip to content

Commit ed504b9

Browse files
committed
feat: add option to enable volume slider by default
1 parent 1eb8755 commit ed504b9

File tree

8 files changed

+35
-7
lines changed

8 files changed

+35
-7
lines changed

src/components/NowPlaying.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@
105105
</span>
106106
</SmoothDiv>
107107
</button>
108-
<SmoothDiv height={false} outerClass="flex justify-end" innerClass="flex justify-end">
108+
<SmoothDiv
109+
height={false}
110+
outerClass="flex justify-end"
111+
innerClass="flex justify-end"
112+
>
109113
{#if !toggleModes.clickThrough}
110114
<button
111115
class="transition h-full hover:text-zb-accent hover:scale-125 relative flex items-center justify-end"

src/components/SmoothDiv.svelte

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@
4949
{@render children()}
5050
</div>
5151
{:else if width}
52-
<div class="w-fit h-full {innerClass}" bind:clientWidth={widthSpring.target}>
52+
<div
53+
class="w-fit h-full {innerClass}"
54+
bind:clientWidth={widthSpring.target}
55+
>
5356
{@render children()}
5457
</div>
5558
{:else if height}
56-
<div class="h-fit w-full {innerClass}" bind:clientHeight={heightSpring.target}>
59+
<div
60+
class="h-fit w-full {innerClass}"
61+
bind:clientHeight={heightSpring.target}
62+
>
5763
{@render children()}
5864
</div>
5965
{/if}

src/components/VolumeControl/VolumeControl.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import "./VolumeControl.css";
1212
import { toggleModes } from "$lib/binding_modes.svelte";
1313
import { fly } from "svelte/transition";
14-
import { config } from "$lib/config.svelte";
14+
import { config, configLoaded } from "$lib/config.svelte";
15+
import { onMount } from "svelte";
1516
1617
let audio = $derived(providers.audio);
1718
let device = $derived(audio?.defaultPlaybackDevice);
@@ -28,6 +29,13 @@
2829
newVolume = Math.max(0, Math.min(100, newVolume));
2930
audio?.setVolume(newVolume);
3031
};
32+
33+
onMount(async () => {
34+
await configLoaded;
35+
if (config.enableVolumeSlider) {
36+
sliderOpen = true;
37+
}
38+
});
3139
</script>
3240

3341
{#if device}

src/components/Workspaces.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<Button
6666
class="h-[2rem] box-border text-zb-ws-{globalIndex} {workspace.isDisplayed
6767
? `border-zb-ws-${globalIndex} hover:border-blend-70 active:!border-blend-50`
68-
: ''} {toggleModes.clickThrough
68+
: ''} {toggleModes.clickThrough
6969
? 'aspect-square'
7070
: 'min-w-14 px-2'}"
7171
callback={() =>

src/lib/config.svelte.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ export interface Config {
8181
*/
8282
clickThroughByDefault: boolean;
8383

84+
/**
85+
* Enable volume slider by default.
86+
*/
87+
enableVolumeSlider: boolean;
88+
8489
// Individual section toggles
8590

8691
showHeartButton: boolean;

static/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
},
2323
"backgroundEffect": "inherit",
2424
"enableAutoTiling": true,
25-
"clickThroughByDefault": false,
2625
"showFullDateByDefault": false,
26+
"clickThroughByDefault": false,
27+
"enableVolumeSlider": false,
2728
"showHeartButton": true,
2829
"showCpuSection": true,
2930
"showMemorySection": true,

static/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@
8989
"description": "Whether to enable built-in automatic tiling of windows.",
9090
"type": "boolean"
9191
},
92+
"enableVolumeSlider": {
93+
"description": "Enable volume slider by default.",
94+
"type": "boolean"
95+
},
9296
"gradient": {
9397
"$ref": "#/definitions/GradientDirection",
9498
"description": "The direction of the background gradient.\n\n`top`- From top to transparent bottom.\n\n`bottom`- From bottom to transparent top.\n\n`solid`- Solid color background.\n\n`disabled`- Background color is disabled."

static/zpack.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://github.com/glzr-io/zebar/raw/v3.1.1/resources/zpack-schema.json",
33
"name": "neosoft-zebar",
4-
"version": "1.2.4",
4+
"version": "1.2.5",
55
"description": "A highly customizable (and smooooooth) Zebar build",
66
"tags": [
77
"glazewm",

0 commit comments

Comments
 (0)