Skip to content

Commit

Permalink
icon reorganization
Browse files Browse the repository at this point in the history
* change error message icon
* delete old icons
* add new easy-named icons
  • Loading branch information
jj-so authored and daringer committed Jan 17, 2024
1 parent 1e9e0e2 commit 716fb3f
Show file tree
Hide file tree
Showing 60 changed files with 2,067 additions and 134 deletions.
10 changes: 5 additions & 5 deletions nitrokeyapp/information_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def set_status(self, text: str, timeout: int = 7000, icon: Optional[str] = None)
self.status.show()
self.information_frame.show()
if not icon:
self.icon.setPixmap(QtUtilsMixIn.get_pixmap("info_FILL0_wght500_GRAD0_opsz40.png"))
self.icon.setPixmap(QtUtilsMixIn.get_pixmap("info.svg"))
else:
self.icon.setPixmap(QtUtilsMixIn.get_pixmap(icon))
self.icon.show()
Expand All @@ -54,7 +54,7 @@ def set_status(self, text: str, timeout: int = 7000, icon: Optional[str] = None)

@Slot(str)
def set_error_status(self, text: str) -> None:
icon = "delete_FILL0_wght500_GRAD0_opsz40.png"
icon = "warning.svg"
self.set_status(text, timeout=12000, icon=icon)

@Slot()
Expand All @@ -66,7 +66,7 @@ def hide_status(self) -> None:
def set_touch_status(self) -> None:
self.set_status("Press your Nitrokey to confirm...",
timeout=15000,
icon="touch_app_FILL0_wght500_GRAD0_opsz40.png")
icon="touch.svg")

@Slot()
def hide_touch(self) -> None:
Expand All @@ -89,10 +89,10 @@ def hide(self) -> None:
@Slot(bool)
def set_pin_icon(self, pin_cached: bool = True) -> None:
if pin_cached:
self.pin_icon.setIcon(QtUtilsMixIn.get_qicon("dialpad_FILL0_wght400_GRAD0_opsz24.svg"))
self.pin_icon.setIcon(QtUtilsMixIn.get_qicon("dialpad.svg"))
self.pin_icon.setToolTip("Passwords PIN is cached - click to clear")
else:
self.pin_icon.setIcon(QtUtilsMixIn.get_qicon("dialpad_X.png"))
self.pin_icon.setIcon(QtUtilsMixIn.get_qicon("dialpad_off.svg"))
self.pin_icon.setToolTip("Passwords PIN locked")
self.pin_icon.show()

2 changes: 1 addition & 1 deletion nitrokeyapp/nk3_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(
data: DeviceData,
) -> None:
super().__init__(
QtUtilsMixIn.get_qicon("usb_new.png"),
QtUtilsMixIn.get_qicon("nitrokey.svg"),
"Nitrokey 3: " f"{data.uuid_prefix}",
)
self.data = data
Expand Down
4 changes: 2 additions & 2 deletions nitrokeyapp/qt_utils_mix_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def collapse(
# Find out if the state is on or off
state = expand_button.isChecked()
if not state:
expand_button.setIcon(self.get_qicon("right_arrow.png"))
expand_button.setIcon(self.get_qicon("right_arrow.svg"))
expand_button.setIconSize(QSize(12, 12))
frame.setFixedHeight(0)
# Set window Height
# self.setFixedHeight(self.sizeHint().height())
else:
expand_button.setIcon(self.get_qicon("down_arrow.png"))
expand_button.setIcon(self.get_qicon("down_arrow.svg"))
oSize = frame.sizeHint()
frame.setFixedHeight(oSize.height())
# Set window Height
Expand Down
20 changes: 10 additions & 10 deletions nitrokeyapp/secrets_tab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ def __init__(self, info_box: InfoBox, parent: Optional[QWidget] = None) -> None:
self.ui = self.load_ui("secrets_tab.ui", self)


icon_copy = self.get_qicon("content_copy_FILL0_wght400_GRAD0_opsz24.svg")
icon_refresh = self.get_qicon("refresh_FILL0_wght400_GRAD0_opsz24.svg")
icon_edit = self.get_qicon("edit_FILL0_wght400_GRAD0_opsz24.png")
icon_visibility = self.get_qicon("visibility_off_FILL0_wght400_GRAD0_opsz24.svg")
icon_copy = self.get_qicon("content_copy.svg")
icon_refresh = self.get_qicon("OTP_generate.svg")
icon_edit = self.get_qicon("edit.svg")
icon_visibility = self.get_qicon("visibility_off.svg")

loc = QLineEdit.ActionPosition.TrailingPosition
self.action_username_copy = self.ui.username.addAction(icon_copy, loc)
Expand Down Expand Up @@ -308,9 +308,9 @@ def otp_generated(self, data: OtpData) -> None:

def add_credential(self, credential: Credential) -> QListWidgetItem:
icon = (
"lock_FILL0_wght500_GRAD0_opsz40"
"lock"
if credential.protected
else "lock_open_FILL0_wght500_GRAD0_opsz40"
else "lock_open"
)
item = QListWidgetItem(credential.name)
item.setIcon(self.get_qicon(f"{icon}.svg"))
Expand Down Expand Up @@ -599,17 +599,17 @@ def check_credential(self) -> None:
def act_copy_line_edit(self, obj: QLineEdit):
self.clipboard.setText(obj.text())
self.info_box.set_status("contents copied to clipboard")
self.line2copy_action[obj].setIcon(self.get_qicon("done_FILL0_wght400_GRAD0_opsz24.png"))
self.line2copy_action[obj].setIcon(self.get_qicon("done.svg"))
QTimer.singleShot(5000, lambda:
self.line2copy_action[obj].setIcon(self.get_qicon("content_copy_FILL0_wght400_GRAD0_opsz24.png"))
self.line2copy_action[obj].setIcon(self.get_qicon("content_copy.svg"))
)

def act_password_show(self) -> None:
self.set_password_show(self.ui.password.echoMode() == QLineEdit.Password)

def set_password_show(self, show=True):
icon_show = self.get_qicon("visibility_FILL0_wght400_GRAD0_opsz24.svg")
icon_hide = self.get_qicon("visibility_off_FILL0_wght400_GRAD0_opsz24.svg")
icon_show = self.get_qicon("visibility.svg")
icon_hide = self.get_qicon("visibility_off.svg")
icon = icon_show if show else icon_hide
mode = QLineEdit.Normal if show else QLineEdit.Password
self.ui.password.setEchoMode(mode)
Expand Down
10 changes: 10 additions & 0 deletions nitrokeyapp/ui/icons/OTP_generate.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions nitrokeyapp/ui/icons/add_circle.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 716fb3f

Please sign in to comment.