add ability to select cursor colour
This commit is contained in:
@@ -1115,6 +1115,62 @@ struct
|
||||
, xClickPoints = xClickPoints
|
||||
, yClickPoints = yClickPoints
|
||||
|
||||
, showGraph = showGraph
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
, a = a
|
||||
, modalNum = 0
|
||||
, undo = undo
|
||||
, redo = redo
|
||||
}
|
||||
end
|
||||
|
||||
fun cursorColour (app, r, g, b, a) =
|
||||
let
|
||||
val
|
||||
{ mode
|
||||
, canvasHeight
|
||||
, canvasWidth
|
||||
, squares
|
||||
, arrowX
|
||||
, arrowY
|
||||
, windowWidth
|
||||
, windowHeight
|
||||
, xClickPoints
|
||||
, yClickPoints
|
||||
|
||||
, showGraph
|
||||
, mouseX
|
||||
, mouseY
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r = _
|
||||
, g = _
|
||||
, b = _
|
||||
, a = _
|
||||
, modalNum
|
||||
, undo
|
||||
, redo
|
||||
} = app
|
||||
in
|
||||
{ mode = mode
|
||||
, canvasHeight = canvasHeight
|
||||
, canvasWidth = canvasWidth
|
||||
, arrowX = arrowX
|
||||
, mouseX = mouseX
|
||||
, mouseY = mouseY
|
||||
, squares = squares
|
||||
, arrowY = arrowY
|
||||
, windowWidth = windowWidth
|
||||
, windowHeight = windowHeight
|
||||
, xClickPoints = xClickPoints
|
||||
, yClickPoints = yClickPoints
|
||||
|
||||
, showGraph = showGraph
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
|
||||
@@ -263,6 +263,16 @@ struct
|
||||
fun updateBlue model = (AppWith.b model, [])
|
||||
fun updateAlpha model = (AppWith.a model, [])
|
||||
|
||||
fun selectCursorColour (model: app_type) =
|
||||
let
|
||||
val {squares, arrowX, arrowY, ...} = model
|
||||
val yAxis = Vector.sub (squares, arrowX)
|
||||
val {r, g, b, a} = Vector.sub (yAxis, arrowY)
|
||||
val model = AppWith.cursorColour (model, r, g, b, a)
|
||||
in
|
||||
(model, [])
|
||||
end
|
||||
|
||||
fun updateCanvas (model, canvasWidth, canvasHeight) =
|
||||
let
|
||||
val
|
||||
@@ -359,6 +369,7 @@ struct
|
||||
| KEY_G => updateGreen model
|
||||
| KEY_B => updateBlue model
|
||||
| KEY_A => updateAlpha model
|
||||
| KEY_C => selectCursorColour model
|
||||
| KEY_W => updateCanvasWidth model
|
||||
| KEY_H => updateCanvasHeight model
|
||||
| KEY_M => enterMoveMode model
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
25 25 { {0 10 0 12 25 25 25 1 } {1 9 1 9 25 25 25 1 } {2 10 2 14 25 25 25 1 } {3 8 3 9 25 25 25 1 } {3 15 3 15 25 25 25 1 } {4 7 5 7 25 25 25 1 } {4 16 6 18 25 25 25 1 } {5 16 5 19 25 25 25 1 } {6 8 6 8 25 25 25 1 } {7 7 9 7 25 25 25 1 } {7 15 7 15 25 25 25 1 } {8 16 10 18 25 25 25 1 } {9 16 9 19 25 25 25 1 } {10 8 10 8 25 25 25 1 } {11 7 13 7 25 25 25 1 } {11 15 11 15 25 25 25 1 } {12 16 14 18 25 25 25 1 } {13 16 13 19 25 25 25 1 } {14 8 14 8 25 25 25 1 } {15 7 17 7 25 25 25 1 } {15 15 15 15 25 25 25 1 } {16 16 18 18 25 25 25 1 } {17 16 17 19 25 25 25 1 } {18 8 18 8 25 25 25 1 } {19 9 19 15 25 25 25 1 } {19 14 23 14 25 25 25 1 } {20 4 20 5 25 25 25 1 } {20 7 20 8 25 25 25 1 } {21 6 23 6 25 25 25 1 } {24 4 24 5 25 25 25 1 } {24 7 24 13 25 25 25 1 } }
|
||||
@@ -85,6 +85,10 @@ struct
|
||||
key = Input.KEY_H () andalso action = Input.PRESS () andalso mods = 0
|
||||
then
|
||||
Mailbox.send (mailbox, KEY_H)
|
||||
else if
|
||||
key = Input.KEY_C () andalso action = Input.PRESS () andalso mods = 0x000
|
||||
then
|
||||
Mailbox.send (mailbox, KEY_C)
|
||||
else if
|
||||
key = Input.KEY_UP () andalso action <> Input.RELEASE ()
|
||||
andalso mods = 0x0
|
||||
|
||||
@@ -15,6 +15,7 @@ struct
|
||||
| KEY_W
|
||||
| KEY_H
|
||||
| KEY_M
|
||||
| KEY_C
|
||||
| KEY_BACKSPACE
|
||||
| KEY_CTRL_S
|
||||
| KEY_CTRL_L
|
||||
|
||||
Reference in New Issue
Block a user