core-graphics core-graphics.types io.thread kernel literals math
math.bitwise math.rectangles namespaces sequences threads ui
ui.backend ui.backend.cocoa.views ui.clipboards
-ui.gadgets.worlds ui.pixel-formats ui.private ;
+ui.gadgets.worlds ui.pixel-formats ui.private ui.theme
+ui.theme.switching ;
IN: ui.backend.cocoa
TUPLE: window-handle view window ;
: install-app-delegate ( -- )
NSApp FactorApplicationDelegate install-delegate ;
-! : current-theme ( -- )
-! NSAppearance -> currentAppearance -> name [
-! CF>string "NSAppearanceNameDarkAqua" =
-! dark-theme light-theme ? switch-theme-if-default
-! ] when* ;
+: current-theme ( -- )
+ NSAppearance -> currentAppearance -> name [
+ CF>string "NSAppearanceNameDarkAqua" =
+ dark-theme light-theme ? switch-theme-if-default
+ ] when* ;
SYMBOL: cocoa-startup-hook
"UI" assert.app [
init-clipboard
cocoa-startup-hook get call( -- )
-! current-theme
+ current-theme
start-ui
stop-io-thread
init-thread-timer
splitting threads ui.backend.cocoa.input-methods ui.commands
ui.gadgets ui.gadgets.editors ui.gadgets.line-support
ui.gadgets.private ui.gadgets.worlds ui.gestures ui.private
-words ;
+ui.theme ui.theme.switching words ;
IN: ui.backend.cocoa.views
! Light/Dark Mode
-! METHOD: void viewDidChangeEffectiveAppearance [
-! self -> effectiveAppearance -> name [
-! CF>string "NSAppearanceNameDarkAqua" =
-! dark-theme light-theme ? switch-theme-if-default
-! ] when*
-! ] ;
+ METHOD: void viewDidChangeEffectiveAppearance [
+ self -> effectiveAppearance -> name [
+ CF>string "NSAppearanceNameDarkAqua" =
+ dark-theme light-theme ? switch-theme-if-default
+ ] when*
+ ] ;
! Events
METHOD: char acceptsFirstMouse: id event [ 0 ] ;