mirror of
https://github.com/aclist/dztui.git
synced 2026-11-12 04:50:37 +01:00
feat: dynamic connect panel (WIP)
This commit is contained in:
1 parent
5f0c8f7654
commit
06e6065236
14 files changed
+185
-180
No files matched your search
@@ -0,0 +1,42 @@
|
||||
from dzgui.views.components.icon import Icon
|
||||
from dzgui.const.constants import REFRESH_ICON, WEB_BROWSER, INPUT_KEYBOARD
|
||||
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa E402
|
||||
|
||||
|
||||
class IconButton(Gtk.Button):
|
||||
def __init__(self, icon: str, margin: int = 0):
|
||||
super().__init__()
|
||||
i = Icon(icon, l_margin=margin)
|
||||
self.set_image(i)
|
||||
self.set_image_position(Gtk.PositionType.RIGHT)
|
||||
|
||||
|
||||
class IconTextButton(IconButton):
|
||||
def __init__(self, icon: str, label: str):
|
||||
super().__init__(icon, margin=5)
|
||||
self.set_label(label)
|
||||
|
||||
|
||||
class WebButton(IconTextButton):
|
||||
def __init__(self, label: str):
|
||||
super().__init__(icon=WEB_BROWSER, label=label)
|
||||
pass
|
||||
|
||||
|
||||
class RefreshButton(IconTextButton):
|
||||
def __init__(self, label: str):
|
||||
super().__init__(icon=REFRESH_ICON, label=label)
|
||||
self.set_margin_top(10)
|
||||
self.set_margin_start(80)
|
||||
self.set_margin_end(80)
|
||||
|
||||
|
||||
class KeysButton(IconTextButton):
|
||||
def __init__(self, label: str):
|
||||
super().__init__(icon=INPUT_KEYBOARD, label=label)
|
||||
self.set_margin_top(10)
|
||||
self.set_margin_start(80)
|
||||
self.set_margin_end(80)
|
||||
Reference in new issue
Block a user