This commit is contained in:
fwastring 2025-10-12 14:37:23 +02:00
parent a1111d1e2f
commit 3b2edf9af2

View file

@ -26,14 +26,20 @@ class PlayerctlApp(Gtk.Application):
window.set_border_width(12) window.set_border_width(12)
window.set_default_size(320, 120) window.set_default_size(320, 120)
controls = Gtk.Box(spacing=6) controls = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
controls.set_orientation(Gtk.Orientation.HORIZONTAL) controls.set_homogeneous(True)
controls.set_hexpand(True)
controls.set_vexpand(True)
controls.set_valign(Gtk.Align.FILL)
prev_button = Gtk.Button.new_from_icon_name( prev_button = Gtk.Button.new_from_icon_name(
"media-skip-backward", "media-skip-backward",
Gtk.IconSize.LARGE_TOOLBAR, Gtk.IconSize.LARGE_TOOLBAR,
) )
prev_button.connect("clicked", self._on_prev_clicked) prev_button.connect("clicked", self._on_prev_clicked)
prev_button.set_hexpand(True)
prev_button.set_vexpand(True)
prev_button.set_valign(Gtk.Align.FILL)
controls.pack_start(prev_button, True, True, 0) controls.pack_start(prev_button, True, True, 0)
toggle_button = Gtk.Button.new_from_icon_name( toggle_button = Gtk.Button.new_from_icon_name(
@ -41,6 +47,9 @@ class PlayerctlApp(Gtk.Application):
Gtk.IconSize.LARGE_TOOLBAR, Gtk.IconSize.LARGE_TOOLBAR,
) )
toggle_button.connect("clicked", self._on_toggle_clicked) toggle_button.connect("clicked", self._on_toggle_clicked)
toggle_button.set_hexpand(True)
toggle_button.set_vexpand(True)
toggle_button.set_valign(Gtk.Align.FILL)
controls.pack_start(toggle_button, True, True, 0) controls.pack_start(toggle_button, True, True, 0)
next_button = Gtk.Button.new_from_icon_name( next_button = Gtk.Button.new_from_icon_name(
@ -48,10 +57,13 @@ class PlayerctlApp(Gtk.Application):
Gtk.IconSize.LARGE_TOOLBAR, Gtk.IconSize.LARGE_TOOLBAR,
) )
next_button.connect("clicked", self._on_next_clicked) next_button.connect("clicked", self._on_next_clicked)
next_button.set_hexpand(True)
next_button.set_vexpand(True)
next_button.set_valign(Gtk.Align.FILL)
controls.pack_start(next_button, True, True, 0) controls.pack_start(next_button, True, True, 0)
layout = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12) layout = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12)
layout.pack_start(controls, False, False, 0) layout.pack_start(controls, True, True, 0)
window.add(layout) window.add(layout)
window.show_all() window.show_all()