Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JFXTabPane cosmetic drawing bug with Windows scaling #728

Open
LightSnowDev opened this issue May 25, 2018 · 12 comments
Open

JFXTabPane cosmetic drawing bug with Windows scaling #728

LightSnowDev opened this issue May 25, 2018 · 12 comments
Labels
pinned Type: Bug HiDPI issue when running in HiDPI Type: Bug

Comments

@LightSnowDev
Copy link

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

@jfoenixadmin
Copy link
Collaborator

@LightSnowDev thanks for pointing out the issue 👍

@jfoenixadmin
Copy link
Collaborator

@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.

@LightSnowDev
Copy link
Author

LightSnowDev commented Jun 4, 2018

@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

@stale
Copy link

stale bot commented Jan 7, 2019

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.

@Ed1ks
Copy link

Ed1ks commented Aug 18, 2019

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

@bytecod3r
Copy link

I have the same problem, any fix for it?

@Rawtt
Copy link

Rawtt commented Feb 20, 2020

Bad, no one can fix this problem...

@govindashrit
Copy link

Yes fix required !! Any workaround

@pduy99
Copy link

pduy99 commented Aug 17, 2020

2 years and no fix :|

@4A-75-6E-69-6F-72
Copy link

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;
}

@varunborar
Copy link

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

@Wexalian
Copy link

I don't know if @sshahine will ever update this, but I think I was able to solve this on my own copy at this line by wrapping selectedTabLine.prefWidth(-1); with a call to snapSizeX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned Type: Bug HiDPI issue when running in HiDPI Type: Bug
Projects
None yet
Development

No branches or pull requests

10 participants