JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

JFXTabPane cosmetic drawing bug with Windows scaling

Open LightSnowDev opened this issue 6 years ago • 12 comments

The JFXTabPane does render incorrectly with scaling in Windows 10. The line underneath the individual tabs is bigger than the tab itself.

125% and 150% scaling: 1

With 100% scaling everything is as expected: 2

This does not break any features or similar. It's just a cosmetic thing.

My setup: Windows 10 1803 Oracle Java 10.0.1 JFoenix 9.0.4

LightSnowDev avatar May 25 '18 17:05 LightSnowDev

@LightSnowDev thanks for pointing out the issue 👍

jfoenixadmin avatar May 25 '18 20:05 jfoenixadmin

@LightSnowDev unfortounetly I wasn't able to reproduce the issue, I tried to change the scale to 125% , 150% however no luck in reproducing the issue.

jfoenixadmin avatar Jun 04 '18 08:06 jfoenixadmin

@jfoenixadmin I created the most simple project i could think of with IntelliJ IDEA. Just a fxml is being loaded. A controller is not used. Source code and the final jar as zip:

sample.zip generated jar.zip

image

LightSnowDev avatar Jun 04 '18 18:06 LightSnowDev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 07 '19 07:01 stale[bot]

I can confirm the bug. JavaFX 11.0.2 JFoenix 9.0.9 Windows 10 Pro Windows Scale: 125% Resolution: 2560 x 1440

It looks like, that the line is 125% long. screen

Ed1ks avatar Aug 18 '19 19:08 Ed1ks

I have the same problem, any fix for it?

bytecod3r avatar Oct 27 '19 06:10 bytecod3r

Bad, no one can fix this problem...

Rawtt avatar Feb 20 '20 12:02 Rawtt

Yes fix required !! Any workaround

govindashrit avatar Mar 06 '20 13:03 govindashrit

2 years and no fix :|

pduy99 avatar Aug 17 '20 14:08 pduy99

If you don't mind losing the animation of the line from the previous selected tab to the newly selected one, I got a work around for you!!! Hide the selected tab's line and add a border at the bottom. The CSS snippet below does just that. The CSS file containing this code should be added to the tabPane stylesheets.

//Hide default line of selected tab
.jfx-tab-pane:top .depth-container .tab-header-area .headers-region .tab-selected-line {
    -fx-background-color: transparent;
}

//Add border at the bottom of the selected tab
.jfx-tab-pane .tab:selected 
{
    -fx-border-width : 0 0 3 0;
//IInsert the color of the selected tab's line you wish to have
    -fx-border-color:  #d0d0d0;
}

4A-75-6E-69-6F-72 avatar May 03 '21 17:05 4A-75-6E-69-6F-72

A simple work around for this is,

.jfx-tab-pane .tab-selected-line { -fx-background-color: -fx-light-accent-color; -fx-scale-x: 75%; }

image

varunborar avatar Jun 18 '21 13:06 varunborar