]> git.rmz.io Git - dotfiles.git/commitdiff
awesome/mpd_widget: center scroll widget when smaller than forced_width
authorSamir Benmendil <me@rmz.io>
Wed, 5 Aug 2020 22:08:57 +0000 (23:08 +0100)
committerSamir Benmendil <me@rmz.io>
Sat, 8 Aug 2020 10:49:22 +0000 (11:49 +0100)
awesome/widgets/mpd_widget.lua

index 180705492ec564a8336eede662a13fbdceb0b241..d5b72e9dd8716547f1ad4c56670737249adb4eaf 100644 (file)
@@ -15,14 +15,11 @@ widget._currentsong = {}
 
 widget.scroll = wibox.widget {
     layout = wibox.container.scroll.horizontal,
-    forced_width = 200,
-    expand = true,
+    max_size = 200,
     step_function = wibox.container.scroll.step_functions.linear_increase,
     speed = 20,
     {
         widget = widget._textbox,
-        align = 'center',
-        valign = 'center'
     }
 }
 
@@ -167,4 +164,11 @@ globalkeys = gears.table.join(globalkeys,
     awful.key({ modkey }, ".", function() widget._connection:send("next") end,
               { description = "next track", group = "mpd" })
 )
-return widget.scroll
+return {
+    layout = wibox.layout.align.horizontal,
+    forced_width = 200,
+    expand = "outside",
+    nil,
+    widget.scroll,
+    nil,
+}