mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 22:31:43 +03:00
Refactor --ascii-only argument plumbing
Query for the argument instead of patching values in from outside.
This commit is contained in:
parent
ad83dee949
commit
47468d1c06
@ -49,7 +49,7 @@ from .graphics_primitives import (
|
|||||||
flood_fill,
|
flood_fill,
|
||||||
)
|
)
|
||||||
from .menus import MenuBar, Menu, MenuItem, Separator
|
from .menus import MenuBar, Menu, MenuItem, Separator
|
||||||
from .windows import Window, DialogWindow, CharacterSelectorDialogWindow, MessageBox, WindowTitleBar, get_warning_icon, get_question_icon, get_paint_icon
|
from .windows import Window, DialogWindow, CharacterSelectorDialogWindow, MessageBox, get_warning_icon, get_question_icon, get_paint_icon
|
||||||
from .file_dialogs import SaveAsDialogWindow, OpenDialogWindow
|
from .file_dialogs import SaveAsDialogWindow, OpenDialogWindow
|
||||||
from .edit_colors import EditColorsDialogWindow
|
from .edit_colors import EditColorsDialogWindow
|
||||||
from .localization.i18n import get as _, load_language, remove_hotkey
|
from .localization.i18n import get as _, load_language, remove_hotkey
|
||||||
@ -5240,13 +5240,6 @@ if args.ascii_only:
|
|||||||
from .ascii_borders import force_ascii_borders
|
from .ascii_borders import force_ascii_borders
|
||||||
force_ascii_borders()
|
force_ascii_borders()
|
||||||
|
|
||||||
# Adjust icons
|
|
||||||
WindowTitleBar.MINIMIZE_ICON = "_" # was originally: "🗕"
|
|
||||||
WindowTitleBar.MAXIMIZE_ICON = "□" # was originally: "🗖" # not technically ASCII; could use "^" or "[]"
|
|
||||||
WindowTitleBar.RESTORE_ICON = "□" # was originally: "🗗" # not technically ASCII; could use "^" or "%" or "#"
|
|
||||||
WindowTitleBar.CLOSE_ICON = "X" # was originally: "🗙"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# `textual run --dev src.textual_paint.paint` will search for a
|
# `textual run --dev src.textual_paint.paint` will search for a
|
||||||
# global variable named `app`, and fallback to
|
# global variable named `app`, and fallback to
|
||||||
|
@ -19,10 +19,10 @@ from .args import args
|
|||||||
class WindowTitleBar(Container):
|
class WindowTitleBar(Container):
|
||||||
"""A title bar widget."""
|
"""A title bar widget."""
|
||||||
|
|
||||||
MINIMIZE_ICON = "🗕"
|
MINIMIZE_ICON = "_" if args.ascii_only else "🗕"
|
||||||
MAXIMIZE_ICON = "🗖"
|
MAXIMIZE_ICON = "□" if args.ascii_only else "🗖" # not technically ASCII; could use "^" or "[]"
|
||||||
RESTORE_ICON = "🗗"
|
RESTORE_ICON = "□" if args.ascii_only else "🗗" # not technically ASCII; could use "^" or "%" or "#"
|
||||||
CLOSE_ICON = "🗙"
|
CLOSE_ICON = "X" if args.ascii_only else "🗙"
|
||||||
|
|
||||||
title = var("")
|
title = var("")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user