GoldenCheetah icon indicating copy to clipboard operation
GoldenCheetah copied to clipboard

Search/filter placeholder text fix

Open paulj49457 opened this issue 2 years ago • 5 comments

This PR fixes:

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

Screenshot 2024-04-16 201506

Screenshot 2024-04-16 201546

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

Screenshot 2024-04-16 201724

Screenshot 2024-04-16 201634

paulj49457 avatar Apr 16 '24 17:04 paulj49457

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

marcenGC avatar May 07 '24 17:05 marcenGC

@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 avatar May 08 '24 06:05 paulj49457

@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.

paulj49457 avatar May 10 '24 06:05 paulj49457

Thank you for the fix. It works fine now.

marcenGC avatar May 10 '24 18:05 marcenGC

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

paulj49457 avatar May 14 '24 19:05 paulj49457

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

amtriathlon avatar May 15 '24 14:05 amtriathlon

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

paulj49457 avatar May 16 '24 06:05 paulj49457

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

paulj49457 avatar May 19 '24 17:05 paulj49457

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

thejockl avatar May 19 '24 18:05 thejockl

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.

paulj49457 avatar May 19 '24 18:05 paulj49457

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 avatar May 19 '24 23:05 amtriathlon

@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.

paulj49457 avatar May 20 '24 19:05 paulj49457