feat: HeadingFrame class

This commit is contained in:
aclist committed 2026-05-04 01:43:41 +09:00
1 parent 2c07b8f3f2
commit 2dbdc3f928
4 files changed
+115 -20

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
from dzgui.util import strings, css, open_links
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)
# TODO: rename selector
css.add_class(label, "settings-subheading")
frame = Gtk.Frame(hexpand=True)
frame.add(widget)
frame.set_label_widget(label)
self.add(frame)