Zoomicon / READCOM_App

READ-COM: Reading Communities App
MIT License
13 stars 5 forks source link

ColorPicker popups for foreground/background color close when trying to edit color value hex number #267

Open birbilis opened 2 years ago

birbilis commented 2 years ago

Version: 0.7.1

More advanced users may want to enter a color value directly or copy a value from one ColorPicker popup to another. However currently when the color picker's color value editbox takes focus it closes the color picker popup.

(Reported by @jasa611)

birbilis commented 2 years ago

there is a known issue with the FireMonkey UI library popups that causes it. They don't accept focus. Has been reported to the company that makes Delphi (Embarcadero). A workaround I had done in the past with the StoryItemOptions popup (when it contained the UrlAction as an editbox) is to open an input prompt dialog when the item is clicked and have code that updates its value if OK is pressed on the input dialog. I will look into doing that

birbilis commented 2 years ago

A workaround is to copy the item you want to take color from to clipboard, paste to notepad and copy the color value (if you don't know which value you want already) Then cut an other item to the clipboard, paste in notepad and edit its color value there (will need to set first a random color to it to see the property listed in the object definition) to be the same as the value you had gotten before The values are in ARGB format in hexadecimal (FF=255), Alpha is the "opacity" where FF is non-transparent and 0 fully transparent (no color shown). R=Reg, G=Green, B=Blue components of the color in RGB color model

image

birbilis commented 2 years ago

there is a colorconverter here: https://www.w3schools.com/colors/colors_converter.asp

note that Delphi uses "x" prefix for Hex, not "#" or "0x" that you may see in other languages like Javascript or C/C++

birbilis commented 2 years ago

there are also some colorpickers as apps (should be able to find on Windows Store for example I guess) and as browser extensions (e.g. for Chrome and for Firefox: https://www.colorzilla.com/)

birbilis commented 2 years ago

You can also do gradients if you set the Image (from its Options with the Load button) for a StoryItem to be a 1-pixel width or height image strip with the other dimension being say of N pixels (whatever the size you plan to make your StoryItem) or less/more. Since the image is stretched it will become a gradient (either horizontal or vertical gradient depending on which dimension of the background image was only 1-pixel long) Don't create linear gradient backgrounds in other way (e.g. with other program), it's an overkill (in filesize) to use a XY sized image when you can use a X1 or 1*Y sized one

birbilis commented 2 years ago

Could also possibly add CTRL+C (copy color value) and CTRL+V (paste color value) actions to the ColorPicker (or if it already has such make sure the app doesn't grab them while the color picker popup is shown. Combined with a tooltip that suggests their use (shown when mouse is over the color value editbox) might help. Also, should probably set HitTest=false to that color value editbox so that it doesn't close the ColorPicker popup when the user clicks in it