-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: Change icon used in Collapsible widget #140
Conversation
@@ -11,16 +20,16 @@ class QCollapsible(QFrame): | |||
Based on https://stackoverflow.com/a/68141638 | |||
""" | |||
|
|||
_EXPANDED = "▼ " | |||
_COLLAPSED = "▲ " | |||
|
|||
def __init__(self, title: str = "", parent: Optional[QWidget] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should maybe also expose the collapsedIcon
and the expandedIcon
as Optional arguments (as some buttons allow in Qt)?
What do you think @tlambert03 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ppwadhwa thanks for working on this! Great work 🚀
Added some comments to clean up the code a bit :)
Codecov ReportBase: 85.30% // Head: 85.43% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
==========================================
+ Coverage 85.30% 85.43% +0.13%
==========================================
Files 31 31
Lines 2573 2603 +30
==========================================
+ Hits 2195 2224 +29
- Misses 378 379 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
OK. I see I need to fix the tests. Will get to this.... |
b2e66b7
to
dc2866d
Compare
…ation of QCollapsible widget
9ce54d2
to
d451e58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @ppwadhwa, works great 🚀
🤔
This one is ready for review @tlambert03 :) Thanks! |
good stuff. thanks both! |
Thanks for the quick review 🤭 @tlambert03 do you think you could make a new release with the latest changes sometime soon :) ? Thanks for the awesome project! |
Yep 👍 will do tomorrow |
thanks @tlambert03 !!! |
v0.4.1 building now... should be up soon |
This PR adds the ability to change the icon on the toggle QPushButton. Currently, the icon is a part of the text string. This PR will change it so that an icon is set on the button. The original icon is still used if there isn't one set, however, the default string is used to create an icon.
You can now instantiate a collapsible widget while also declaring an
expandedIcon
and/orcollapsedIcon
. These icons can be a QIcon or a text string.