From eed2d139a380eeda267a842597914991da31813a Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 26 Apr 2023 21:06:23 -0700 Subject: [PATCH] Added theme support --- gui/notepad/notepad.tal | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/gui/notepad/notepad.tal b/gui/notepad/notepad.tal index ce53b1d..39db3fb 100644 --- a/gui/notepad/notepad.tal +++ b/gui/notepad/notepad.tal @@ -10,8 +10,7 @@ > Copy/Paste > Clamp selection > Mouse2 select word - > Page memory mapping - > Theme support ) + > Page memory mapping ) |0000 @@ -25,6 +24,7 @@ #f00f .System/r DEO2 #f00f .System/g DEO2 #f00f .System/b DEO2 + load-theme ( size ) #00e0 .Screen/width DEO2 #00f8 .Screen/height DEO2 @@ -33,11 +33,9 @@ ;on-mouse-body .Mouse/vector DEO2 ;on-frame .Screen/vector DEO2 ;on-control .Controller/vector DEO2 - + ( init ) ;mem/end ;mem SUB2 .textarea/length STZ2 - ;mem select-from - draw-header draw-note @@ -494,6 +492,22 @@ JMP2r JMP2r +@load-theme ( -- ) + + ;&path .File/name DEO2 + #0002 .File/length DEO2 + ;&r .File/read DEO2 + ;&g .File/read DEO2 + ;&b .File/read DEO2 + .File/success DEI2 ORA [ #01 JCN JMP2r ] + LIT2 &r $2 .System/r DEO2 + LIT2 &g $2 .System/g DEO2 + LIT2 &b $2 .System/b DEO2 + +JMP2r + &path ".theme $1 + + ( @|stdlib )