[view] improvement: displaying tips for some custom actions (on mouse hover)

This commit is contained in:
Vinicius Moreira
2022-02-25 11:50:28 -03:00
parent 5fea95654b
commit 320b6062ca
4 changed files with 19 additions and 5 deletions

View File

@@ -176,9 +176,11 @@ class PackagesTable(QTableWidget):
i18n=self.i18n).ask():
self.window.begin_execute_custom_action(pkg, action)
tip = self.i18n[action.i18n_description_key] if action.i18n_description_key else None
return QCustomMenuAction(parent=parent,
label=self.i18n[action.i18n_label_key],
icon=QIcon(action.icon_path) if action.icon_path else None,
tooltip=tip,
action=custom_action)
def refresh(self, pkg: PackageView):

View File

@@ -1508,9 +1508,11 @@ class ManageWindow(QWidget):
else:
icon = None
tip = self.i18n[action.i18n_description_key] if action.i18n_description_key else None
return QCustomMenuAction(parent=parent,
label=self.i18n[action.i18n_label_key],
action=lambda: self.begin_execute_custom_action(None, action),
tooltip=tip,
icon=icon)
def show_custom_actions(self):