pyapp-kit / superqt

Missing widgets and components for Qt-python
https://pyapp-kit.github.io/superqt/
BSD 3-Clause "New" or "Revised" License
210 stars 37 forks source link

feat: add addKey method to QIconifyIcon #218

Closed tlambert03 closed 1 year ago

tlambert03 commented 1 year ago

This PR adds an addKey method, similar to QIcon.addFile, to QIconifyIcon. It can be used to add icons/colors for various states/modes:

    def addKey(
        self,
        *key: str,
        color: str | None = None,
        flip: Flip | None = None,
        rotate: Rotation | None = None,
        dir: str | None = None,
        size: QSize | None = None,
        mode: QIcon.Mode = QIcon.Mode.Normal,
        state: QIcon.State = QIcon.State.Off,
    ) -> None:
codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (61e7409) 87.42% compared to head (9aa2a6a) 87.45%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #218 +/- ## ========================================== + Coverage 87.42% 87.45% +0.02% ========================================== Files 46 46 Lines 3356 3355 -1 ========================================== Hits 2934 2934 + Misses 422 421 -1 ``` | [Files](https://app.codecov.io/gh/pyapp-kit/superqt/pull/218?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyapp-kit) | Coverage Δ | | |---|---|---| | [src/superqt/iconify/\_\_init\_\_.py](https://app.codecov.io/gh/pyapp-kit/superqt/pull/218?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyapp-kit#diff-c3JjL3N1cGVycXQvaWNvbmlmeS9fX2luaXRfXy5weQ==) | `100.00% <100.00%> (+7.14%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.