diff options
Diffstat (limited to 'static')
| -rw-r--r-- | static/app.js | 14 | ||||
| -rw-r--r-- | static/deck.css | 1 | ||||
| -rw-r--r-- | static/modules/windows.js | 7 |
3 files changed, 19 insertions, 3 deletions
diff --git a/static/app.js b/static/app.js index 54d4b26..ce3ec62 100644 --- a/static/app.js +++ b/static/app.js @@ -47,6 +47,19 @@ function ensureTab(name) { return tabs[name]; } +const TAB_ORDER = ["Dashboard", "Windows", "OBS"]; + +function sortTabs() { + const rank = (name) => { + const at = TAB_ORDER.indexOf(name); + return at === -1 ? TAB_ORDER.length : at; + }; + for (const name of Object.keys(tabs).sort((a, b) => rank(a) - rank(b))) { + tabBar.append(tabs[name].button); + tabBody.append(tabs[name].section); + } +} + function showTab(name) { for (const [n, tab] of Object.entries(tabs)) { tab.section.hidden = n !== name; @@ -168,6 +181,7 @@ async function boot() { } } ready = true; + sortTabs(); const saved = localStorage.getItem(TAB_KEY); showTab(tabs[saved] ? saved : "Dashboard"); } diff --git a/static/deck.css b/static/deck.css index 6f9e49a..90500ba 100644 --- a/static/deck.css +++ b/static/deck.css @@ -225,6 +225,7 @@ select { .msub { font-size: 12px; color: var(--udt-subtext0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mfoot { margin-top: 10px; font-size: 12px; color: var(--udt-overlay0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.windows { display: flex; flex-direction: column; gap: 14px; } .windows .ws { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; } .wtile { min-width: 56px; diff --git a/static/modules/windows.js b/static/modules/windows.js index a92d9e4..7d2d8c8 100644 --- a/static/modules/windows.js +++ b/static/modules/windows.js @@ -20,13 +20,14 @@ function tile(label, onclick) { export default { title: "Windows", + tab: "Windows", interval: 1, mount(el) { el.innerHTML = `<div class="windows"> - <div class="ws"></div> - <div class="winlist"></div> - <div class="launches"></div> + <section class="deck-block"><h3>Workspaces</h3><div class="ws"></div></section> + <section class="deck-block"><h3>Launches</h3><div class="launches"></div></section> + <section class="deck-block"><h3>Windows</h3><div class="winlist"></div></section> </div>`; }, |
