darwin: temporarily set window background to be transparent. examples: Add core-transparent-window and remove input from core-triangle
This commit is contained in:
parent
f8a2858df8
commit
19040cae25
6 changed files with 226 additions and 17 deletions
|
|
@ -101,7 +101,10 @@ fn initWindow(
|
|||
const metal_descriptor = try core.allocator.create(gpu.Surface.DescriptorFromMetalLayer);
|
||||
const layer = objc.quartz_core.MetalLayer.new();
|
||||
defer layer.release();
|
||||
|
||||
layer.setDisplaySyncEnabled(true);
|
||||
layer.setOpaque(false);
|
||||
|
||||
metal_descriptor.* = .{
|
||||
.layer = layer,
|
||||
};
|
||||
|
|
@ -160,6 +163,10 @@ fn initWindow(
|
|||
native_window.setIsVisible(true);
|
||||
native_window.makeKeyAndOrderFront(null);
|
||||
|
||||
const color = objc.app_kit.Color.colorWithRed_green_blue_alpha(0.5, 0.5, 0.5, 0.5);
|
||||
native_window.setBackgroundColor(color);
|
||||
native_window.setTitlebarAppearsTransparent(true);
|
||||
|
||||
const string = objc.foundation.String.allocInit();
|
||||
defer string.release();
|
||||
native_window.setTitle(string.initWithUTF8String(core_window.title));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue