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

Search/filter placeholder text fix #4475

Closed

Conversation

paulj49457
Copy link
Contributor

@paulj49457 paulj49457 commented Apr 16, 2024

This PR fixes:

  • The placeholder text which disappears on dark themes now remains visible.

Screenshot 2024-04-16 201506

Screenshot 2024-04-16 201546

  • The red text is now displayed (and removed) when invalid filter text is entered.

Screenshot 2024-04-16 201724

Screenshot 2024-04-16 201634

  • The colour of the group-by menu has now been fixed, previously on Windows it appeared as:

Group-by menu

  • The backgrounds of the "Manage Filters" dialogue QLineEdit fields for the name, searchbox and filter list would pickup the theme (noticeable on dark themes) depending where they were launched from:

From the mainWindow Toolbar:

Screenshot 2024-05-19 182832

From the Trends, Manage Filters:

Screenshot 2024-05-19 184500

  • The "Manage Filters" option in the pull down menu has been removed from the "Manage Filters" dialogue, otherwise this just opens another instance of the dialogue for no benefit, and possible accidental filter overwrite problems.

  • Added a close button to the bottom right of the "Manage Filters" dialogue, hopefully preventing accidentally deleted filters.

  • Removed "column chooser" from the "Manage Filters" pull down, as the option is already available from the ride navigator menu, and IMHO it is more logically associated with that location, I can add it back if you want it retained.

I have tested the above with most dark & light themes on Windows and all seems to work, so can it be tested on Linux & MacOs ?

Note: All popup windows and dialogues do not respect the selected theme, and use a default light theme, this this was part of the problem of hidden text, I expect it would a significant project to get them to adopt the theme colours.

@paulj49457 paulj49457 changed the title Search placeholder text fix (+ latest changes to drop down menu) Search/filter placeholder text fix Apr 17, 2024
@marcenGC
Copy link

marcenGC commented May 7, 2024

I have tested the PR under Archlinux. One thing I noticed is that the red colour is not always reset.

  1. enter a wrong filter value that you see him in red.
  2. call up the Manage Filters and close it
  3. then delete the filter value with the X symbol
  4. now the newly entered text is also red if the value is correct.

Here is a short video. Unfortunately, the Manage Filters is not displayed.
https://github.com/GoldenCheetah/GoldenCheetah/assets/125665140/bd0d859d-976a-4d77-a401-64557d272740

@paulj49457
Copy link
Contributor Author

@marcenGC Thank you for testing the PR (and the video), I'll take another look to see why the red colour is not reset in this case.

@paulj49457
Copy link
Contributor Author

@marcenGC The problem you found is now fixed in the latest commit.

I'd used a couple of static parameters to limit the number of updates in the new setSearchBoxStyle() function, but opening the Manage Filters creates another instance of the SearchBox and this caused the update limit functionality to fail, they are now private member variables.

@marcenGC
Copy link

Thank you for the fix. It works fine now.

@paulj49457
Copy link
Contributor Author

This PR works on Windows & Archlinux, can someone test whether it works on MacOs ?

@amtriathlon
Copy link
Member

amtriathlon commented May 15, 2024

Yes, it seems to work on macOS too
OTOH, there is a problem using a dark theme when the SearchBox is used to setup a perspective/switch filter, after this change the filter text is invisible: white text on white background, this happens on Windows and Linux too.
I mean in this dialog: https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Tool-Bar_Functions#add-new-perspective-on-activities

@paulj49457
Copy link
Contributor Author

ok, I'll take a look why this is happening

@paulj49457
Copy link
Contributor Author

I have updated the PR description with the latest fixes, please test on Linux & MacOs, thanks.

@thejockl
Copy link
Contributor

Test on Debian with Qt5 here. Looks good to me with one minor exception: When switching the color-scheme having an active error in the filter, the red text turns to the default color

@paulj49457
Copy link
Contributor Author

Test on Debian with Qt5 here. Looks good to me with one minor exception: When switching the color-scheme having an active error in the filter, the red text turns to the default color

Thank you for testing, I hadn't tried that corner case :) I guess that'll be the configChanged not checking the parsing error state, I'll wait to see what else gets reported.

@amtriathlon
Copy link
Member

amtriathlon commented May 19, 2024

It is harder to see the latest changes if you force push... Anyway, I think this PR is becoming increasingly complex and difficult to check it doesn't generate other issues just to fix a non-functional barely noticeable cosmetic issue.
PS: I see the scope has changed and now encompass several unrelated issues in one monolithic commit including refactoring/ reformatting which goes against https://github.com/GoldenCheetah/GoldenCheetah/wiki/Guidelines-for-submitting-a-patch so I am closing this.

@paulj49457
Copy link
Contributor Author

@amtriathlon, I've now split up the most useful changes into smaller PRs, and I'll aim to keep future PR's focused on a single problem, and avoid any force pushing of changes.

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

Successfully merging this pull request may close these issues.

None yet

4 participants