mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 06:32:53 +01:00
change: move ErrorPopover
This commit is contained in:
1 parent
557e221993
commit
f5c71200a8
2 files changed
+25
-19
No files matched your search
@@ -1,5 +1,8 @@
|
||||
from dzgui.const.constants import ERROR, FLATPAK_RUN_CMD, FLATPAK_SANDBOX, STEAM_CMD
|
||||
from dzgui.strings import options
|
||||
from dzgui.const.constants import FLATPAK_RUN_CMD, FLATPAK_SANDBOX, STEAM_CMD
|
||||
from dzgui.views.components.box import HBox
|
||||
from dzgui.views.components.buttons import Icon
|
||||
|
||||
|
||||
import gi
|
||||
|
||||
@@ -33,3 +36,18 @@ class ClientCombo(Gtk.ComboBox):
|
||||
self.pack_start(renderer_text, True)
|
||||
self.add_attribute(renderer_text, "text", 0)
|
||||
self.set_active(0)
|
||||
|
||||
class ErrorPopover(Gtk.Popover):
|
||||
def __init__(self, relative_to: Gtk.Widget, position: Gtk.PositionType) -> None:
|
||||
super().__init__(relative_to=relative_to, position=position)
|
||||
|
||||
self.hbox = HBox()
|
||||
self.label = Gtk.Label(label="", margin_start=10, margin_end=10)
|
||||
error_icon = Icon(ERROR, margin_start=10)
|
||||
self.hbox.extend([error_icon, self.label])
|
||||
self.add(self.hbox)
|
||||
self.show_all()
|
||||
self.popdown()
|
||||
|
||||
def set_label(self, label: str) -> None:
|
||||
self.label.set_label(label)
|
||||
Reference in new issue
Block a user