Giter Club home page Giter Club logo

Comments (4)

dukke avatar dukke commented on July 18, 2024

A quick way to do this might be to add the modena stylesheet first when applying the JMetro theme. And then after add the JMetro stylesheets.

from jfxtras-styles.

dukke avatar dukke commented on July 18, 2024

I think maybe this should also be a setting: enable/disable JMetro as an user agent stylesheet.

from jfxtras-styles.

runiter avatar runiter commented on July 18, 2024

Isn't this as simple as copying everything from moderna.css to jmetro.css and then call this method?

Application.setUserAgentStylesheet("jmetro.css");

There is just one minor problem that this public method cannot accept multiple css files, so all the jmetro css files need to be combined into a single css file.

from jfxtras-styles.

dukke avatar dukke commented on July 18, 2024

Hi @runiter

You've answered yourself 🙂

Not so simple as setUserAgentStylesheet only accepts 1 stylesheet and JMetro has various stylesheets.
The best way would be to convince the JavaFX team to add API so that you can provide more than 1 stylesheet to be used as a userAgentStylesheet.

Combining JMetro into a single stylesheet has these disadvantages:
1 - maintenance problem. You would have 1 huge stylesheet with thousands of lines. It's already an issue as it is now, and this would make it much more problematic.
2 - Dark and Light style definitions are defined in 2 separate stylesheets which are added/removed according to what style you choose (Dark or Light)

Possible solutions:
1 - Possibly have a gradle task that copies everything into a single stylesheet before compiling/releasing
2 - Have all definitions in a single stylesheet (which would be maintenance problem as I already explained) and just the variables for dark or light style be defined in a Scene stylesheet

None of these solutions would be ideal. The best, I think, as I said, would be for JavaFX to have an API that supports setting more than 1 stylesheet as user agent stylesheets.

Thanks!

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.