Comments (11)
@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.
Please see the comparison between default theme & JMetro in screenshot:
There are 2 problems:
- 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)));
- The selected row in table does not highlighted with other color in JMetro.
from jfxtras-styles.
The text in table cell not display completely even though ...
@len-ny as i understand you about it?
from jfxtras-styles.
Yes thats what i mean.
from jfxtras-styles.
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.
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.
@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.
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.
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.
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
.
For the alerts, I copy the Dialogs css and images of modena and it's works perfectly.
- Clément
from jfxtras-styles.
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)
- Button, ToggleButton - Button does not show border on hover when it is focused HOT 1
- Maven Central Repository Does Not Install Correctly HOT 2
- TextField - TextField with "glitched" background when disabled and inside Dialog
- TextFields - Non-Editable TextFields shouldn't have a 'clear' button HOT 2
- Exception "Failed to load skin 'impl.jfxtras.labs.internal.scene.control.skin.ListSpinnerCaspianSkin'" HOT 2
- JMetro NPE when getOverridingStylesheets().add(source). Should throw instructive exception HOT 2
- JMetro: NoSuchMethodError with no code written HOT 16
- DatePicker - changes height when focused HOT 2
- Spurious classifier tags in dependencies in pom.xml HOT 3
- Style a WebView Web Page using JMetro Theme Style HOT 1
- JMetro: JavaFX 16 JDK17 NullPointerException HOT 3
- Some suggestions of Jmetro on Windows 11 HOT 1
- TreeView, TableView, ListView, TreeTableView - not sure if we need styles for pressed:selected and pressed
- New windows ui (winui3) implement HOT 1
- ProgressBar - Switching from indeterminate, to real and finally back to indeterminate doesn't animate
- Charts lose tick label color after applying jmetro HOT 6
- Scrollpane shrink contents when focused
- Wrong Spinner text color inside TabPane HOT 5
- JFXCentral Badge
- The setFill for the Text component does not execute correctly HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jfxtras-styles.