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

PR: Use a better icon when no matches are found (Find/Replace widget) #20268

Merged
merged 2 commits into from
Dec 28, 2022

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Dec 27, 2022

Description of Changes

Issue(s) Resolved

Fixes #20255.

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

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

Thanks @ccordoba12 ! I think the new icon looks good. Also while checking this I got a traceback related to the findreplace code and the split editor/new window functionality:

Traceback (most recent call last):
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\plugins\editor\widgets\editor.py", line 2265, in focus_changed
    self.refresh()
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\plugins\editor\widgets\editor.py", line 2425, in refresh
    self.find_widget.set_editor(editor, refresh=False)
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\widgets\findreplace.py", line 452, in set_editor
    self.editor.textChanged.disconnect(self.update_matches)
RuntimeError: wrapped C/C++ object of type CodeEditor has been deleted
Traceback (most recent call last):
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\plugins\editor\widgets\editor.py", line 2219, in current_changed
    self.find_widget.set_editor(editor, refresh=False)
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\widgets\findreplace.py", line 452, in set_editor
    self.editor.textChanged.disconnect(self.update_matches)
RuntimeError: wrapped C/C++ object of type CodeEditor has been deleted
Traceback (most recent call last):
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\plugins\editor\widgets\editor.py", line 2265, in focus_changed
    self.refresh()
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\plugins\editor\widgets\editor.py", line 2425, in refresh
    self.find_widget.set_editor(editor, refresh=False)
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\widgets\findreplace.py", line 452, in set_editor
    self.editor.textChanged.disconnect(self.update_matches)
RuntimeError: wrapped C/C++ object of type CodeEditor has been deleted
Traceback (most recent call last):
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\plugins\editor\widgets\editor.py", line 2219, in current_changed
    self.find_widget.set_editor(editor, refresh=False)
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\widgets\findreplace.py", line 452, in set_editor
    self.editor.textChanged.disconnect(self.update_matches)
RuntimeError: wrapped C/C++ object of type CodeEditor has been deleted

Should that be solved in a different PR perhaps, maybe at #20221 ?

@ccordoba12
Copy link
Member Author

ccordoba12 commented Dec 27, 2022

Thanks @dalthviz for the review. I also encountered that problem and fixed it in PR #20221 because it was caught by one of the new tests I added there.

Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

LGTM overall, though could you maybe reduce the padding between the icon and the "clear field" (delete) button to about to half the current value? It looks rather strange currently and takes up more of the field's space than necessary. Thanks!

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

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

Thanks for the info @ccordoba12 , then this LGTM 👍

I will leave this approved but I think that @CAM-Gerlach comment makes sense too, so if it is possible/not to complicated maybe it could be worthy to try to do the change before merging this

@ccordoba12
Copy link
Member Author

LGTM overall, though could you maybe reduce the padding between the icon and the "clear field" (delete) button to about to half the current value?

As it's almost the case, it was not trivial to implement in Qt, but I managed to do it. See my original description for the updated screenshot.

@dalthviz, could you check that it looks ok on Windows and Mac? Thanks!

Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

LGTM, pending @dalthviz 's checks (I'm still on a trip right now visiting family, sorry)

@ccordoba12 ccordoba12 changed the title PR: Use a better icon when no matches were found (Find/Replace widget) PR: Use a better icon when no matches are found (Find/Replace widget) Dec 28, 2022
@dalthviz dalthviz merged commit 7a00975 into spyder-ide:5.x Dec 28, 2022
dalthviz added a commit that referenced this pull request Dec 28, 2022
@ccordoba12 ccordoba12 deleted the issue-20255 branch December 28, 2022 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants