Skip to content

Commit

Permalink
fix display of colored icons for profile groups
Browse files Browse the repository at this point in the history
  • Loading branch information
redvox committed Jan 15, 2025
1 parent 3b881de commit 1614f6b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Release dates will be in YYYY-MM-DD format.
- On login the current region text will now be updated.
- The region overwrite menu will not change text on selection.
- When not logged in, the tray icon will now display the outline variant of the icon.
- fix issue where config is not properly replaced on config edits.
- fix issue where config is not properly replaced on config edits.
- fix display of colord icons for profile groups.

## 7.0.0 - 2024-04-05

Expand Down
16 changes: 9 additions & 7 deletions app/gui/trayicon.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from functools import partial
from typing import List, TYPE_CHECKING

from PyQt6.QtCore import QSize
from PyQt6.QtWidgets import QSystemTrayIcon, QMenu

from app.aws import regions
from app.core.profile_group import ProfileGroup
from app.gui.assets import ICON_STYLE_OUTLINE, ICON_STYLE_FULL, ICON_STYLE_GCP
from app.gui.assets import ICON_STYLE_OUTLINE, ICON_STYLE_GCP, ICON_STYLE_FULL

if TYPE_CHECKING:
from gui.gui import Gui
Expand Down Expand Up @@ -41,16 +42,17 @@ def populate_context_menu(self, profile_list: List[ProfileGroup]):
for profile_group in profile_list:
if profile_group.type == "aws":
action = menu.addAction(profile_group.name)
action.triggered.connect(partial(self.gui.login,
profile_group=profile_group))
action.setIconVisibleInMenu(True)
action.triggered.connect(partial(self.gui.login, profile_group=profile_group))
action.setIcon(self.assets.get_icon(style=ICON_STYLE_FULL, color_code=profile_group.color))
self.actions.append(action)

# log out
action = menu.addAction('logout')
action.triggered.connect(self.gui.logout)
action.setIcon(self.assets.get_icon(style=ICON_STYLE_OUTLINE, color_code='#FFFFFF'))
self.actions.append(action)
logut_action = menu.addAction('logout')
logut_action.setIconVisibleInMenu(True)
logut_action.triggered.connect(self.gui.logout)
logut_action.setIcon(self.assets.get_icon(style=ICON_STYLE_OUTLINE, color_code='#FFFFFF'))
self.actions.append(logut_action)

# gcp profiles
menu.addSeparator()
Expand Down

0 comments on commit 1614f6b

Please sign in to comment.