Search/filter placeholder text fix
This PR fixes:
- The placeholder text which disappears on dark themes now remains visible.
- The red text is now displayed (and removed) when invalid filter text is entered.
I have tested the PR under Archlinux. One thing I noticed is that the red colour is not always reset.
- enter a wrong filter value that you see him in red.
- call up the Manage Filters and close it
- then delete the filter value with the X symbol
- 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
@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.
@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.
Thank you for the fix. It works fine now.
This PR works on Windows & Archlinux, can someone test whether it works on MacOs ?
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
ok, I'll take a look why this is happening
I have updated the PR description with the latest fixes, please test on Linux & MacOs, thanks.
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
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.
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.
@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.