Skip to content

Commit

Permalink
Add true mode icons
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlubin committed Sep 16, 2018
1 parent b004be6 commit 311c2b5
Show file tree
Hide file tree
Showing 9 changed files with 5,561 additions and 9 deletions.
11 changes: 8 additions & 3 deletions build/out/main.css
Expand Up @@ -587,13 +587,13 @@ code {
.mode-indicator {
align-self: center;

width: 5px;
height: 5px;
width: 6px;
height: 6px;
background-color: var(--pop-color-clear);
transition: background-color 0.2s;

border: 1px solid var(--subtle-border-color);
border-radius: 5px;
border-radius: 6px;
}

.mode-icon-wrapper.active .mode-indicator {
Expand All @@ -618,6 +618,11 @@ code {
text-align: center;
}

.mode-icon .text-button img {
width: 100%;
height: 100%;
}

.mode-separator {
background-color: var(--subtle-border-color);
width: 1px;
Expand Down
1,862 changes: 1,862 additions & 0 deletions img/mode-icons/Deuce.ai

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions img/mode-icons/Deuce.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,862 changes: 1,862 additions & 0 deletions img/mode-icons/Text.ai

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions img/mode-icons/Text.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,807 changes: 1,807 additions & 0 deletions img/mode-icons/TypeInspector.ai

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions img/mode-icons/TypeInspector.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Makefile
Expand Up @@ -13,7 +13,7 @@ html: elm-stuff/packages
cd ../ace-builds/src && cp $(out_from_ace-builds) ../../build/out/
cp ../viz.js/viz.js ../build/out/
mkdir -p ../build/out/img
cp ../img/* ../build/out/img/
cp -r ../img/* ../build/out/img/
# sed -i '' 's/var Elm = {};/var Elm = {};\nElm["EvalUpdate"] = Elm["EvalUpdate"] || {};\nElm["EvalUpdate"].api = _user$$project$$EvalUpdate$$api;/g' ../build/out/sns.js

all: elm-stuff/packages prelude examples html
Expand Down
23 changes: 18 additions & 5 deletions src/View.elm
Expand Up @@ -1586,14 +1586,14 @@ codePanel model =
active =
Model.modeActive model mode

caption =
(modeName, imageName) =
case mode of
Model.CEText ->
"Text"
("Text", "Text")
Model.CEDeuceClick ->
"Deuce"
("Deuce", "Deuce")
Model.CETypeInspector ->
"Type Inspector"
("Type Inspector", "TypeInspector")
in
Html.div
[ Attr.classList
Expand All @@ -1606,7 +1606,20 @@ codePanel model =
[]
, Html.div
[ Attr.class "mode-icon" ]
[ simpleTextButton caption (Controller.msgSetCodeEditorMode mode)
[ textButton
{ defaultTb
| content =
[ Html.img
[ Attr.src <|
"img/mode-icons/" ++ imageName ++ ".svg"
, Attr.title <|
modeName ++ " Mode"
]
[]
]
, onClick =
Controller.msgSetCodeEditorMode mode
}
]
]
modeSeparator =
Expand Down

0 comments on commit 311c2b5

Please sign in to comment.