Skip to content

Commit 3acb00f

Browse files
committed
minimal summit changes :P
1 parent 7321cfe commit 3acb00f

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

OSL Programs/apps/System/.Install_system.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
"path": "Origin/(A) System/User Applications",
250250
"name": "Summit.osl",
251251
"icon": "c #6a54b3 w 10 square 0 0 5 5 c #111 w 8 square 0 0 5 5 dot 0 0 c #6a54b3 w 1.5 line -5 -4 -2.5 1 cont -1 -1 line 0 -4 2.7 3 cont 5 -4",
252-
"version":"2.5"
252+
"version":"2.6"
253253
},
254254
{
255255
"url": "https://origin.mistium.com/OSL%20Programs/apps/System/Studio.osl",

OSL Programs/apps/System/Summit.osl

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ loaded_pages = {}
77
current_pages = []
88
summit = {
99
tlds: (system_url ++ "tlds.json").httpGet().JsonParse(),
10+
redirect_url: ""
1011
}
1112

13+
page_len = 0
14+
tab_info = null
15+
current_tab_name = {}
16+
1217
each key window.getKeys() (
1318
if window[key]["type"] == "function" (
1419
window[key] = () -> ()
@@ -148,7 +153,6 @@ def "draw_page" "url, page_type, tab_id" (
148153
if page_protocol == "web" (
149154
local parts = url.split("/")
150155
local current_tld = parts[1].split(".").last()
151-
// get the tld of the page
152156
fetch_url = "https://" ++ summit.tlds[current_tld] ++ url
153157
local data = fetch_url.getAsync()
154158
) else if page_protocol == "local" (
@@ -259,7 +263,6 @@ sidebar = {
259263

260264
sidebar.main = def() -> (
261265
sidebar = sidebar.handleSize()
262-
// sidebar.handleSize()
263266

264267
if mouse_x < window.left + 30 and onclick (
265268
sidebar.target_x = 0
@@ -319,10 +322,16 @@ sidebar.main = def() -> (
319322
square frame.width - 20 30 15 : c#global_accent
320323
square frame.width - 20 30 10 : c#window_colour
321324
if onclick (
322-
if current_tabs.contains(tab.id) (
323-
current_tabs.delete(tab.id)
325+
if "shift".isKeyDown() (
326+
if current_tabs.contains(tab.id) (
327+
if current_tabs.len > 1 (
328+
current_tabs.delete(tab.id)
329+
)
330+
) else (
331+
current_tabs.append(tab.id)
332+
)
324333
) else (
325-
current_tabs.append(tab.id)
334+
current_tabs = [tab.id]
326335
)
327336
)
328337
)
@@ -368,18 +377,28 @@ sidebar.main()
368377
local left = sidebar.edge + 10
369378
local right = window.right - 10
370379
local w = right - left
371-
local tab_w = w / current_tabs.len
372-
local right = left + tab_w
373380

374381
for i tabs_queue.len (
375-
tabs.append(tabs_queue.shift())
382+
local new_tab = tabs_queue.shift()
383+
tabs.append(new_tab)
384+
if tabs.len == 1 or current_tabs.len == 0 (
385+
current_tabs = [new_tab.id]
386+
)
376387
)
377-
current_tabs = [tabs.last().id]
378388

379-
each this.tab current_tabs (
380-
page_frame left window.top - 10 right window.bottom + 10 tab
381-
local left += tab_w
382-
local right += tab_w
389+
local tab_count = current_tabs.len
390+
if tab_count == 0 (
391+
tab_count = 1
392+
)
393+
local tab_w = w / tab_count
394+
395+
local current_left = left
396+
local current_right = left + tab_w
397+
398+
each this.tab_id current_tabs (
399+
page_frame current_left window.top - 10 current_right window.bottom + 10 tab_id
400+
local current_left += tab_w
401+
local current_right += tab_w
383402
)
384403

385404
import "win-buttons"

0 commit comments

Comments
 (0)