Package com.formdev.flatlaf.ui
Class FlatWindowsNativeWindowBorder
java.lang.Object
com.formdev.flatlaf.ui.FlatWindowsNativeWindowBorder
- All Implemented Interfaces:
FlatNativeWindowBorder.Provider
Native window border support for Windows 10 when using custom decorations.
If the application wants to use custom decorations, the Windows 10 title bar is hidden (including minimize, maximize and close buttons), but not the resize borders (including drop shadow). Windows 10 window snapping functionality will remain unaffected: https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241
- Since:
- 1.1
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Color
private boolean
private int
private boolean
private Timer
private static FlatWindowsNativeWindowBorder
private final EventListenerList
private final Map
<Window, FlatWindowsNativeWindowBorder.WndProc> Fields inherited from interface com.formdev.flatlaf.ui.FlatNativeWindowBorder.Provider
SW_MAXIMIZE, SW_MINIMIZE, SW_RESTORE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
private static Rectangle
cloneRectange
(Rectangle rect) private void
(package private) void
Because there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages, slightly delay event firing and fire it only once (on the AWT thread).int
(package private) static FlatNativeWindowBorder.Provider
boolean
hasCustomDecoration
(Window window) private void
boolean
private static int
registryGetIntValue
(String key, String valueName, int defaultValue) void
void
setHasCustomDecoration
(Window window, boolean hasCustomDecoration) Tell the window whether the application wants to use custom decorations.boolean
showWindow
(Window window, int cmd) private void
private void
void
updateTitleBarInfo
(Window window, int titleBarHeight, Predicate<Point> captionHitTestCallback, Rectangle appIconBounds, Rectangle minimizeButtonBounds, Rectangle maximizeButtonBounds, Rectangle closeButtonBounds)
-
Field Details
-
windowsMap
-
listenerList
-
fireStateChangedTimer
-
colorizationUpToDate
private boolean colorizationUpToDate -
colorizationColorAffectsBorders
private boolean colorizationColorAffectsBorders -
colorizationColor
-
colorizationColorBalance
private int colorizationColorBalance -
instance
-
-
Constructor Details
-
FlatWindowsNativeWindowBorder
private FlatWindowsNativeWindowBorder()
-
-
Method Details
-
getInstance
-
hasCustomDecoration
- Specified by:
hasCustomDecoration
in interfaceFlatNativeWindowBorder.Provider
-
setHasCustomDecoration
Tell the window whether the application wants to use custom decorations. Iftrue
, the Windows 10 title bar is hidden (including minimize, maximize and close buttons), but not the resize borders (including drop shadow).- Specified by:
setHasCustomDecoration
in interfaceFlatNativeWindowBorder.Provider
-
install
-
uninstall
-
updateTitleBarInfo
public void updateTitleBarInfo(Window window, int titleBarHeight, Predicate<Point> captionHitTestCallback, Rectangle appIconBounds, Rectangle minimizeButtonBounds, Rectangle maximizeButtonBounds, Rectangle closeButtonBounds) - Specified by:
updateTitleBarInfo
in interfaceFlatNativeWindowBorder.Provider
-
cloneRectange
-
showWindow
- Specified by:
showWindow
in interfaceFlatNativeWindowBorder.Provider
-
isColorizationColorAffectsBorders
public boolean isColorizationColorAffectsBorders()- Specified by:
isColorizationColorAffectsBorders
in interfaceFlatNativeWindowBorder.Provider
-
getColorizationColor
- Specified by:
getColorizationColor
in interfaceFlatNativeWindowBorder.Provider
-
getColorizationColorBalance
public int getColorizationColorBalance()- Specified by:
getColorizationColorBalance
in interfaceFlatNativeWindowBorder.Provider
-
updateColorization
private void updateColorization() -
registryGetIntValue
-
addChangeListener
- Specified by:
addChangeListener
in interfaceFlatNativeWindowBorder.Provider
-
removeChangeListener
- Specified by:
removeChangeListener
in interfaceFlatNativeWindowBorder.Provider
-
fireStateChanged
private void fireStateChanged() -
fireStateChangedLaterOnce
void fireStateChangedLaterOnce()Because there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages, slightly delay event firing and fire it only once (on the AWT thread).
-