Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit de99f27

Browse files
committed
Add support for new device sizes in new stack templates
This patch adds support for new device sizes in new stack templates, both in the 'New File' menu and the in the start center.
1 parent 7dd74e7 commit de99f27

File tree

2 files changed

+205
-21
lines changed

2 files changed

+205
-21
lines changed

Toolset/palettes/menubar/revmenubar.livecodescript

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,16 +1364,39 @@ private function revMenubarFileMenu pContext
13641364
put true into tCanSaveStack
13651365
end if
13661366

1367+
local sDeviceList
1368+
put \
1369+
"Generic Android 6-inch Phone (412,775)" & return & \
1370+
"Generic Android 7-inch Phablet (600, 1024)" & return & \
1371+
"Generic Android 10-inch Tablet Portrait (720,1280)" & return & \
1372+
"Generic Android 10-inch Tablet Landscape 1280,720)" & return & \
1373+
"iPhone SE (320x568)" & return & \
1374+
"iPhone 6s//7//8 (375x667)" & return & \
1375+
"iPhone 6s+//7+//8+ (414x736)" & return & \
1376+
"iPhone X//XS//11 Pro (375x812)" & return & \
1377+
"iPhone XR//11 (414x896)" & return & \
1378+
"iPhone XS Max//11 Pro Max (414x896)" & return & \
1379+
"iPad 9.7-inch//Tablet Portrait (768x1024)" & return & \
1380+
"iPad 9.7-inch//Tablet Landscape (1024x768)" & return & \
1381+
"iPad 10.2-inch//Tablet Portrait (810x1080)" & return & \
1382+
"iPad 10.2-inch//Tablet Landscape (1080x810)" & return & \
1383+
"iPad 10.5-inch//Tablet Portrait (834x1112)" & return & \
1384+
"iPad 10.5-inch//Tablet Landscape (1112x834)" & return & \
1385+
"iPad 11-inch//Tablet Portrait (834x1194)" & return & \
1386+
"iPad 11-inch//Tablet Landscape (1194x834)" & return & \
1387+
"iPad 12.9-inch//Tablet Portrait (1024x1366)" & return & \
1388+
"iPad 12.9-inch//Tablet Landscape (1366x1024)" \
1389+
into sDeviceList
1390+
13671391
local tFile
13681392
put "&New Stack" & return after tFile
13691393
put tab & "Default Size" & return after tFile
13701394
put tab & "-" & return after tFile
1371-
put tab & "iPhone 4 (320x480)" & return after tFile
1372-
put tab & "iPhone 5 (320x568)" & return after tFile
1373-
put tab & "iPhone 6 (375x667)" & return after tFile
1374-
put tab & "iPhone 6 Plus (414x736)" & return after tFile
1375-
put tab & "iPad//Tablet Portrait (768x1024)" & return after tFile
1376-
put tab & "iPad//Tablet Landscape (1024x768)" & return after tFile
1395+
1396+
repeat for each line tDevice in sDeviceList
1397+
put tab & tDevice & return after tFile
1398+
end repeat
1399+
13771400
put tab & "-" & return after tFile
13781401
put tab & "Script only Stack" & return after tFile
13791402

Toolset/palettes/start center/revStartCenterBehavior.livecodescript

Lines changed: 176 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -341,21 +341,120 @@ function tilesArray pState
341341
put "lc-ipad-landscape" into tArray[4]["icon"]
342342
put "lc-ipad-landscape-filled" into tArray[4]["hoverIcon"]
343343

344-
put "iPhone 6" into tArray[5]["label"]
345-
put "newIphone6" into tArray[5]["tag"]
344+
put "Phone" into tArray[5]["label"]
345+
put "newphone" into tArray[5]["tag"]
346+
put "lc-iphone" into tArray[5]["icon"]
347+
put "lc-iphone-filled" into tArray[5]["hoverIcon"]
348+
break
349+
350+
case "newPhone"
351+
put "SE" into tArray[1]["label"]
352+
put "newIphoneSE" into tArray[1]["tag"]
353+
put "lc-iphone" into tArray[1]["icon"]
354+
put "lc-iphone-filled" into tArray[1]["hoverIcon"]
355+
356+
put "6s/7/8" into tArray[2]["label"]
357+
put "newIphone6s78" into tArray[2]["tag"]
358+
put "lc-iphone" into tArray[2]["icon"]
359+
put "lc-iphone-filled" into tArray[2]["hoverIcon"]
360+
361+
put "6s+/7+/8+" into tArray[3]["label"]
362+
put "newIphone6sPlus7Plus8Plus" into tArray[3]["tag"]
363+
put "lc-iphone" into tArray[3]["icon"]
364+
put "lc-iphone-filled" into tArray[3]["hoverIcon"]
365+
366+
put "X/XS/11 Pro" into tArray[4]["label"]
367+
put "newIphoneXXS11Pro" into tArray[4]["tag"]
368+
put "lc-iphone" into tArray[4]["icon"]
369+
put "lc-iphone-filled" into tArray[4]["hoverIcon"]
370+
371+
put "XR/11" into tArray[5]["label"]
372+
put "newIphoneXR11" into tArray[5]["tag"]
346373
put "lc-iphone" into tArray[5]["icon"]
347374
put "lc-iphone-filled" into tArray[5]["hoverIcon"]
348375

