mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
support running on WinPE (issue #279)
This commit is contained in:
@@ -8,6 +8,7 @@ FlatLaf Change Log
|
|||||||
- Native window decorations: Support disabling native window decorations per
|
- Native window decorations: Support disabling native window decorations per
|
||||||
window. (set client property `JRootPane.useWindowDecorations` to `false` on
|
window. (set client property `JRootPane.useWindowDecorations` to `false` on
|
||||||
root pane).
|
root pane).
|
||||||
|
- Support running on WinPE. (issue #279)
|
||||||
|
|
||||||
#### Fixed bugs
|
#### Fixed bugs
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public abstract class FlatLaf
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean getSupportsWindowDecorations() {
|
public boolean getSupportsWindowDecorations() {
|
||||||
if( SystemInfo.isProjector )
|
if( SystemInfo.isProjector || SystemInfo.isWinPE )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( SystemInfo.isWindows_10_orLater &&
|
if( SystemInfo.isWindows_10_orLater &&
|
||||||
@@ -443,7 +443,10 @@ public abstract class FlatLaf
|
|||||||
FontUIResource uiFont = null;
|
FontUIResource uiFont = null;
|
||||||
|
|
||||||
if( SystemInfo.isWindows ) {
|
if( SystemInfo.isWindows ) {
|
||||||
Font winFont = (Font) Toolkit.getDefaultToolkit().getDesktopProperty( "win.messagebox.font" );
|
// on WinPE use "win.defaultGUI.font", which is usually Tahoma,
|
||||||
|
// because Segoe UI font is not available on WinPE
|
||||||
|
Font winFont = (Font) Toolkit.getDefaultToolkit().getDesktopProperty(
|
||||||
|
SystemInfo.isWinPE ? "win.defaultGUI.font" : "win.messagebox.font" );
|
||||||
if( winFont != null )
|
if( winFont != null )
|
||||||
uiFont = createCompositeFont( winFont.getFamily(), winFont.getStyle(), winFont.getSize() );
|
uiFont = createCompositeFont( winFont.getFamily(), winFont.getStyle(), winFont.getSize() );
|
||||||
|
|
||||||
|
|||||||
@@ -242,8 +242,8 @@ public class FlatNativeWindowBorder
|
|||||||
if( !SystemInfo.isWindows_10_orLater )
|
if( !SystemInfo.isWindows_10_orLater )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// do not use when running in JetBrains Projector
|
// do not use when running in JetBrains Projector or WinPE
|
||||||
if( SystemInfo.isProjector )
|
if( SystemInfo.isProjector || SystemInfo.isWinPE )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// check whether disabled via system property
|
// check whether disabled via system property
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class SystemInfo
|
|||||||
|
|
||||||
// other
|
// other
|
||||||
/** @since 1.1 */ public static final boolean isProjector;
|
/** @since 1.1 */ public static final boolean isProjector;
|
||||||
|
/** @since 1.1.1 */ public static final boolean isWinPE;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// platforms
|
// platforms
|
||||||
@@ -91,6 +92,7 @@ public class SystemInfo
|
|||||||
|
|
||||||
// other
|
// other
|
||||||
isProjector = Boolean.getBoolean( "org.jetbrains.projector.server.enable" );
|
isProjector = Boolean.getBoolean( "org.jetbrains.projector.server.enable" );
|
||||||
|
isWinPE = isWindows && "X:\\Windows\\System32".equalsIgnoreCase( System.getProperty( "user.dir" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long scanVersion( String version ) {
|
public static long scanVersion( String version ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user