mirror of
https://github.com/aclist/dztui.git
synced 2026-11-03 16:42:13 +01:00
22 lines
536 B
Python
22 lines
536 B
Python
from dzgui.util import css
|
|
|
|
import gi
|
|
|
|
gi.require_version("Gtk", "3.0")
|
|
from gi.repository import Gtk # noqa
|
|
|
|
|
|
class HeadingFrame(Gtk.Box):
|
|
def __init__(self, widget: Gtk.Widget, heading: str) -> None:
|
|
super().__init__(orientation=Gtk.Orientation.VERTICAL)
|
|
|
|
label = Gtk.Label(label=heading)
|
|
label.set_halign(Gtk.Align.START)
|
|
css.add_class(label, "settings-subheading")
|
|
|
|
frame = Gtk.Frame(hexpand=True)
|
|
frame.add(widget)
|
|
frame.set_label_widget(label)
|
|
|
|
self.add(frame)
|