Changes
6 changed files (+6/-98)
-
-
@@ -204,14 +204,7 @@ view model =[ node "x-preview" [ slot "preview" , Html.Attributes.id "preview" , attribute "print-theme" (case parameters.parameters.rendering.colorSchema of Parameters.BlackOnWhite -> "black-on-white" Parameters.WhiteOnBlack -> "white-on-black" ) , attribute "print-theme" "black-on-white" , attribute "preview-theme" (case model.preferences.preferences.previewTheme of Preferences.SystemTheme ->
-
-
-
@@ -128,37 +128,11 @@ canvasSizeDimension size =( mm 210, mm 297 ) type ColorSchema = BlackOnWhite | WhiteOnBlack colorSchemaToString : ColorSchema -> String colorSchemaToString schema = case schema of BlackOnWhite -> "black-on-white" WhiteOnBlack -> "white-on-black" colorSchemaToCompactString : ColorSchema -> String colorSchemaToCompactString schema = case schema of BlackOnWhite -> "w" WhiteOnBlack -> "b" type alias Rendering = { size : CanvasSize , margin : Length , gap : Length , lineWidth : Length , colorSchema : ColorSchema , qrCode : Bool }
-
@@ -249,7 +223,6 @@ default =, margin = mm 5 , gap = mm 10 , lineWidth = mm 0.2 , colorSchema = BlackOnWhite , qrCode = True } }
-
@@ -293,14 +266,6 @@ toDict mode params =, ( toString ShortPieceLength, String.fromFloat (toMM params.shortPiece.length) ) , ( toString CanvasMargin, String.fromFloat (toMM params.rendering.margin) ) , ( toString LineWidth, String.fromFloat (toMM params.rendering.lineWidth) ) , ( toString ColorSchema , case mode of Regular -> colorSchemaToString params.rendering.colorSchema Compact -> colorSchemaToCompactString params.rendering.colorSchema ) , ( toString BuckleHoleAdjustments, String.fromInt params.longPiece.buckleHole.adjustments ) , ( toString BuckleHoleDistance, String.fromFloat (toMM params.longPiece.buckleHole.distance) ) , ( toString BuckleHoleInterval, String.fromFloat (toMM params.longPiece.buckleHole.interval) )
-
-
-
@@ -19,11 +19,9 @@ import Html.LivingStandard exposing (..)import Length exposing (Length, mm, toMM) import Models.PWS01.Parameters as Parameters exposing ( ColorSchema(..) , LoopStyle(..) ( LoopStyle(..) , Parameters , ParametersDict , colorSchemaToString , getKey , hasKey , loopStyleToString
-
@@ -789,22 +787,6 @@ view model =, disabled = False , attrs = step "0.1" :: lengthFieldAttrs constraints.rendering.lineWidth } , choiceField model { key = ColorSchema , description = [ text "Color schema of the template." ] , attrs = [] , disabled = False , choices = [ { label = [ text "Black on White" ] , description = [ text "Select this if you print the template with a regular printer." ] , value = colorSchemaToString BlackOnWhite } , { label = [ text "White on Black" ] , description = [ text "For digital output. Printing this with an inkjet printer is not a good idea." ] , value = colorSchemaToString WhiteOnBlack } ] } , boolField model { key = QRCode , description =
-
-
-
@@ -35,7 +35,6 @@ type Key| ShortPieceLength | CanvasMargin | LineWidth | ColorSchema | QRCode | Version
-
@@ -118,9 +117,6 @@ toString key =LineWidth -> "line-width" ColorSchema -> "color-schema" QRCode -> "qrcode"
-
@@ -203,9 +199,6 @@ toLabel key =LineWidth -> "Line width" ColorSchema -> "Color schema" QRCode -> "QR code"
-
@@ -282,9 +275,6 @@ toCompactID key =LineWidth -> "l" ColorSchema -> "m" QRCode -> "n"
-
-
-
@@ -148,25 +148,6 @@ parseLength constraints text =|> max parseColorSchema : String -> Result Error ColorSchema parseColorSchema text = case text of "b" -> Ok WhiteOnBlack "white-on-black" -> Ok WhiteOnBlack "w" -> Ok BlackOnWhite "black-on-white" -> Ok BlackOnWhite _ -> Err (NonexistentVariant text) parseLoopStyle : String -> Result Error LoopStyle parseLoopStyle text = case text of
-
@@ -379,12 +360,11 @@ parseRendering fields =case ( ( parseField CanvasMargin (parseLength constraints.rendering.margin) fields , parseField LineWidth (parseLength constraints.rendering.lineWidth) fields , parseField ColorSchema parseColorSchema fields ) , hasKey QRCode fields ) of ( ( Ok margin, Ok lineWidth, Ok colorSchema ), qrCode ) -> ( ( Ok margin, Ok lineWidth ), qrCode ) -> let base = default.rendering
-
@@ -393,16 +373,14 @@ parseRendering fields ={ base | margin = margin , lineWidth = lineWidth , colorSchema = colorSchema , qrCode = qrCode } ( ( margin, lineWidth, colorSchema ), _ ) -> ( ( margin, lineWidth ), _ ) -> Err (mkErrors [ ( CanvasMargin, getError margin ) , ( LineWidth, getError lineWidth ) , ( ColorSchema, getError colorSchema ) ] )
-
-
-
@@ -159,7 +159,7 @@ panelItems model =, radioBox { label = [ text "Use system theme" ] , description = [ text "Toggle light and dark mode automatically based on your system's dark mode setting." ] [ text "Preview in black on white when your system is in light mode, in white on black when your system is in dark mode." ] , name = previewThemeId , value = "system" , checked = model.preferences.previewTheme == SystemTheme
-
@@ -168,7 +168,7 @@ panelItems model =[] , radioBox { label = [ text "Use print theme" ] , description = [ text "Preview in printed color. Output image will be exactly same to the preview." ] , description = [ text "Preview in black on white." ] , name = previewThemeId , value = "print" , checked = model.preferences.previewTheme == PrintTheme
-