Feature request — add style configurator for "completion box" content
- Lazarus/FPC Version: Lazarus 3.2 (rev lazarus_3_2) FPC 3.2.2 x86_64-win64-win32/win64
- Operating System: Windows 10, 64-bit
- CPU/Bitness: 64-bit
What happens
Currently, it is not possible to set colors and style for the content of the completion box, while hard-coded colors in some cases are simply ugly and do not match the style set for the code editor itself.
What did you expect
The style for the content of the completion box, both for completing identifiers and for inserting templates, should be settable in the IDE options window. Thanks to this, regardless of what style the user sets for the code editor, he will also be able to choose what the completion box window should look like, so that it is readable and matches the style of the code editor.
A few things to consider:
- Setting the style for the completion box should be in the IDE options window.
- Styles should be set independently for each file format, in the same way as is currently the case with styling for the source code itself.
- When setting the style for the completion box, an example completion box with content that will visualize the final effect should be displayed on the right (the same as when setting the style for SynEdit).
- It should be possible to set a style for:
- background of selected items (background style and item frame style, like in the case of SynEdit current line highlight),
- background of the selected items (same as above),
- a flag specifying whether to use one color for the entire selected item text (currently) or to use multiple colors for individual item columns (see the screenshot at the end: the selected item is normally colored and its background is set to match SynEdit current line style),
- individual labels in the left column (individual keywords separately),
- style of matched part for identifiers (currently the matched part is rendered in white),
- the completion box frame style (I would prefer the completion box to have no border).
When it comes to setting the style for a completion box element, I mean not only the color, but also the border style, alpha channel and other parameters that can currently be set in the case of the SynEdit element style.
The contents of the right column of the completion box, i.e. the one containing the IDs, can still be rendered using the current colors used in SynEdit. These lines may contain e.g. entire function declarations, containing identifiers, special characters, literals, operators, etc., and the colors of these elements would be good to be able to set.
I myself am a supporter of being able to determine the style of each possible element separately, because it gives the user complete freedom. By default, the SynEdit style itself should be used for completion box components, so if someone does not want to define a custom style for completion box, the IDE will use the currently set SynEdit styles and colors (less work to implement the configurator).
Example of customized completion box
I played around with the code for rendering the content of the completion box and now I can do quite a lot with this box. There is no problem to set the style for individual keywords in the left column, or to use multiple colors to render the contents of the right column of the selected item: