-
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #772: macOS: native rounded borders for popups
- Loading branch information
Showing
26 changed files
with
674 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ jobs: | |
matrix: | ||
os: | ||
- windows | ||
- macos | ||
- ubuntu | ||
|
||
runs-on: ${{ matrix.os }}-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeMacLibrary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2023 FormDev Software GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.formdev.flatlaf.ui; | ||
|
||
import java.awt.Window; | ||
|
||
/** | ||
* Native methods for macOS. | ||
* <p> | ||
* <b>Note</b>: This is private API. Do not use! | ||
* | ||
* <h2>Methods that use windows as parameter</h2> | ||
* | ||
* For all methods that accept a {@link java.awt.Window} as parameter, | ||
* the underlying macOS window must be already created, | ||
* otherwise the method fails. You can use following to ensure this: | ||
* <pre>{@code | ||
* if( !window.isDisplayable() ) | ||
* window.addNotify(); | ||
* }</pre> | ||
* or invoke the method after packing the window. E.g. | ||
* <pre>{@code | ||
* window.pack(); | ||
* }</pre> | ||
* | ||
* @author Karl Tauber | ||
* @since 3.3 | ||
*/ | ||
public class FlatNativeMacLibrary | ||
{ | ||
/** | ||
* Checks whether native library is loaded/available. | ||
* <p> | ||
* <b>Note</b>: It is required to invoke this method before invoking any other | ||
* method of this class. Otherwise, the native library may not be loaded. | ||
*/ | ||
public static boolean isLoaded() { | ||
return FlatNativeLibrary.isLoaded(); | ||
} | ||
|
||
public native static boolean setWindowRoundedBorder( Window window, float radius, float borderWidth, int borderColor ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+70.9 KB
flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/libflatlaf-macos-arm64.dylib
Binary file not shown.
Binary file added
BIN
+54.1 KB
flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/libflatlaf-macos-x86_64.dylib
Binary file not shown.
Oops, something went wrong.