Another release of JMetro has just came out.
This time the focus has been on fixing bugs and tweaking existing styles. A bunch of these have been fixed in this release.
Besides this, a new feature has been added. It is now also possible to easily add grid lines on table like controls.
Keep on reading for details.
Adding gridlines to Table like controls
On table like controls you already had the ability to easily add alternating row colors. This was easily set by adding the JMetroStyleClass.ALTERNATING_ROW_COLORS
style class to any control with cells. With this turned on, information dense controls become easier to scan because it becomes easier to distinguish between different rows.
On this new release it is now also possible to add grid lines to columns, thus making information dense table like controls even easier to read. To set this, all that’s needed is to add the JMetroStyleClass.TABLE_GRID_LINES
style class to Tables or TreeTables.
The pictures above show examples of using and not using this new style class. In these examples there isn’t much to gain in adding gridlines and alternating row colors but if the table/treetable has lots of data to show (e.g. a considerable number of columns, etc) the difference in ease of scanning will be greater.
Complete list of tweaks and fixes
- Fixes #143: Panes – Check warnings when running PanesWithBackgroundStyleClassSample
- Fixes #91: Label – move label in light stylesheet to the same place as dark stylesheet
- Fixes #131: ScrollPane – Fix control’s that use a ScrollPane like control inside and whose corners appear wrong on Dark theme
- Issue #137: Spinner – some buttons are slightly misaligned when using some styleclasses
- Fixes #137: Spinner – tweak colors for hover and pressed of decrement/increment button
- Fixes #94: ListView – style unfilled cells differently
- Fixes #156: ListView – ListCell hover background color with selected item is invalid
- Fixes #157: JMetro Alert – Expandable content “Expand all” Label stay in dark when the style is dark
- Fixes #158: JMetro TextInputDialog – TextField has a black background and a black font-color in Dark Style
- Fixes #159: ListView – Odd row hover effects issue when “alternating row colors” style is applied and ListView has focus
- Fixes #160: ListView, TreeTableView – Should have hover effects on cells even when not focused
- Fixes #148: TextField, PasswordField – TextFields in VBox expand outside of scene if window is resized
- Issue #148: TextField, PasswordField – Add TextField and PasswordField shrink glitch test
- Fixes #164: SplitMenuButton – Tweak hover effect when SplitMenuButton is inside a Toolbar
- Fixes #165: TableView, TreeTableView – Add the ability to set column gridlines on Tables
- TreeTableView – Make bottom border of TreeTableView header slightly darker when column grid lines are enabled
- Issue #170: TreeTableView – Sort arrow isn’t showing on secondary column
- Fixes #166: ToggleSwitch – thumbs moves out of control bounds
- Fixes #166: ToggleSwitch – further optimize css and further clean up ToggleSwitchSkin class
- Deprecate JMetro automaticallyColorPanes property
- Fixes #168: TableView, TreeTableView – Have gridlines in table headers too when column grid line styleclass is present
- Issue #168: TableView, TreeTableView – Update CSS based on changes made in 11 branch to fix header grid line issues
- Fixes #171: TextField – Wrong color when not focused and in DARK Style
- Fixes #172: TreeTableView – Collapse/Expand arrow color is wrong on DARK Style
Further changes
The property automaticallyColorPanes of JMetro class has been deprecated and will be removed on a later version.
Programmers are advised to use JMetroStyleClass.BACKGROUND
instead. Add it to the styleclass list of Panes that are supposed to be a background and consequently should change their color depending on whether JMetro LIGHT Style
or DARK
is being used.
For other planned issues, as usual, check out the issue tracker on Github.
Thanks for the great work! Does JMetro support dark-theme title bars? Looks like Java a whole doesn’t support dark-theme title bars. I was wondering if JMetro has custom title bars that can support dark-theme?
Hi Saeid,
Thanks!
That’s a good point. No JMetro doesn’t support dark theme title bars, nor does JavaFX have API for that.
That’s something I’ve never actually thought about, but I guess you’d have to create a JavaFX frameless window and create your own title bar along with the window buttons..
Something to think about.. perhaps, potentially could be a future addition to JMetro but first would be required to create a custom component: a window with custom frame and window buttons.
Cheers
Indeed, seems like using frameless window and creating custom titlebar is the way to go.
I found a few JDK tickets about supporting dark-mode for Java titlebars. It doesn’t seem like they will actually address those tickets anytime soon though. But even if they do, they are planning to inherit dark-mode flag from system. So if I use JMetro dark-mode but the system is in light-mode, it would still show light-mode.
If you do end up making a custom titlebar, it would be great if you also add an option to include menu bars in the titlebar (like Intellij).