349-
put "iPhone 5" into tArray[6]["label"]
350-
put "newIphone5" into tArray[6]["tag"]
376+
put "XS Max/11 Pro Max" into tArray[6]["label"]
377+
put "newIphoneXSMax11ProMax" into tArray[6]["tag"]
351378
put "lc-iphone" into tArray[6]["icon"]
352379
put "lc-iphone-filled" into tArray[6]["hoverIcon"]
353380

354-
put "iPhone 4" into tArray[7]["label"]
355-
put "newIphone4" into tArray[7]["tag"]
381+
put "Android 6-inch generic" into tArray[7]["label"]
382+
put "android6inchgeneric" into tArray[7]["tag"]
356383
put "lc-iphone" into tArray[7]["icon"]
357384
put "lc-iphone-filled" into tArray[7]["hoverIcon"]
358385

386+
break
387+
case "newTabletPortrait"
388+
put "9.7-inch" into tArray[1]["label"]
389+
put "newTablet9.7portrait" into tArray[1]["tag"]
390+
put "lc-ipad-portrait" into tArray[1]["icon"]
391+
put "lc-ipad-portrait-filled" into tArray[1]["hoverIcon"]
392+
393+
put "10.2-inch" into tArray[2]["label"]
394+
put "newTablet10.2portrait" into tArray[2]["tag"]
395+
put "lc-ipad-portrait" into tArray[2]["icon"]
396+
put "lc-ipad-portrait-filled" into tArray[2]["hoverIcon"]
397+
398+
put "10.5-inch" into tArray[3]["label"]
399+
put "newTablet10.5portrait" into tArray[3]["tag"]
400+
put "lc-ipad-portrait" into tArray[3]["icon"]
401+
put "lc-ipad-portrait-filled" into tArray[3]["hoverIcon"]
402+
403+
put "11-inch" into tArray[4]["label"]
404+
put "newTablet11portrait" into tArray[4]["tag"]
405+
put "lc-ipad-portrait" into tArray[4]["icon"]
406+
put "lc-ipad-portrait-filled" into tArray[4]["hoverIcon"]
407+
408+
put "12.9-inch" into tArray[5]["label"]
409+
put "newTablet12.9portrait" into tArray[5]["tag"]
410+
put "lc-ipad-portrait" into tArray[5]["icon"]
411+
put "lc-ipad-portrait-filled" into tArray[5]["hoverIcon"]
412+
413+
put "10-inch" into tArray[6]["label"]
414+
put "newTablet10portrait" into tArray[6]["tag"]
415+
put "lc-ipad-portrait" into tArray[6]["icon"]
416+
put "lc-ipad-portrait-filled" into tArray[6]["hoverIcon"]
417+
418+
put "7-inch" into tArray[7]["label"]
419+
put "newTablet7portrait" into tArray[7]["tag"]
420+
put "lc-ipad-portrait" into tArray[7]["icon"]
421+
put "lc-ipad-portrait-filled" into tArray[7]["hoverIcon"]
422+
break
423+
case "newTabletLandscape"
424+
put "9.7-inch" into tArray[1]["label"]
425+
put "newTablet9.7landscape" into tArray[1]["tag"]
426+
put "lc-ipad-landscape" into tArray[1]["icon"]
427+
put "lc-ipad-landscape-filled" into tArray[1]["hoverIcon"]
428+
429+
put "10.2-inch" into tArray[2]["label"]
430+
put "newTablet10.2landscape" into tArray[2]["tag"]
431+
put "lc-ipad-landscape" into tArray[2]["icon"]
432+
put "lc-ipad-landscape-filled" into tArray[2]["hoverIcon"]
433+
434+
put "10.5-inch" into tArray[3]["label"]
435+
put "newTablet10.5landscape" into tArray[3]["tag"]
436+
put "lc-ipad-landscape" into tArray[3]["icon"]
437+
put "lc-ipad-landscape-filled" into tArray[3]["hoverIcon"]
438+
439+
put "11-inch" into tArray[4]["label"]
440+
put "newTablet11landscape" into tArray[4]["tag"]
441+
put "lc-ipad-landscape" into tArray[4]["icon"]
442+
put "lc-ipad-landscape-filled" into tArray[4]["hoverIcon"]
443+
444+
put "12.9-inch" into tArray[5]["label"]
445+
put "newTablet12.9landscape" into tArray[5]["tag"]
446+
put "lc-ipad-landscape" into tArray[5]["icon"]
447+
put "lc-ipad-landscape-filled" into tArray[5]["hoverIcon"]
448+
449+
put "10-inch" into tArray[6]["label"]
450+
put "newTablet10landscape" into tArray[6]["tag"]
451+
put "lc-ipad-landscape" into tArray[6]["icon"]
452+
put "lc-ipad-landscape-filled" into tArray[6]["hoverIcon"]
453+
454+
put "7-inch" into tArray[7]["label"]
455+
put "newTablet7landscape" into tArray[7]["tag"]
456+
put "lc-ipad-landscape" into tArray[7]["icon"]
457+
put "lc-ipad-landscape-filled" into tArray[7]["hoverIcon"]
359458
break
360459
end switch
361460
return tArray
@@ -496,6 +595,20 @@ on startCenterAction pAction
496595
put tilesArray(pAction) into tArray
497596
tilesUpdate tArray
498597
break
598+
case "newphone"
599+
put "Home / New / Phone" into field "breadcrumb"
600+
set the textStyle of word 1 of field "breadcrumb" to "link"
601+
put tilesArray(pAction) into tArray
602+
tilesUpdate tArray
603+
break
604+
case "newTabletPortrait"
605+
case "newTabletLandscape"
606+
put "Home / New / Tablet" into field "breadcrumb"
607+
set the textStyle of word 1 of field "breadcrumb" to "link"
608+
put tilesArray(pAction) into tArray
609+
tilesUpdate tArray
610+
break
611+
499612
case "samples"
500613
revIDELaunchResource "sample stacks"
501614
break
@@ -550,20 +663,68 @@ on startCenterAction pAction
550663
case "newScriptOnlyStack"
551664
revIDEActionNewScriptOnlyStack
552665
break
553-
case "newTabletPortrait"
666+
case "newIphoneSE"
667+
revIDEActionNewMainstack "iPhone SE (320x568)"
668+
break
669+
case "newIphone6s78"
670+
revIDEActionNewMainstack "iPhone 6s/7/8 (375x667)"
671+
break
672+
case "newIphone6sPlus7Plus8Plus"
673+
revIDEActionNewMainstack "iPhone 6s+/7+/8+ (414x736)"
674+
break
675+
case "newIphoneXXS11Pro"
676+
revIDEActionNewMainstack "iPhone X/XS/11 Pro (375x812)"
677+
break
678+
case "newIphoneXR11"
679+
revIDEActionNewMainstack "iPhone XR/11 (414x896)"
680+
break
681+
case "newIphoneXSMax11ProMax"
682+
revIDEActionNewMainstack "iPhone XS Max / 11 Pro Max (414x896)"
683+
break
684+
case "android6inchgeneric"
685+
revIDEActionNewMainstack "Generic Android 6-inch Phone (412,775)"
686+
break
687+
case "newTablet9.7portrait"
554688
revIDEActionNewMainstack "iPad/Tablet Portrait (768x1024)"
555689
break
556-
case "newTabletLandscape"
557-
revIDEActionNewMainstack "iPad/Tablet Lanscape (1024x768)"
690+
case "newTablet10.2portrait"
691+
revIDEActionNewMainstack "iPad/Tablet Portrait (810x1080)"
692+
break
693+
case "newTablet10.5portrait"
694+
revIDEActionNewMainstack "iPad/Tablet Portrait (834x1112)"
695+
break
696+
case "newTablet11portrait"
697+
revIDEActionNewMainstack "iPad/Tablet Portrait (834x1194)"
698+
break
699+
case "newTablet12.9portrait"
700+
revIDEActionNewMainstack "iPad 12.9-inch/Tablet Portrait (1024x1366)"
701+
break
702+
case "newTablet10portrait"
703+
revIDEActionNewMainstack "Generic Android 10-inch Tablet Portrait (720x1280)"
704+
break
705+
case "newTablet7portrait"
706+
revIDEActionNewMainstack "Generic Android 7-inch Tablet Portrait (600x1024)"
707+
break
708+
case "newTablet9.7landscape"
709+
revIDEActionNewMainstack "iPad/Tablet Landscape (1024x768)"
710+
break
711+
case "newTablet10.2landscape"
712+
revIDEActionNewMainstack "iPad/Tablet Landscape (1080x810)"
713+
break
714+
case "newTablet10.5landscape"
715+
revIDEActionNewMainstack "iPad/Tablet Landscape (1112x834)"
716+
break
717+
case "newTablet11landscape"
718+
revIDEActionNewMainstack "iPad/Tablet Landscape (1194x834)"
558719
break
559-
case "newIphone6"
560-
revIDEActionNewMainstack "iPhone 6 (375x667)"
720+
case "newTablet12.9landscape"
721+
revIDEActionNewMainstack "iPad 12.9-inch/Tablet Landscape (1366x1024)"
561722
break
562-
case "newIphone5"
563-
revIDEActionNewMainstack "iPhone 5 (320x568)"
723+
case "newTablet10landscape"
724+
revIDEActionNewMainstack "Generic Android 10-inch Tablet Landscape (1280x720)"
564725
break
565-
case "newIphone4"
566-
revIDEActionNewMainstack "iPhone 4 (320x480)"
726+
case "newTablet7landscape"
727+
revIDEActionNewMainstack "Generic Android 7-inch Tablet Landscape (1024x600)"
567728
break
568729
end switch
569730
end startCenterAction

0 commit comments

Comments
 (0)