Closed kailiu42 closed 1 year ago
Thanks, it can't be a coincidence that it's every 2nd row.
This was reported here, and your fix @xavery would also fix the issue on the upstream project. As described here, it has something to do with when day/night mode switch — the app does not notice. https://github.com/transmission-remote-gui/transgui/issues/1366
Also in Dark Mode, hyperlink color is almost unreadable at night.
Originally posted by @wayward-turnip in https://github.com/transmission-remote-gui/transgui/issues/1366#issuecomment-801550193
The colour used to draw even-numbered rows is called AlternateColor
in Lazarus' TGrid
classes, and transgui sets it for (almost) all grids used in the program inside TMainForm.FormCreate
:
gTorrents.AlternateColor:=FAlterColor;
lvPeers.AlternateColor:=FAlterColor;
lvTrackers.AlternateColor:=FAlterColor;
gStats.AlternateColor:=FAlterColor;
The problem is that TMainForm.FormCreate
is only called once so this value remains the same throughout the whole program, without taking into account any potential dark/light theme changes.
There is a solution available which gets a "theme changed" notification straight from the OS so it sounds like it's going to be possible to set those colours to new theme-appropriate values.
Dark/light theme transitions should be now fixed. Hyperlinks now use a lighter shade of blue in dark mode which is much more readable :
The latest build from master incorporates these changes : https://github.com/xavery/transgui/suites/17484835100/artifacts/999179257
The torrent list view is OK with the latest build now. However the downloaded progress bar in the general panel still has problem.
The bar after switched from dark to light:
The bar after restarted transgui, which should be the correct color:
Thanks @kailiu42 , great catch.
The progress bar uses a custom drawing procedure which needs the data from the currently selected torrent. This means that the colour change will be a bit delayed to the app's theme change but will happen eventually (depending on your refresh interval) :
https://github.com/xavery/transgui/assets/127875/594397aa-c099-4805-ba20-d5673538a56a
I'm sure there's a way to call this procedure from the theme change callback but I kept getting weird crashes that I couldn't figure out.
These changes are available in https://github.com/xavery/transgui/suites/17499778981/artifacts/999844573.
It works now. Thanks a lot @xavery for your great help!
Some UI element remains dark background after the OS switched from dark to light mode, make the text unreadable and the UI look strange. Would you please take a look?