Skip to content

Support for Modules, Windows 11 and more

Compare
Choose a tag to compare
@weisJ weisJ released this 01 Aug 17:42
· 402 commits to master since this release

Version 3.0.0 enables proper module support by providing a module-info.java for each module.
Note that this release brings some breaking changes as packages have been moved to resolve issues with split packages:

  • In darklaf-property-loader the top level package is now com.github.weisj.darklaf.properties. In particular this affects PropertyLoader, IconLoader and the various (svg)icon classes.
  • com.github.weisj.darklaf.color.DarkColorModel* in darklaf-utils has been moved to com.github.weisj.darklaf.color in darklaf-property-loader
  • Most functions which return/receive an IconLoader now return IconResolver instead.
  • com.github.weisj.darklaf.color.ColorUtil in darklaf-utils has been moved to com.github.weisj.darklaf.util
  • com.github.weisj.darklaf.util in darklaf-core has been moved to com.github.weisj.darklaf.ui.util
  • com.github.weisj.darklaf.platform in darklaf-native-util has been renamed to com.github.weisj.darklaf.nativeutil
  • All icons have moved into the darklaf-iconset project. If you need to use them you can depend on darklaf-iconset and use the IconSet.ICON_LOADER to retrieve them.

New modules

darklaf-iconset

Provides a set of icons optimized for darklaf. They can also be used with other LaFs without any further setup. If you wish to customize the colors used for the icons you have to provide the colors defined in https://github.com/weisJ/darklaf/blob/master/theme/src/main/resources/com/github/weisj/darklaf/theme/icon_presets/light_icons.properties through the UIDefaults in UIManager.

Icons can be conveniently accessed through the AllIcons class.

darklaf-platform-preferences

A module which exposed the native theme detection mechanism as a standalone dependency. It can be used without having to use darklaf itself. Simply create a new SystemPreferencesManager and start listening for changes to the OS theme.

darklaf-platform-decorations

A module which exposed the native decorations feature of darklaf as a standalone dependency. It should be compatible with almost all other laf implementations (mileage may vary). The responsible class is ExternalLafDecorator. By default the implementation tries to derive sensible colors based on other LaF properties. If you want to customize the appearance of the titlebar you can do so by providing a DecorationsColorProvider.
See the discussion in #316 for more informations and use cases.

Contributions

Visual changes

  • An JInternalPane outside of a JDesktopPane no longer has a shadow. 4537a68
  • Improved rendering of JSpinner and JComboBox inside a popup menu. 84fceaf
  • The "smaller" and "larger" text in the ThemeSettings are now represented by apropriate icons. #269 c6a3637
  • On Windows 11 rounded scrollbars will be used by default. 4c28099
  • Updated window button icons on Windows 11 to match the native look. 7197d08
  • The border radius of tooltips has been increased on macOS and Windows 11. 212b006
  • #306 On macOS and Windows 11 root panes no longer have borders by default, because they look out of place. 3180dfb

Behavioural changes

  • A JPopupMenu which has no menu items will no longer be displayed. b72f069
  • Improved resizing behaviour on Windwos which custom decorations enabled. c190762 8539c5e
  • Support for snap layouts on Windows 11 (Still has some caveats #311).

API Changes

  • Colors now need to be declared using a # in a .properties file when loaded through PropertyLoader. (Not using # was deprecated before). 1f6eb6e
  • Fallback value declarations in svg icons nowuse a % prefix instead of #. c43cbbc
  • FileTree and corresponding classes have been removed (were deprecated before). 425289e
  • Boolean client properties defined by the theme can now be overwritten. 48b5630
  • The Animator class API has been overhauled to be friendlier to use. 56dcca7
  • Added PanelPopup#addButton to easily add a button the the title bar of a JTrabFrame tab.
  • Added ScrollBarConstants.KEY_BACKGROUND_PAINTER property to provide the means to paint behind a scrollbar e.g. for search highlighting. The value has to be of type SizedPainter<JScrollBar>. See https://github.com/weisJ/darklaf/blob/d7d08139ab6d56a11d0c9a3c61ed73e0d1564510/core/src/test/java/com/github/weisj/darklaf/ui/scrollPane/OverlayRSyntaxScrollPane.java for an example. e9a3502
  • Added FontPrototpye to Theme to specify a prototype font which all default fonts will be based off of. See #303 for more information. This can also be changed through the ThemeSettings class.

Other changes

  • Prevent recursive laf installation. 8f8194e
  • The IconLoader will now release resources if the loaded icon is no longer used anywhere. 126670c
  • The backing implementation for svg icons has been moved to JSVG. Previously svgSalamander has been used. This improves the performance for icons which frequently change color values during runtime.
  • Improved code-singing experience on macOS.
  • Improved compatibility on macOS arm.

Addressed issues

  • Possible ConcurrentModificationException while theme events are dispatched. a9ae43f 85e556f
  • Incorrect selection foreground color in OneDark theme. e3a855c
  • #259 Arrow of disabled menu doesn't look disabled. e68f78e
  • #260 Disabled menu doesn't get painted with disabled text. 45abd4a
  • Adding the menu bar to a different component when the unified menu bar is enabled (Windows only) it becomes invisible. 7369248
  • JInternalFrame outside of JDesktopPane always appears selected. e48f23d
  • #314 NPE when using ScrollPopupMenu. d99c8a2
  • Table may use incorrect cell editor. 42d9476
  • Tooltip shadow is sometimes painted more than once resulting in a darker shadow. 7d6a354
  • With custom decorations enabled popups can be resized on Windows when they shouldn't. 812bf63
  • #275 NPE when uninstalling and a tree is currently being collapsed/expanded. c7ddc1d
  • #274 Black tooltip shadow on Linux and Java 8. 4904d3c
  • #268 System settings are overwritten by settings of ThemeSettings dialog. 32158fe
  • #289 Missing translations when using Java >= 9. e9625ce
  • Window bounds might change when installing/uninstalling decorations on macOS. 378b6f1 af82ec0
  • #298 Tooltips may show an incorrect background color. ff44d37 2ef0cb7
  • The ThemeSettings dialog doesn't reliably respond to changes in locale. 34f3815
  • Custom title bar on Windows uses incorrect font. 3639369
  • Combo box uses incorrect background color in some focus/selection combinations. f9e35e6

A big thank you to everyone who contributed, reported bug or requested features!