support running on WinPE (issue #279)

This commit is contained in:
Karl Tauber
2021-03-26 21:51:11 +01:00
parent a143e5777c
commit f801d61929
4 changed files with 10 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ FlatLaf Change Log
- Native window decorations: Support disabling native window decorations per
window. (set client property `JRootPane.useWindowDecorations` to `false` on
root pane).
- Support running on WinPE. (issue #279)
#### Fixed bugs

View File

@@ -157,7 +157,7 @@ public abstract class FlatLaf
*/
@Override
public boolean getSupportsWindowDecorations() {
if( SystemInfo.isProjector )
if( SystemInfo.isProjector || SystemInfo.isWinPE )
return false;
if( SystemInfo.isWindows_10_orLater &&
@@ -443,7 +443,10 @@ public abstract class FlatLaf
FontUIResource uiFont = null;
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 )
uiFont = createCompositeFont( winFont.getFamily(), winFont.getStyle(), winFont.getSize() );

View File

@@ -242,8 +242,8 @@ public class FlatNativeWindowBorder
if( !SystemInfo.isWindows_10_orLater )
return;
// do not use when running in JetBrains Projector
if( SystemInfo.isProjector )
// do not use when running in JetBrains Projector or WinPE
if( SystemInfo.isProjector || SystemInfo.isWinPE )
return;
// check whether disabled via system property

View File

@@ -56,6 +56,7 @@ public class SystemInfo
// other
/** @since 1.1 */ public static final boolean isProjector;
/** @since 1.1.1 */ public static final boolean isWinPE;
static {
// platforms
@@ -91,6 +92,7 @@ public class SystemInfo
// other
isProjector = Boolean.getBoolean( "org.jetbrains.projector.server.enable" );
isWinPE = isWindows && "X:\\Windows\\System32".equalsIgnoreCase( System.getProperty( "user.dir" ) );
}
public static long scanVersion( String version ) {