|
1047 | 1047 | runner
|
1048 | 1048 | running?
|
1049 | 1049 | insert-visr!
|
1050 |
| - fs] |
| 1050 | + fs |
| 1051 | + app-pane] |
1051 | 1052 | :as db}]
|
1052 | 1053 | (let [new-file (if @file-changed
|
1053 | 1054 | #(swap! menu conj [:confirm-save :new])
|
|
1077 | 1078 | print-buffer #(swap! menu conj :print)
|
1078 | 1079 | run+pause (fn []
|
1079 | 1080 | (reset! output #queue [])
|
1080 |
| - (env/eval-buffer db))] |
| 1081 | + (env/eval-buffer db)) |
| 1082 | + stop (fn [] |
| 1083 | + (reset! app-pane false)) |
| 1084 | + fullscreen (fn [] |
| 1085 | + (-> js/document (.getElementById "internalAppContainer") |
| 1086 | + (.requestFullscreen)))] |
1081 | 1087 | [:div
|
1082 | 1088 | [:div {:class-name "d-block d-md-none"}
|
1083 | 1089 | [:> Row {:class-name "align-items-center flex-nowrap"
|
|
1118 | 1124 | :style {:padding-right 0}}
|
1119 | 1125 | [:> Dropdown {:as ButtonGroup
|
1120 | 1126 | :size "sm"}
|
| 1127 | + (when @app-pane |
| 1128 | + [:> Button {:on-click fullscreen |
| 1129 | + :variant "warning"} |
| 1130 | + strings/FULLSCREEN]) |
1121 | 1131 | [:> Button {:variant (if @running? "warning" "success")
|
1122 | 1132 | :on-click run+pause}
|
1123 | 1133 | (if @running? strings/PAUSE strings/RUN)]
|
1124 | 1134 | [:> (oget Dropdown :Toggle) {:split true}]
|
1125 | 1135 | [:> (oget Dropdown :Menu)
|
1126 |
| - [:> (oget Dropdown :Item) strings/STOP] |
| 1136 | + [:> (oget Dropdown :Item) {:on-click stop} strings/STOP] |
1127 | 1137 | [:> (oget Dropdown :Item) {:on-click do-insert-visr}
|
1128 | 1138 | strings/INSERT-VISR]]]]]]
|
1129 | 1139 | [:div {:className "d-none d-md-block"}
|
|
1160 | 1170 | [:> Col {:xs "auto"
|
1161 | 1171 | :style {:paddingRight 0}}
|
1162 | 1172 | [:> ButtonGroup
|
| 1173 | + (when @app-pane |
| 1174 | + [:> Button {:on-click fullscreen |
| 1175 | + :variant "warning"} |
| 1176 | + strings/FULLSCREEN]) |
1163 | 1177 | [:> Button {:on-click do-insert-visr
|
1164 | 1178 | :variant "info"}
|
1165 | 1179 | strings/INSERT-VISR]
|
1166 | 1180 | [:> Button {:on-click run+pause
|
1167 | 1181 | :variant (if @running? "warning" "success")}
|
1168 | 1182 | (if @running? strings/PAUSE strings/RUN)]
|
1169 |
| - [:> Button {:variant "danger"} strings/STOP]]]]]])) |
| 1183 | + [:> Button {:on-click stop |
| 1184 | + :variant "danger"} strings/STOP]]]]]])) |
1170 | 1185 |
|
1171 | 1186 | (def exclude-autocomplete-keys
|
1172 | 1187 | {8 "backspace", 9 "tab", 13 "enter", 16 "shift", 17 "ctrl",
|
|
1443 | 1458 | ;; Views
|
1444 | 1459 |
|
1445 | 1460 | (defn home-page [{{:keys [orientation]} :options
|
1446 |
| - :keys [fs buffers output version menu split] |
| 1461 | + :keys [fs buffers output version menu split app-pane] |
1447 | 1462 | :as db}
|
1448 | 1463 | & [{editor-ref :editor
|
1449 | 1464 | editor-reset-ref :editor-reset
|
|
1516 | 1531 | [:> SplitPane {:split @orientation
|
1517 | 1532 | :on-change #(reset! split (aget % 0))}
|
1518 | 1533 | [:> Pane {:initialSize @split
|
1519 |
| - :style [:height "100%"]} |
| 1534 | + :style {:height "100%"}} |
1520 | 1535 | [editor-view db {:editor-reset editor-reset-ref
|
1521 | 1536 | :editor editor-ref
|
1522 | 1537 | :visr-run visr-run-ref}]]
|
1523 |
| - [result-view db repl-ref]]] |
| 1538 | + (if @app-pane |
| 1539 | + [:> SplitPane {:split (utils/swap-orientation @orientation)} |
| 1540 | + [:> Pane {:initialSize 1} |
| 1541 | + [result-view db repl-ref]] |
| 1542 | + [:div {:id "internalAppContainer" |
| 1543 | + :style {:height "100%" |
| 1544 | + :width "100%" |
| 1545 | + :background-color "white"}} |
| 1546 | + [:div {:id "internalApp"} |
| 1547 | + "Open Your Heart!"]]] |
| 1548 | + [result-view db repl-ref])]] |
1524 | 1549 | [:div {:style {:flex "1 1 auto"
|
1525 | 1550 | :overflow "auto"
|
1526 | 1551 | :height "100%"
|
|
0 commit comments