forked from juanger/lucecita
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DarkWindow.rb
30 lines (25 loc) · 843 Bytes
/
DarkWindow.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# DarkWindow.rb
# Lucecita
#
# Created by Juan Germán Castañeda Echevarría on 7/19/08.
# Copyright (c) 2008 UNAM. All rights reserved.
#
require 'osx/cocoa'
class DarkWindow < OSX::NSWindow
def initWithContentRect_styleMask_backing_defer(contentRect, aStyle, bufferingType, flag)
result = super_initWithContentRect_styleMask_backing_defer(OSX::NSScreen.mainScreen.frame,
OSX::NSBorderlessWindowMask,
bufferingType,
flag)
if result
result.setBackgroundColor(OSX::NSColor.clearColor)
result.setOpaque false
result.setIgnoresMouseEvents true
result.setLevel(OSX::NSScreenSaverWindowLevel)
result.setCollectionBehavior OSX::NSWindowCollectionBehaviorCanJoinAllSpaces
result.useOptimizedDrawing true
end
result
end
end