mirror of
https://github.com/aclist/dztui.git
synced 2026-08-25 17:32:36 +02:00
feat: folder icons
This commit is contained in:
parent
d4a99f8229
commit
6050a370f8
@ -35,6 +35,7 @@ HEX_ORANGE = "#FFAC1C"
|
||||
CARET_DOWN = "go-down-symbolic"
|
||||
CARET_UP = "go-up-symbolic"
|
||||
CLIPBOARD = "edit-copy-symbolic"
|
||||
FOLDER = "folder-symbolic"
|
||||
ERROR = "dialog-error-symbolic"
|
||||
HELP_BUBBLE = "help-about-symbolic"
|
||||
INPUT_KEYBOARD = "input-keyboard-symbolic"
|
||||
|
||||
@ -48,8 +48,10 @@ class LargeIcon(Gtk.Image):
|
||||
|
||||
|
||||
class IconButton(Gtk.Button):
|
||||
def __init__(self, icon: str, margin: int = 0) -> None:
|
||||
super().__init__()
|
||||
def __init__(
|
||||
self, icon: str, margin: int = 0, halign: Gtk.Align = Gtk.Align.START
|
||||
) -> None:
|
||||
super().__init__(halign=halign)
|
||||
self.icon = Icon(icon, l_margin=margin)
|
||||
self.set_image(self.icon)
|
||||
self.set_image_position(Gtk.PositionType.RIGHT)
|
||||
@ -57,8 +59,11 @@ class IconButton(Gtk.Button):
|
||||
|
||||
|
||||
class IconTextButton(IconButton):
|
||||
def __init__(self, icon: str, label: str) -> None:
|
||||
super().__init__(icon, margin=5)
|
||||
def __init__(
|
||||
self, icon: str, label: str, halign: Gtk.Align = Gtk.Align.START
|
||||
) -> None:
|
||||
super().__init__(icon, margin=5, halign=halign)
|
||||
print(icon)
|
||||
self.set_label(label)
|
||||
|
||||
|
||||
|
||||
@ -8,12 +8,14 @@ from dzgui.const.constants import (
|
||||
APPID_DAYZ_EXP,
|
||||
APPNAME_DAYZ,
|
||||
APPNAME_DAYZ_EXP_HUMAN,
|
||||
FOLDER,
|
||||
)
|
||||
from dzgui.const.enum import NotebookPage, Preferences
|
||||
from dzgui.managers.offline import OfflineManager
|
||||
from dzgui.strings import offline
|
||||
from dzgui.views.components.scrollable import NoOverlayScrolledWindow
|
||||
from dzgui.views.components.buttons import IconTextButton
|
||||
from dzgui.views.components.frame import HeadingFrame
|
||||
from dzgui.views.components.scrollable import NoOverlayScrolledWindow
|
||||
from dzgui.views.trees.tree_mods import OfflineModTreeView
|
||||
|
||||
|
||||
@ -60,8 +62,9 @@ class FolderHBox(HBox):
|
||||
self.set_margin_start(10)
|
||||
self.set_margin_bottom(10)
|
||||
|
||||
# TODO: use IconButton with folder-symbolic
|
||||
self.button = Gtk.Button(label=btn_label, halign=Gtk.Align.START)
|
||||
# TODO: alternate class for left-aligned icons
|
||||
self.button = IconTextButton(FOLDER, btn_label)
|
||||
self.button.set_image_position(Gtk.PositionType.LEFT)
|
||||
self.label = Gtk.Label()
|
||||
self.extend([self.button, self.label])
|
||||
|
||||
@ -200,7 +203,6 @@ class OfflineLoader(Gtk.Box):
|
||||
margin_end=10,
|
||||
)
|
||||
|
||||
# TODO: spacing between inner and outer scrollbars
|
||||
self.controller = controller
|
||||
self.controller.register_widget("offline_loader", self)
|
||||
self.offline_man = OfflineManager(controller)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user