-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
PR: qta-browser update #233
Conversation
commit aabecef Author: pedromorgan@gmail.com <--replace-all> Date: Thu May 4 22:42:59 2023 +0100 GUI improvements for necessitarty commit 779fde3 Author: pedromorgan@gmail.com <--replace-all> Date: Thu May 4 22:27:08 2023 +0100 clear button commit f47909f Author: pedromorgan@gmail.com <--replace-all> Date: Thu May 4 22:10:25 2023 +0100 toolbar group commit 6314863 Author: pedromorgan@gmail.com <--replace-all> Date: Thu May 4 21:38:40 2023 +0100 toolbar commit 6009b48 Author: pedromorgan@gmail.com <--replace-all> Date: Thu May 4 21:16:24 2023 +0100 cols and settings commit 22d6cc3 Author: pedromorgan@gmail.com <--replace-all> Date: Thu May 4 20:42:23 2023 +0100 add cols size coil
Hi @pedromorgan thank you for your interest in improving the icon browser! I think the idea behind the changes makes sense but just in case, what do you think @ccordoba12 ? Also, if this go forward I think we should update the screenshot for the icon browser and maybe expand a little bit the README section about it (maybe including info about the settings that are persisted between launches?) and of course fix the failing tests :) Thank you again for your interest in improving QtAwesome @pedromorgan ! |
hi @dalthviz, thanks for reply... and an updates patch
|
I looks good to me too, thanks @pedromorgan for your contribution! |
Just updated screenshot Ready for merge.. TIA |
@dalthviz @ccordoba12 How does this review work? |
Hi @pedromorgan sorry for the late response! Just approved the run of the CI to check that the tests are passing (and seems like everything is green now 🎉 ) and now we will give this a more thoughtful review 👍 Just in case, after a quick check, looks like maybe the only couple of things I would say needs to be changed are:
Anyhow, I would check this locally too as part of the review and maybe then the things above could not be so interesting to do or maybe some other suggestions could appear. |
@dalthviz fixed the icon... Re columns, am using 30 across on a big screen.. the main reason I hacked in the first place.. |
Checked locally and actually I think the default columns number is okay 👍 However, the window minimum size is kind of big (at least for my screen) so probably we will need to reduce it a little bit. Locally I'm seeing: I will leave some suggestions as a review to change the minimum size and some other little nitpicks (like the clear icon and maybe using tooltips instead of the addition of the |
@dalthviz Done.. Fixed to minimum screen size ;-))))))))))))) |
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.
Thank you again @pedromorgan for the work here! Left some initial comments regarding the widgets properties, move the list with possible number of columns to be a constant and also a way to simplify the code to clear the filter line edit.
Probably the biggest change that I propose in this review is to drop the usage of the custom class ToolBarGroup
and just set tooltips for the different widgets, but let me know what do you think!
buttClear = QtWidgets.QToolButton() | ||
buttClear.setAutoRaise(True) | ||
buttClear.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) | ||
buttClear.setIcon(qtawesome.icon("mdi.alpha-x")) | ||
buttClear.clicked.connect(self._clearClicked) | ||
tbgFont.addWidget(buttClear) |
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.
Thinking about this, I think the clear button logic can be removed and instead we could use here the QLineEdit
setClearButtonEnabled
method: https://doc.qt.io/qt-6/qlineedit.html#clearButtonEnabled-prop
So adding a line for the _lineEditFilter
like:
self._lineEditFilter.setClearButtonEnabled(True)
Instead of the extra widget for the button. With this change you should be able to see something like:
tbcols = ToolBarGroup("Columns") | ||
toolbar.addWidget(tbcols) | ||
self._combo_cols = QtWidgets.QComboBox(self) | ||
for idx, no in enumerate([5, 8, 10, 15, 20, 25, 30]): |
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.
Lets move move this list with the possible values for the number of columns to a constant. Something like NUM_COLUMNS_OPTIONS = [5, 8, 10, 15, 20, 25, 30]
or maybe even NUM_COLUMNS_OPTIONS = [5, 10, 15, 20, 25, 30]
since now the the default is 5
|
||
self._nameField = QtWidgets.QLineEdit(self) | ||
self._nameField.setAlignment(QtCore.Qt.AlignCenter) | ||
self._nameField.setReadOnly(True) | ||
self._nameField.setFixedWidth(250) |
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.
Lets change this fixed width to be a maximum width so when resizing the window to the minimum size widgets don't overlap:
self._nameField.setFixedWidth(250) | |
self._nameField.setMaximumWidth(250) |
tbgFont.addWidget(self._comboFont) | ||
|
||
self._lineEditFilter = QtWidgets.QLineEdit(self) | ||
self._lineEditFilter.setFixedWidth(200) |
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.
Lets change this fixed width to be a maximum width so when resizing the window to the minimum size widgets don't overlap:
self._lineEditFilter.setFixedWidth(200) | |
self._lineEditFilter.setMaximumWidth(200) |
tbgFont = ToolBarGroup("Filter") | ||
toolbar.addWidget(tbgFont) | ||
self._comboFont = QtWidgets.QComboBox(self) | ||
self._comboFont.setFixedWidth(75) |
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.
Lets change this fixed width to be a maximum width so when resizing the window to the minimum size widgets don't overlap:
self._comboFont.setFixedWidth(75) | |
self._comboFont.setMaximumWidth(75) |
|
||
# selected group | ||
tbgSelected = ToolBarGroup("Selected") | ||
toolbar.addWidget(tbgSelected) |
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.
Lets add some stretch
here to enable the line edit to expand until reaching its maximum width when needed:
toolbar.addWidget(tbgSelected) | |
toolbar.addWidget(tbgSelected, stretch=10) |
|
||
# filter group | ||
tbgFont = ToolBarGroup("Filter") | ||
toolbar.addWidget(tbgFont) |
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.
Lets add some stretch here to enable the line edit to expand until reaching its maximum width when needed:
toolbar.addWidget(tbgFont) | |
toolbar.addWidget(tbgFont, stretch=10) |
@@ -260,6 +311,31 @@ def data(self, index, role): | |||
return super().data(index, role) | |||
|
|||
|
|||
class ToolBarGroup(QtWidgets.QWidget): |
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.
Regarding this custom widget to add titles, what do you think if instead we just add tooltips to the relevant widgets so people can check/understand what they do?
So for example for the line edit that filters the icons:
For the text for each element, it could be something like:
- Font combobox:
Select fonts prefix which icons will be included in the filtering
- Filter line edit:
Filter icons by name
- Selected icon line edit:
Full identifier of the currently selected icon
- Copy button:
Copy selected icon full identifier to the clipboard
- Theme combobox:
Select color palette for the icons and the icon browser
- Columns combobox:
Select number of columns the icons list is showing
""" | ||
Ensure the filter UX works | ||
What happens if a `penguin` |
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.
Lets rewrite this to:
What happens if a `penguin` | |
Ensure the filter UX works when searching for `penguin` |
|
||
def test_filter_fail(qtbot, browser): | ||
""" | ||
What happens if a `not a penguin-penguin` |
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.
Lets rewrite this to be:
What happens if a `not a penguin-penguin` | |
Ensure the filter doesn't show results if the filter text doesn't match any icon |
@pedromorgan, may I ask: why did you decide to close this pull request? We can help you finish it, if that's ok for you. |
Because I got better things to do than fix some review on code style etc. Also this is the first time in the discussion that a lot of the topics are brought up. The time spent doing the review, could have been spent fixing the code itself. So am not going to waste my time.. TA |
I understand your role now.. A pointless job..
AFAIK..
This explains a lot why foss project stall..
|
@dalthviz has spent more time revieing my code, that actually correct the errors within... There is a weed in the garden
|
I'm sorry @pedromorgan if the way I reviewed the PR frustated you. Just until yestarday I was able to make time to give a full review and it ended up having more changes/suggestions than I initially though. I still think that the work here is worthy to be finished and merged so if you are okay I can help finish the PR so it can be merged. Again, truly sorry if the review process was not what you expected to be. By no means I wanted you to feel bad or frustated with this PR. |
@derek-rein Why not just merge this, and go and fix it.. TIA.. ;-))))
Move faster please... and let ideas flow... Think more like a carpenter and wood rather than code.. |
Some
qta-browser
updates to make gui nicer.Hidden Motive