mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Support JBR-1650 propagate custom decoration title bar height to native
GitOrigin-RevId: 13ca881ea2023fdc5871c382bb23f4a5a3855348
This commit is contained in:
committed by
intellij-monorepo-bot
parent
094cc445b1
commit
5dd3e42476
@@ -71,4 +71,18 @@ public class JdkEx {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setCustomDecorationTitleBarHeight(@NotNull Window window, int height) {
|
||||
if (SystemInfo.isJetBrainsJvm && SystemInfo.isWindows) {
|
||||
try {
|
||||
MethodInvocator invocator =
|
||||
new MethodInvocator(false, Class.forName("sun.awt.windows.WWindowPeer"), "setCustomDecorationTitleBarHeight", int.class);
|
||||
if (invocator.isAvailable()) {
|
||||
invocator.invoke(AWTAccessor.getComponentAccessor().getPeer(window), height);
|
||||
}
|
||||
}
|
||||
catch (ClassNotFoundException ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -159,6 +159,7 @@ abstract class CustomHeader(private val window: Window) : JPanel(), Disposable {
|
||||
protected fun updateCustomDecorationHitTestSpots() {
|
||||
val toList = getHitTestSpots().map {it.getRectangleOn(window)}.toList()
|
||||
JdkEx.setCustomDecorationHitTestSpots(window, toList)
|
||||
JdkEx.setCustomDecorationTitleBarHeight(window, height)
|
||||
}
|
||||
|
||||
abstract fun getHitTestSpots(): List<RelativeRectangle>
|
||||
|
||||
Reference in New Issue
Block a user