Skip to content

Commit 1614f6b

Browse files
committed
fix display of colored icons for profile groups
1 parent 3b881de commit 1614f6b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Release dates will be in YYYY-MM-DD format.
3333
- On login the current region text will now be updated.
3434
- The region overwrite menu will not change text on selection.
3535
- When not logged in, the tray icon will now display the outline variant of the icon.
36-
- fix issue where config is not properly replaced on config edits.
36+
- fix issue where config is not properly replaced on config edits.
37+
- fix display of colord icons for profile groups.
3738

3839
## 7.0.0 - 2024-04-05
3940

app/gui/trayicon.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from functools import partial
22
from typing import List, TYPE_CHECKING
33

4+
from PyQt6.QtCore import QSize
45
from PyQt6.QtWidgets import QSystemTrayIcon, QMenu
56

67
from app.aws import regions
78
from app.core.profile_group import ProfileGroup
8-
from app.gui.assets import ICON_STYLE_OUTLINE, ICON_STYLE_FULL, ICON_STYLE_GCP
9+
from app.gui.assets import ICON_STYLE_OUTLINE, ICON_STYLE_GCP, ICON_STYLE_FULL
910

1011
if TYPE_CHECKING:
1112
from gui.gui import Gui
@@ -41,16 +42,17 @@ def populate_context_menu(self, profile_list: List[ProfileGroup]):
4142
for profile_group in profile_list:
4243
if profile_group.type == "aws":
4344
action = menu.addAction(profile_group.name)
44-
action.triggered.connect(partial(self.gui.login,
45-
profile_group=profile_group))
45+
action.setIconVisibleInMenu(True)
46+
action.triggered.connect(partial(self.gui.login, profile_group=profile_group))
4647
action.setIcon(self.assets.get_icon(style=ICON_STYLE_FULL, color_code=profile_group.color))
4748
self.actions.append(action)
4849

4950
# log out
50-
action = menu.addAction('logout')
51-
action.triggered.connect(self.gui.logout)
52-
action.setIcon(self.assets.get_icon(style=ICON_STYLE_OUTLINE, color_code='#FFFFFF'))
53-
self.actions.append(action)
51+
logut_action = menu.addAction('logout')
52+
logut_action.setIconVisibleInMenu(True)
53+
logut_action.triggered.connect(self.gui.logout)
54+
logut_action.setIcon(self.assets.get_icon(style=ICON_STYLE_OUTLINE, color_code='#FFFFFF'))
55+
self.actions.append(logut_action)
5456

5557
# gcp profiles
5658
menu.addSeparator()

0 commit comments

Comments
 (0)