|
1 | 1 | from functools import partial
|
2 | 2 | from typing import List, TYPE_CHECKING
|
3 | 3 |
|
| 4 | +from PyQt6.QtCore import QSize |
4 | 5 | from PyQt6.QtWidgets import QSystemTrayIcon, QMenu
|
5 | 6 |
|
6 | 7 | from app.aws import regions
|
7 | 8 | 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 |
9 | 10 |
|
10 | 11 | if TYPE_CHECKING:
|
11 | 12 | from gui.gui import Gui
|
@@ -41,16 +42,17 @@ def populate_context_menu(self, profile_list: List[ProfileGroup]):
|
41 | 42 | for profile_group in profile_list:
|
42 | 43 | if profile_group.type == "aws":
|
43 | 44 | 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)) |
46 | 47 | action.setIcon(self.assets.get_icon(style=ICON_STYLE_FULL, color_code=profile_group.color))
|
47 | 48 | self.actions.append(action)
|
48 | 49 |
|
49 | 50 | # 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) |
54 | 56 |
|
55 | 57 | # gcp profiles
|
56 | 58 | menu.addSeparator()
|
|
0 commit comments