Add Messages and Relay tabs at the top level.

This commit is contained in:
Robert C. Martin 2022-09-27 14:08:30 -05:00
parent 0cfe6dd5f1
commit 1a2db01837
2 changed files with 9 additions and 11 deletions

View File

@ -40,17 +40,17 @@
_ (listen article-area :hyperlink open-link) _ (listen article-area :hyperlink open-link)
header-tab-panel (tabbed-panel :tabs (tabs/make-tabs) :id :header-tab-panel) header-tab-panel (tabbed-panel :tabs (tabs/make-tabs) :id :header-tab-panel)
relay-panel (relay-panel/make-relay-panel) relay-panel (relay-panel/make-relay-panel)
header-panel (left-right-split (scrollable relay-panel)
header-tab-panel)
article-panel (border-panel :north (article-panel/make-article-info-panel) article-panel (border-panel :north (article-panel/make-article-info-panel)
:center (scrollable article-area) :center (scrollable article-area)
:south (article-panel/make-control-panel)) :south (article-panel/make-control-panel))
main-panel (top-bottom-split messages-panel (top-bottom-split
header-panel header-tab-panel
article-panel article-panel
:divider-location 1/2) :divider-location 1/2)
main-tabs (tabbed-panel :tabs [{:title "Messages" :content messages-panel}
{:title "Relays" :content (scrollable relay-panel)}])
timer (Timer. 100 nil)] timer (Timer. 100 nil)]
(config! main-frame :content main-panel) (config! main-frame :content main-tabs)
(listen timer :action timer-action) (listen timer :action timer-action)
(listen main-frame :window-closing (listen main-frame :window-closing
(fn [_] (fn [_]

View File

@ -9,12 +9,10 @@
write-check-box (checkbox :text "W" :enabled? false :selected? (:write relay) :id :write) write-check-box (checkbox :text "W" :enabled? false :selected? (:write relay) :id :write)
connected-check-box (checkbox :text "Connected" :enabled? false :selected? (some? (:connection relay)) :id :connected) connected-check-box (checkbox :text "Connected" :enabled? false :selected? (some? (:connection relay)) :id :connected)
subscribed-check-box (checkbox :text "Subscribed" :enabled? false :selected? (:subscribed relay) :id :subscribed) subscribed-check-box (checkbox :text "Subscribed" :enabled? false :selected? (:subscribed relay) :id :subscribed)
relay-label (flow-panel :align :left relay-panel (flow-panel :align :left
:items [(label :text relay-url :halign :left)]) :items [read-check-box write-check-box connected-check-box subscribed-check-box
buttons (flow-panel :align :left (label :text relay-url :halign :left)])]
:items [read-check-box write-check-box connected-check-box subscribed-check-box]) relay-panel))
control-panel (vertical-panel :items [relay-label buttons (separator :border 1)])]
control-panel))
(defn make-relay-panel [] (defn make-relay-panel []
(let [urls (keys @relays) (let [urls (keys @relays)