This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262833 - Code-Folding: Hovering over code should change the color instead the width
Summary: Code-Folding: Hovering over code should change the color instead the width
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: markiewb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-16 16:34 UTC by markiewb
Modified: 2016-08-03 22:04 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch (16.75 KB, patch)
2016-07-16 16:35 UTC, markiewb
Details | Diff
Screencast of patch in action using several light and dark editor themes (598.79 KB, image/gif)
2016-07-16 16:42 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2016-07-16 16:34:23 UTC
ACTUAL: When hovering over a code fold the lines/signs get thicker by 1 pixel. That looks strange.

EXPECTED: When hovering over a code fold the lines/signs are painted using a different color instead of thickening of the linewidth.
Comment 1 markiewb 2016-07-16 16:35:27 UTC
Created attachment 160409 [details]
Patch
Comment 2 markiewb 2016-07-16 16:42:24 UTC
Created attachment 160410 [details]
Screencast of patch in action using several light and dark editor themes
Comment 3 markiewb 2016-07-16 16:48:21 UTC
@Svata: Can you please review the patch, before I commit it. What do you think?

The patch removes the thickening of lines while hovering over a code fold. Instead of that the color is changed. The highlighting color is based on the code fold color, but brighter. If the color cannot be brightened up, then the it gets darkened - f.e. if the original color is white then the resulting color is gray. I also updated the old implementation org.netbeans.editor.CodeFoldingSideBar

See the attached screencast and give it a try. If there are no objections, I will integrate it next Wednesday.
Comment 4 Svata Dedic 2016-07-18 06:44:46 UTC
The reason why the line "thickens" is to emphasize the selected fold. Since the patch makes the color brighter, it gets just in the opposite way - yes, the selected fold changes color, which attracts user's attention, but the contrast lowers which may be confused with dimming unavailable controls. Agree that width change may not be the best way how to emphasize focused element.

I've briefly check eclipse and idea, and they both also increase visual weight of the presentation (eclipse: displays outline, idea: changes dotted line to solid )

But - why not do just the opposite: make the default color of folds less contrast, and change to full black on mouse hover ?

A question: is there a reason why to compute derived color and not use Fonts & Color settings ? An additional color can be defined and then customized in dark L&Fs.
Comment 5 markiewb 2016-07-18 21:10:59 UTC
(In reply to Svata Dedic from comment #4)

> But - why not do just the opposite: make the default color of folds less
> contrast, and change to full black on mouse hover ?

Yes, I can propose that.

> A question: is there a reason why to compute derived color and not use Fonts
> & Color settings ? An additional color can be defined and then customized in
> dark L&Fs.

I tried that too, but I had to change 3 or 4 additional modules to register the relevant settings. And in the end it did not work for me. So it was too much for me. When I get it done using the F&C-settings, I must also update all default-themes. So what would be the preferred color f.e. for the norway theme. The color is already a dark blue, so darkening the color would makes no sense for me. Brighten it up?
Comment 6 Svata Dedic 2016-08-02 05:20:33 UTC
An idea: would it be possible to provide _something_ like ColorModel for FontAndColor settings to derive default values for dark theme ? Then [all] colors would be suitably defined and where inappropriate, they could be overriden.
Comment 7 markiewb 2016-08-03 22:04:00 UTC
(In reply to Svata Dedic from comment #6)
> An idea: would it be possible to provide _something_ like ColorModel for
> FontAndColor settings to derive default values for dark theme ? Then [all]
> colors would be suitably defined and where inappropriate, they could be
> overriden.

So supporting the Fonts & Color settings is the way. Understood.

I will give it another try, when I am in the mood to figure out all the places, where I have to register the font color options.