Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SeedSigner Icons v2 #423

Merged
merged 30 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
40abf59
Icon font update
easyuxd Aug 3, 2023
78683e7
SeedSignerIconConstants
easyuxd Aug 4, 2023
550f576
Define SeedSignerIconConstants
easyuxd Aug 4, 2023
5ffd512
Update view.py
easyuxd Aug 4, 2023
5c90e9e
Update seedsigner-icons.otf
easyuxd Aug 4, 2023
38b5d3b
jdlcdl's modified screenshot_generator
easyuxd Aug 4, 2023
f083d40
Update psbt_views.py
easyuxd Aug 4, 2023
0e196bc
Merge branch 'dev' into seedsigner-icons-v2
easyuxd Aug 4, 2023
da5a7ef
Icon tweaks, Large button size
easyuxd Aug 5, 2023
f7f08ff
Fingerprint icon, color
easyuxd Aug 5, 2023
477a4c8
Update seed_views.py
easyuxd Aug 5, 2023
4bfbcab
Blue icon color
easyuxd Aug 5, 2023
403b386
Blue myself
easyuxd Aug 5, 2023
9ec31a2
tweaks for new easyuxd screenshots
Aug 5, 2023
045f6ca
Edits to enable running in local dev
kdmukai Aug 7, 2023
b269f8f
Update README.md
kdmukai Aug 7, 2023
1ed5560
Merge pull request #1 from jdlcdl/pr_423
easyuxd Aug 7, 2023
f873dc1
Merge pull request #2 from kdmukai/pr_423_with_local_mocks
easyuxd Aug 7, 2023
3c89359
Comments for icon categories
easyuxd Aug 7, 2023
cd65820
Merge branch 'seedsigner-icons-v2' of https://github.com/easyuxd/seed…
easyuxd Aug 7, 2023
2fe0f3f
test suite working
Aug 7, 2023
2690d4d
Merge pull request #3 from jdlcdl/easyuxd_pr3
easyuxd Aug 8, 2023
9368d23
Icons v2.1, color edits
easyuxd Aug 8, 2023
54ae0d7
Update components.py
easyuxd Aug 8, 2023
f6c1152
Update seedsigner-icons.otf
easyuxd Aug 8, 2023
8bb6d25
Color constants clean-up
easyuxd Aug 8, 2023
092445b
More color constants cleanup
easyuxd Aug 8, 2023
10202bd
Update components.py
easyuxd Aug 8, 2023
b16c0ee
Reverted cursor color
easyuxd Aug 8, 2023
d27e9e3
Merge branch 'dev' into seedsigner-icons-v2
easyuxd Aug 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 43 additions & 34 deletions src/seedsigner/gui/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GUIConstants:
REGTEST_COLOR = "#00caf1"

ICON_FONT_NAME__FONT_AWESOME = "Font_Awesome_6_Free-Solid-900"
ICON_FONT_NAME__SEEDSIGNER = "seedsigner-glyphs"
ICON_FONT_NAME__SEEDSIGNER = "seedsigner-icons"
ICON_FONT_SIZE = 22
ICON_INLINE_FONT_SIZE = 24
ICON_LARGE_BUTTON_SIZE = 36
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For your LargeButtonScreen where your latest icon set appears smaller than before, you might play with resizing this from 36 to something bigger.

I don't know what bad side-effects this might have. @kdmukai will probably know better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to 48 and it's fixed. I can't find anything that broke.
MainMenuView

Expand Down Expand Up @@ -69,10 +69,6 @@ class FontAwesomeIconConstants:
ANGLE_RIGHT = "\uf105"
ANGLE_UP = "\uf106"
CAMERA = "\uf030"
CARET_DOWN = "\uf0d7"
CARET_LEFT = "\uf0d9"
CARET_RIGHT = "\uf0da"
CARET_UP = "\uf0d8"
CHEVRON_UP = "\uf077"
CHEVRON_DOWN = "\uf078"
SOLID_CIRCLE_CHECK = "\uf058"
Expand All @@ -85,46 +81,59 @@ class FontAwesomeIconConstants:
DICE_FOUR = "\uf524"
DICE_FIVE = "\uf523"
DICE_SIX = "\uf526"
GEAR = "\uf013"
KEY = "\uf084"
KEYBOARD = "\uf11c"
LOCK = "\uf023"
MAP = "\uf279"
PAPER_PLANE = "\uf1d8"
PEN = "\uf304"
PLUS = "+"
POWER_OFF = "\uf011"
ROTATE_RIGHT = "\uf2f9"
SCREWDRIVER_WRENCH = "\uf7d9"
SDCARD = "\uf7c2"
SQUARE = "\uf0c8"
SQUARE_CARET_DOWN = "\uf150"
SQUARE_CARET_LEFT = "\uf191"
SQUARE_CARET_RIGHT = "\uf152"
SQUARE_CARET_UP = "\uf151"
SQUARE_CHECK = "\uf14a"
TRIANGLE_EXCLAMATION = "\uf071"
UNLOCK = "\uf09c"
QRCODE = "\uf029"
X = "\u0058"
SDCARD = "\uf7c2"


class SeedSignerCustomIconConstants:
LARGE_CHEVRON_LEFT = "\ue900"
SMALL_CHEVRON_RIGHT = "\ue901"
PAGE_UP = "\ue903"
PAGE_DOWN = "\ue902"
PLUS = "\ue904"
CIRCLE_CHECK = "\ue907"
CIRCLE_EXCLAMATION = "\ue908"
CIRCLE_X = "\ue909"
FINGERPRINT = "\ue90a"
PATH = "\ue90b"
BITCOIN_LOGO_STRAIGHT = "\ue90c"
BITCOIN_LOGO_TILTED = "\ue90d"
class SeedSignerIconConstants:
SCAN = "\ue900"
SEEDS = "\ue901"
SETTINGS = "\ue902"
TOOLS = "\ue903"

BACK = "\ue904"
CHEVRON_DOWN = "\ue905"
CHEVRON_LEFT = "\ue906"
CHEVRON_RIGHT = "\ue907"
CHEVRON_UP = "\ue908"
CLOSE = "\ue909"
PAGE_DOWN = "\ue90a"
PAGE_UP = "\ue90b"
PLUS = "\ue90c"
POWER = "\ue90d"

ERROR = "\ue90e"
SUCCESS = "\ue90f"
WARNING = "\ue910"

ADDRESS = "\ue911"
CHANGE = "\ue912"
DERIVATION = "\ue913"
FEE = "\ue914"
FINGERPRINT = "\ue915"
PASSPHRASE = "\ue916"

BITCOIN = "\ue917"
BITCOIN_ALT = "\ue918"
BRIGHTNESS = "\ue919"
MICROSD = "\ue91a"
QRCODE = "\ue91b"

MIN_VALUE = LARGE_CHEVRON_LEFT
MAX_VALUE = BITCOIN_LOGO_TILTED
MIN_VALUE = SCAN
MAX_VALUE = QRCODE



Expand Down Expand Up @@ -425,14 +434,14 @@ def render(self):
class Icon(BaseComponent):
screen_x: int = 0
screen_y: int = 0
icon_name: str = SeedSignerCustomIconConstants.BITCOIN_LOGO_TILTED
icon_name: str = SeedSignerIconConstants.BITCOIN_ALT
icon_size: int = GUIConstants.ICON_FONT_SIZE
icon_color: str = GUIConstants.BODY_FONT_COLOR

def __post_init__(self):
super().__post_init__()

