diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 6c95f61591..0e4503ea59 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,16 +1,14 @@ 0.79: -- tutorial gradient does not appear - sig11 on first startup - fix initial font metrics being incorrect -- fix solid boundary paint -- investigate UI on Linux/x86 - swap @{ and { syntax - get stuff in examples dir running in the ui - [ ... is annoying perhaps on the last line of output, if a block doesn't fit, print it anyway? - apropos: use new smarter completion? +- fix buttons + ui: diff --git a/library/help/tutorial.factor b/library/help/tutorial.factor index 7f5b117f9b..957676d4e5 100644 --- a/library/help/tutorial.factor +++ b/library/help/tutorial.factor @@ -11,7 +11,8 @@ namespaces sdl sequences strings styles ; dup << gradient f @{ @{ 64 64 64 }@ @{ 255 255 255 }@ }@ >> interior set-paint-prop - @{ 0 10 0 }@ over set-gadget-dim ; + @{ 0 10 0 }@ over set-gadget-dim + @{ 1 0 0 }@ over set-gadget-orientation ; GENERIC: tutorial-line ( object -- gadget ) @@ -28,8 +29,16 @@ M: string tutorial-line M: general-list tutorial-line car dup example-theme ; +: page-theme + dup @{ 204 204 255 }@ background set-paint-prop + dup << gradient f @{ @{ 204 204 255 }@ @{ 255 204 255 }@ }@ >> + interior set-paint-prop + dup "Sans Serif" font set-paint-prop + 16 font-size set-paint-prop ; + : ( list -- gadget ) - [ tutorial-line ] map make-pile 1 over set-pack-fill ; + [ tutorial-line ] map make-pile 1 over set-pack-fill + dup page-theme ; : tutorial-pages { @@ -356,16 +365,8 @@ M: general-list tutorial-line } } ; -: tutorial-theme - dup @{ 204 204 255 }@ background set-paint-prop - dup << gradient f @{ @{ 204 204 255 }@ @{ 255 204 255 }@ }@ >> - interior set-paint-prop - dup "Sans Serif" font set-paint-prop - 16 font-size set-paint-prop ; - : ( pages -- browser ) - tutorial-pages [ ] map - dup tutorial-theme ; + tutorial-pages [ ] map ; : tutorial ( -- ) gadget. ; diff --git a/library/opengl/opengl-utils.factor b/library/opengl/opengl-utils.factor index 148c33d8c8..7c0a3ee3b7 100644 --- a/library/opengl/opengl-utils.factor +++ b/library/opengl/opengl-utils.factor @@ -70,7 +70,10 @@ USING: alien errors kernel math namespaces opengl sdl sequences ; : gl-rect ( dim -- ) #! Draws a two-dimensional box. - GL_LINE_LOOP [ four-sides ] do-state ; + GL_MODELVIEW [ + 0.5 0.5 0 glTranslatef @{ 1 1 0 }@ v- + GL_LINE_STRIP [ dup four-sides top-left ] do-state + ] do-matrix ; : (gl-poly) [ [ gl-vertex ] each ] do-state ; @@ -79,14 +82,14 @@ USING: alien errors kernel math namespaces opengl sdl sequences ; GL_POLYGON (gl-poly) ; : gl-poly ( points { r g b } -- ) - #! Draw a filled polygon. + #! Draw a polygon. GL_LINE_LOOP (gl-poly) ; : do-matrix ( mode quot -- ) swap glMatrixMode glPushMatrix call glPopMatrix ; inline : gl-set-clip ( loc dim -- ) - dup first2 1+ >r >r + dup first2 ( 1+ ) >r >r over second swap second + height get swap - >r first r> r> r> glScissor ;