summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/votann/tab_widget.clj35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/votann/tab_widget.clj b/src/votann/tab_widget.clj
index ab6a8ae..e7ff9c1 100644
--- a/src/votann/tab_widget.clj
+++ b/src/votann/tab_widget.clj
@@ -5,19 +5,24 @@
[votann.enhancements-widget :refer [enhancements-view-widget]]
[cljfx.api :as fx]))
+(defn list-view-tab [data]
+ [{:fx/type :tab
+ :text "List"
+ :closable false
+ :content (list-view-widget data)}])
+
+(def unit-view-tab
+ (vec (for [unit get-models]
+ {:fx/type :tab
+ :text unit
+ :closable false
+ :content (unit-view-widget (unit-file-name unit))})))
+
+(def enhancements-view-tab
+ [{:fx/type :tab
+ :text "Enhancements"
+ :closable false
+ :content enhancements-view-widget}])
+
(defn tab-widget [data]
- (vec (apply merge
- (vec (apply merge
- [{:fx/type :tab
- :text "List"
- :closable false
- :content (list-view-widget data)}]
- (vec (for [unit get-models]
- {:fx/type :tab
- :text unit
- :closable false
- :content (unit-view-widget (unit-file-name unit))}))))
- [{:fx/type :tab
- :text "Enhancements"
- :closable false
- :content enhancements-view-widget}])))
+ (vec (apply concat [(list-view-tab data) unit-view-tab enhancements-view-tab])))