Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/action manager qicon import #3

Open
wants to merge 12 commits into
base: 5.0.x_dev
Choose a base branch
from

Conversation

Ashwolaa
Copy link
Contributor

Qt6 comes with its own library for icons.

This patch now allow direct import of Qt's icon with the action manager either loaded it directly as icons or through their keyword

Syntax goes as:

self.add_action(short_name='refresh',name='Clear', icon_name='ViewRefresh', tip='Clear filter', checkable=False,)
self.add_action(short_name='delete',name='Delete', icon_name=QtGui.QIcon.fromTheme( QtGui.QIcon.ThemeIcon.WindowClose), tip='Delete filter', checkable=False,)

Copy link
Contributor

@seb5g seb5g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is still some cleaning to do and a try/except statement to add. Also could you modify the docstring to explain what are the options for the icon_name:

  • png file name in the icon_library
  • enum name from the QIcon.ThemeIcon (Qt>=6.7)
  • a Path to a png file

src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
@Ashwolaa Ashwolaa requested a review from seb5g November 7, 2024 09:32
@seb5g
Copy link
Contributor

seb5g commented Nov 7, 2024

Well I did the review, there are things to do on your side ;-)
And you can add the QIcon as potential input. Make sure to create a test to try it please!

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 61.01%. Comparing base (fff13a8) to head (c967514).

Files with missing lines Patch % Lines
src/pymodaq_gui/managers/action_manager.py 75.00% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           5.0.x_dev       #3      +/-   ##
=============================================
- Coverage      61.17%   61.01%   -0.16%     
=============================================
  Files             73       73              
  Lines           8553     8552       -1     
=============================================
- Hits            5232     5218      -14     
- Misses          3321     3334      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants