Giter Club home page Giter Club logo

Comments (11)

MairwunNx avatar MairwunNx commented on July 18, 2024

@len-ny Hi! Font size is used according to Fluent Design Language specifications. Please skip the screenshot so that I could see where it is big there, in any case you can redefine the style and make your own font size.

from jfxtras-styles.

len-ny avatar len-ny commented on July 18, 2024

Please see the comparison between default theme & JMetro in screenshot:
screen

There are 2 problems:

  1. The text in table cell not display completely even though I reduced the size using :
    root.styleProperty().bind(Bindings.format("-fx-font-size: %.2fpt", new SimpleDoubleProperty(8)));
  2. The selected row in table does not highlighted with other color in JMetro.

from jfxtras-styles.

MairwunNx avatar MairwunNx commented on July 18, 2024

The text in table cell not display completely even though ...

@len-ny as i understand you about it?
image

from jfxtras-styles.

len-ny avatar len-ny commented on July 18, 2024

Yes thats what i mean.

from jfxtras-styles.

MairwunNx avatar MairwunNx commented on July 18, 2024

Yes thats what i mean

@len-ny try change padding, set 0 to right \ left. Maybe it can help you.

The selected row in table does not highlighted with other color in JMetro.

Ok, i'll check it. This is the wrong behavior, I remember how I did highlight the rows, maybe this is my problem or the problem of Pedro.

If your application is open source, can you give me link on repo, i see it.

from jfxtras-styles.

dukke avatar dukke commented on July 18, 2024

The table still needs to get some changes, namely, we added a new TreeTableView style that's a bit different from the current TableView style. So it's in the pipeline to change TableView style and make it more inline with TreeTableView style.

For changing the font size of rows, columns in TableView better do it in the tableview and not at the root level.
I would advise that you add your own stylesheet after applying JMetro style (it's important that you only apply your stylesheet after applying JMetro). In your stylesheet you should set the size of text, cell padding, etc in table that you desire. This will override those JMetro styles.

You should look at modena.css and javafx css 8 specification to get more acquainted on how you should create that stylesheet and how you can change the styles that you want.

from jfxtras-styles.

dukke avatar dukke commented on July 18, 2024

@len-ny Font size of all controls has been reduced.
I'm going to close this issue, please comment if you still feel the issue hasn't been fixed.

from jfxtras-styles.

ClementGre avatar ClementGre commented on July 18, 2024

Hello,
I have the same issue on my software PDF4Teachers, when I hover labels or when I select a ListView cell who contains Labels.
I have the same issue when I select a TextField : all labels's sizes of the Stage change.
To define Labels font, I use setStyle() or setFont() methods. I have defined the JMetro style before defined the style or font.

May be I should use a css file ? Or I can disable the JMetro Theme for the Labels ?

Here is a vidéo to show you my issue :
https://tntgun.fr/img/api/drop/video_issue_jmetro.mp4

I got this issue with the version 11.6 of JMetro.
I also wish disable the JMetro theme on the JavaFX Alert but keep the theme on the buttons of the alert dialog.
I would like to be able to disable the theme on some JavaFX components like labels and Alert pane. It is possible to implement this in a next version ?

Thanks for reading me
- Clément G.

from jfxtras-styles.

dukke avatar dukke commented on July 18, 2024

Hi Clement,

This issue was actually because the user wanted to have the text size be smaller by default. So your problem is a different one.

I'm not sure what's happening. If you try to run the ThemeTester sample on the Samples subproject inside the jfxtras-styles code, that doesn't happen.

Can you provide a small test app that has that problem and that I can quickly run and reproduce it, please? It could also happen that while your doing it you find out that there's actually something you need to change in your code (or not ,or it could actually be a JMetro problem).

About your questions:

  • you could use setStyle, though perhaps having your own stylesheet might be easier to maintain. Add it using the method getOverridingStylesheets() which returns an observableList where you can add your stylesheet. setFont will probably not work since user agent stylesheets (which is what JMetro provides) have higher precedence than settings set through code.
  • JMetro has a setParent() method that allows you to set JMetro style to only be applied on that Parent and all its children.
    Alternatively in your own custom stylesheet you could specify custom styles for your Alert and Labels which override the ones set by JMetro. In this case make sure your CSS styles have higher or equal specificity than the ones that JMetro provides so that they are in fact applied (google CSS specificity and check out JMetro's base.css which has most of the style definitions).

Thanks

from jfxtras-styles.

ClementGre avatar ClementGre commented on July 18, 2024

Hi,

Sorry, I realize that this is not the same issue to late 😢

This is not a bug of JMetro, it's only that we can't use setFont, and some others JavaFX methods.
When I use the setStyle method, i don't have this issue !
This is probably due to this, explaned in the JMetro presentation web page.

JMetro doesn’t work like Modena, in the sense that it isn’t a User Agent Stylesheet. At least for now. There is already an issue in the issue tracker to convert it into an User Agent Stylesheet.

If i want to switch to JMetro 6.11.6, i will need to do multiples refractor since I used mainly setFont and setFill to define label's colors and font.

I find a solution to remove the JMetro style to a component, we can create a class who extends the component and the style will not be applied. This work's only with the Text since in css, we use Text and not .text.
image

For the alerts, I copy the Dialogs css and images of modena and it's works perfectly.
- Clément

from jfxtras-styles.

dukke avatar dukke commented on July 18, 2024

Yeah that's it.

User Agent Stylesheets have higher priority than styles set through code. Inline styles: setStyle(...) have the biggest priority of all.

Usually what I like to do is create my own stylesheet and add it through JMetro getOverridingStylesheets() method and I make sure my rule has at least the same level of specificity. In there I have my own custom styles and also other styles where I want to override the ones from JMetro.

from jfxtras-styles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.