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