if SeedSignerCustomIconConstants.MIN_VALUE <= self.icon_name and self.icon_name <= SeedSignerCustomIconConstants.MAX_VALUE:
if SeedSignerIconConstants.MIN_VALUE <= self.icon_name and self.icon_name <= SeedSignerIconConstants.MAX_VALUE:
self.icon_font = Fonts.get_font(GUIConstants.ICON_FONT_NAME__SEEDSIGNER, self.icon_size, file_extension="otf")
else:
self.icon_font = Fonts.get_font(GUIConstants.ICON_FONT_NAME__FONT_AWESOME, self.icon_size, file_extension="otf")
Expand Down Expand Up @@ -859,7 +868,7 @@ def __post_init__(self):
btc_icon = Icon(
image_draw=draw,
canvas=self.paste_image,
icon_name=SeedSignerCustomIconConstants.BITCOIN_LOGO_TILTED,
icon_name=SeedSignerIconConstants.BITCOIN_ALT,
icon_color=btc_color,
icon_size=self.icon_size,
screen_x=0,
Expand Down Expand Up @@ -947,7 +956,7 @@ def __post_init__(self):
btc_icon = Icon(
image_draw=draw,
canvas=self.paste_image,
icon_name=SeedSignerCustomIconConstants.BITCOIN_LOGO_TILTED,
icon_name=SeedSignerIconConstants.BITCOIN_ALT,
icon_color=btc_color,
icon_size=self.icon_size,
screen_x=0,
Expand Down Expand Up @@ -1279,7 +1288,7 @@ def __post_init__(self):

if self.show_back_button:
self.left_button = IconButton(
icon_name=SeedSignerCustomIconConstants.LARGE_CHEVRON_LEFT,
icon_name=SeedSignerIconConstants.BACK,
icon_size=GUIConstants.ICON_INLINE_FONT_SIZE,
screen_x=GUIConstants.EDGE_PADDING,
screen_y=GUIConstants.EDGE_PADDING,
Expand All @@ -1289,7 +1298,7 @@ def __post_init__(self):

if self.show_power_button:
self.right_button = IconButton(
icon_name=FontAwesomeIconConstants.POWER_OFF,
icon_name=SeedSignerIconConstants.POWER,
icon_size=GUIConstants.ICON_INLINE_FONT_SIZE,
screen_x=self.width - GUIConstants.TOP_NAV_BUTTON_SIZE - GUIConstants.EDGE_PADDING,
screen_y=GUIConstants.EDGE_PADDING,
Expand Down
6 changes: 3 additions & 3 deletions src/seedsigner/gui/screens/psbt_screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from seedsigner.models.threads import BaseThread

from .screen import ButtonListScreen, WarningScreen
from ..components import (BtcAmount, Button, Icon, FontAwesomeIconConstants, IconTextLine, FormattedAddress, GUIConstants, Fonts, SeedSignerCustomIconConstants, TextArea,
from ..components import (BtcAmount, Button, Icon, FontAwesomeIconConstants, IconTextLine, FormattedAddress, GUIConstants, Fonts, SeedSignerIconConstants, TextArea,
calc_bezier_curve, linear_interp)


Expand Down Expand Up @@ -655,7 +655,7 @@ def __post_init__(self):
# Adjust the vertical spacing
screen_y -= GUIConstants.COMPONENT_PADDING
self.components.append(IconTextLine(
icon_name=SeedSignerCustomIconConstants.FINGERPRINT,
icon_name=SeedSignerIconConstants.FINGERPRINT,
icon_color="blue",
value_text=f"""{"Multisig" if self.is_multisig else self.fingerprint}: {"Change" if self.is_change_derivation_path else "Addr"} #{self.derivation_path_addr_index}""",
is_text_centered=False,
Expand All @@ -665,7 +665,7 @@ def __post_init__(self):

if self.is_change_addr_verified:
self.components.append(IconTextLine(
icon_name=SeedSignerCustomIconConstants.CIRCLE_CHECK,
icon_name=SeedSignerIconConstants.SUCCESS,
icon_color="#00dd00",
value_text="Address verified!",
is_text_centered=False,
Expand Down
14 changes: 7 additions & 7 deletions src/seedsigner/gui/screens/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from seedsigner.models.settings import SettingsConstants

from ..components import (FontAwesomeIconConstants, GUIConstants, BaseComponent, Button, Icon, IconButton,
LargeIconButton, SeedSignerCustomIconConstants, TopNav, TextArea, load_image, ToastOverlay,
LargeIconButton, SeedSignerIconConstants, TopNav, TextArea, load_image, ToastOverlay,
Fonts)

from seedsigner.hardware.buttons import HardwareButtonsConstants, HardwareButtons
Expand Down Expand Up @@ -692,7 +692,7 @@ def add_brightness_tips(self, image: Image.Image) -> None:
canvas=rectangle,
screen_x=GUIConstants.EDGE_PADDING*2 + 1,
screen_y=GUIConstants.COMPONENT_PADDING + 4, # +4 fudge factor to account for where the chevron is drawn relative to baseline
icon_name=FontAwesomeIconConstants.CHEVRON_UP,
icon_name=SeedSignerIconConstants.CHEVRON_UP,
icon_size=GUIConstants.BODY_FONT_SIZE,
)
chevron_up_icon.render()
Expand All @@ -702,7 +702,7 @@ def add_brightness_tips(self, image: Image.Image) -> None:
canvas=rectangle,
screen_x=chevron_up_icon.screen_x,
screen_y=chevron_up_icon.screen_y + chevron_up_icon.icon_size + GUIConstants.BODY_LINE_SPACING,
icon_name=FontAwesomeIconConstants.CHEVRON_DOWN,
icon_name=SeedSignerIconConstants.CHEVRON_DOWN,
icon_size=chevron_up_icon.icon_size,
)
chevron_down_icon.render()
Expand Down Expand Up @@ -824,7 +824,7 @@ def _run(self):
@dataclass
class LargeIconStatusScreen(ButtonListScreen):
title: str = "Success!"
status_icon_name: str = SeedSignerCustomIconConstants.CIRCLE_CHECK
status_icon_name: str = SeedSignerIconConstants.SUCCESS
status_icon_size: int = GUIConstants.ICON_PRIMARY_SCREEN_SIZE
status_color: str = GUIConstants.SUCCESS_COLOR
status_headline: str = "Success!" # The colored text under the large icon
Expand Down Expand Up @@ -948,7 +948,7 @@ def __post_init__(self):
@dataclass
class WarningScreen(WarningEdgesMixin, LargeIconStatusScreen):
title: str = "Caution"
status_icon_name: str = SeedSignerCustomIconConstants.CIRCLE_EXCLAMATION
status_icon_name: str = SeedSignerIconConstants.WARNING
status_color: str = "yellow"
status_headline: str = "Privacy Leak!" # The colored text under the alert icon

Expand Down Expand Up @@ -1242,15 +1242,15 @@ def _render(self):
if self.action == MicroSD.ACTION__REMOVED:

self.toast = ToastOverlay(
icon_name=FontAwesomeIconConstants.SDCARD,
icon_name=SeedSignerIconConstants.MICROSD,
color=GUIConstants.NOTIFICATION_COLOR,
label_text="MicroSD removed"
)

elif self.action == MicroSD.ACTION__INSERTED:

self.toast = ToastOverlay(
icon_name=FontAwesomeIconConstants.SDCARD,
icon_name=SeedSignerIconConstants.MICROSD,
color=GUIConstants.NOTIFICATION_COLOR,
label_text="MicroSD inserted"
)
Expand Down
12 changes: 6 additions & 6 deletions src/seedsigner/gui/screens/seed_screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from .screen import RET_CODE__BACK_BUTTON, BaseScreen, BaseTopNavScreen, ButtonListScreen, KeyboardScreen, WarningEdgesMixin
from ..components import (Button, FontAwesomeIconConstants, Fonts, FormattedAddress, IconButton,
IconTextLine, SeedSignerCustomIconConstants, TextArea, GUIConstants,
IconTextLine, SeedSignerIconConstants, TextArea, GUIConstants,
calc_text_centering)

from seedsigner.gui.keyboard import Keyboard, TextEntryDisplay
Expand Down Expand Up @@ -421,7 +421,7 @@ def __post_init__(self):
super().__post_init__()

self.fingerprint_icontl = IconTextLine(
icon_name=SeedSignerCustomIconConstants.FINGERPRINT,
icon_name=SeedSignerIconConstants.FINGERPRINT,
icon_color="blue",
icon_size=GUIConstants.ICON_FONT_SIZE + 12,
label_text="fingerprint",
Expand All @@ -441,7 +441,7 @@ class SeedOptionsScreen(ButtonListScreen):
has_passphrase: bool = False

def __post_init__(self):
self.top_nav_icon_name = SeedSignerCustomIconConstants.FINGERPRINT
self.top_nav_icon_name = SeedSignerIconConstants.FINGERPRINT
self.top_nav_icon_color = "blue"
self.title = self.fingerprint
self.is_button_text_centered = False
Expand Down Expand Up @@ -584,7 +584,7 @@ def __post_init__(self):

# Set up the fingerprint and passphrase displays
self.fingerprint_line = IconTextLine(
icon_name=SeedSignerCustomIconConstants.FINGERPRINT,
icon_name=SeedSignerIconConstants.FINGERPRINT,
icon_color="blue",
label_text="Fingerprint",
value_text=self.fingerprint,
Expand All @@ -594,7 +594,7 @@ def __post_init__(self):
self.components.append(self.fingerprint_line)

self.derivation_line = IconTextLine(
icon_name=SeedSignerCustomIconConstants.PATH,
icon_name=SeedSignerIconConstants.DERIVATION,
label_text="Derivation",
value_text=self.derivation_path,
screen_x=GUIConstants.COMPONENT_PADDING,
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def __post_init__(self):
super().__post_init__()

self.components.append(IconTextLine(
icon_name=SeedSignerCustomIconConstants.FINGERPRINT,
icon_name=SeedSignerIconConstants.FINGERPRINT,
icon_color="blue",
label_text="changes fingerprint",
value_text=f"{self.fingerprint_without} >> {self.fingerprint_with}",
Expand Down
10 changes: 5 additions & 5 deletions src/seedsigner/gui/screens/tools_screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from PIL.Image import Image
from seedsigner.gui.keyboard import Keyboard, TextEntryDisplay
from seedsigner.hardware.camera import Camera
from seedsigner.gui.components import FontAwesomeIconConstants, Fonts, FormattedAddress, GUIConstants, IconTextLine, SeedSignerCustomIconConstants, TextArea
from seedsigner.gui.components import FontAwesomeIconConstants, Fonts, FormattedAddress, GUIConstants, IconTextLine, SeedSignerIconConstants, TextArea

from seedsigner.gui.screens.screen import RET_CODE__BACK_BUTTON, BaseScreen, BaseTopNavScreen, ButtonListScreen, KeyboardScreen
from seedsigner.hardware.buttons import HardwareButtonsConstants
Expand Down Expand Up @@ -362,7 +362,7 @@ def __post_init__(self):
))

self.components.append(IconTextLine(
icon_name=SeedSignerCustomIconConstants.FINGERPRINT,
icon_name=SeedSignerIconConstants.FINGERPRINT,
icon_color="blue",
label_text="fingerprint",
value_text=self.fingerprint,
Expand All @@ -386,7 +386,7 @@ def __post_init__(self):

if self.fingerprint:
self.components.append(IconTextLine(
icon_name=SeedSignerCustomIconConstants.FINGERPRINT,
icon_name=SeedSignerIconConstants.FINGERPRINT,
icon_color="blue",
label_text="Fingerprint",
value_text=self.fingerprint,
Expand All @@ -396,15 +396,15 @@ def __post_init__(self):

if self.script_type != SettingsConstants.CUSTOM_DERIVATION:
self.components.append(IconTextLine(
icon_name=SeedSignerCustomIconConstants.PATH,
icon_name=SeedSignerIconConstants.DERIVATION,
label_text="Derivation",
value_text=SettingsDefinition.get_settings_entry(attr_name=SettingsConstants.SETTING__SCRIPT_TYPES).get_selection_option_display_name_by_value(value=self.script_type),
screen_x=GUIConstants.EDGE_PADDING,
screen_y=self.components[-1].screen_y + self.components[-1].height + GUIConstants.COMPONENT_PADDING,
))
else:
self.components.append(IconTextLine(
icon_name=SeedSignerCustomIconConstants.PATH,
icon_name=SeedSignerIconConstants.DERIVATION,
label_text="Derivation",
value_text=self.custom_derivation_path,
screen_x=GUIConstants.EDGE_PADDING,
Expand Down
Binary file removed src/seedsigner/resources/fonts/seedsigner-glyphs.otf
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions src/seedsigner/views/psbt_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from embit.networks import NETWORKS
from seedsigner.controller import Controller

from seedsigner.gui.components import FontAwesomeIconConstants, SeedSignerCustomIconConstants
from seedsigner.gui.components import FontAwesomeIconConstants, SeedSignerIconConstants
from seedsigner.models.encode_qr import EncodeQR
from seedsigner.models.psbt_parser import PSBTParser
from seedsigner.models.qr_type import QRType
Expand All @@ -21,7 +21,7 @@


class PSBTSelectSeedView(View):
SCAN_SEED = ("Scan a seed", FontAwesomeIconConstants.QRCODE)
SCAN_SEED = ("Scan a seed", SeedSignerIconConstants.QRCODE)
TYPE_12WORD = ("Enter 12-word seed", FontAwesomeIconConstants.KEYBOARD)
TYPE_24WORD = ("Enter 24-word seed", FontAwesomeIconConstants.KEYBOARD)
button_data = []
Expand All @@ -41,7 +41,7 @@ def run(self):
# Doesn't look like this seed can sign the current PSBT
button_str += " (?)"

self.button_data.append((button_str, SeedSignerCustomIconConstants.FINGERPRINT, "blue"))
self.button_data.append((button_str, SeedSignerIconConstants.FINGERPRINT, "blue"))

self.button_data.append(self.SCAN_SEED)
self.button_data.append(self.TYPE_12WORD)
Expand Down Expand Up @@ -531,7 +531,7 @@ def run(self):
# Just a WarningScreen here; only use DireWarningScreen for true security risks.
selected_menu_num = WarningScreen(
title="PSBT Error",
status_icon_name=SeedSignerCustomIconConstants.CIRCLE_EXCLAMATION,
status_icon_name=SeedSignerIconConstants.WARNING,
status_headline="Signing Failed",
text="Signing with this seed did not add a valid signature.",
button_data=["Select Diff Seed"],
Expand Down
Loading