diff options
author | Tim Keller <tjkeller.xyz> | 2025-04-20 13:26:34 -0500 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2025-04-20 13:26:34 -0500 |
commit | ffa96f71f1816f37b3f46528d05d652bf384c7b9 (patch) | |
tree | 04e511f9b6574bc6d497b27823fa5e8d3604e30e /widgets | |
parent | cc16be5d1a81f6ed6d216189ab7669b942b8403d (diff) | |
download | awesome-ffa96f71f1816f37b3f46528d05d652bf384c7b9.tar.xz awesome-ffa96f71f1816f37b3f46528d05d652bf384c7b9.zip |
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/volumedropdown.lua | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/widgets/volumedropdown.lua b/widgets/volumedropdown.lua index a25db70..dad20eb 100644 --- a/widgets/volumedropdown.lua +++ b/widgets/volumedropdown.lua @@ -7,7 +7,10 @@ local pavolctld = require("lib.pavolctld") -- return table local widget = {} -widget.dbmeter = wibox.widget.textbox() +widget.dbmeter = wibox.widget.textbox("-999.99 dB") -- max width text +local dbmeter_maxwidth, _ = widget.dbmeter:get_preferred_size_at_dpi(beautiful.xresources.get_dpi()) -- max width, TODO per screen dpi +dbmeter_maxwidth = dbmeter_maxwidth * 1.5 -- ??? + local slider = wibox.widget { bar_height = 0, widget = wibox.widget.slider, @@ -47,6 +50,7 @@ local default_sink_scrollbox = wibox.widget { local muted = wibox.widget { color = "#222222", check_color = beautiful.border_focus, + forced_width = apply_dpi(20), widget = wibox.widget.checkbox, } @@ -69,26 +73,33 @@ local volume_dropdown = wibox.widget { { { { - text = "Mute:", - widget = wibox.widget.textbox, + { + { + text = "Mute:", + widget = wibox.widget.textbox, + }, + left = apply_dpi(5), + right = apply_dpi(5), + widget = wibox.container.margin, + }, + fill_vertical = true, + widget = wibox.container.place, }, - left = apply_dpi(10), - right = apply_dpi(5), - widget = wibox.container.margin, - }, - { - muted, - fill_vertical = true, - widget = wibox.container.place, + { + muted, + fill_vertical = true, + widget = wibox.container.place, + }, + layout = wibox.layout.align.horizontal, }, - forced_width = apply_dpi(80), - layout = wibox.layout.align.horizontal, + fill_vertical = true, + widget = wibox.container.place, }, widget.vslider, { widget.dbmeter, - forced_width = apply_dpi(80), halign = "right", + forced_width = dbmeter_maxwidth, widget = wibox.container.place, }, forced_num_cols = 2, |