mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
feat: HeadingFrame class
This commit is contained in:
1 parent
2c07b8f3f2
commit
2dbdc3f928
4 files changed
+115
-20
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user