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

Commit cfbe3da

Browse files
Merge pull request #1670 from livecode/bugfix-20040
[[ Tutorial ]] Use smaller images in To Do List tutorial
2 parents 5f77068 + 5790c72 commit cfbe3da

8 files changed

Lines changed: 19 additions & 1 deletion

File tree

13.5 KB
Loading
13.2 KB
Loading
16.6 KB
Loading
15.8 KB
Loading
9.75 KB
Loading
7.01 KB
Loading

Toolset/palettes/tutorial/revtutorial.livecodescript

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ on revTutorialConfigureMessage pData
21352135
local tImageFile
21362136
if pData["image"] is not empty then
21372137
local tImageWidth
2138-
put revIDETutorialInternalResource(pData["image"]) into tImageFile
2138+
put revTutorialImageForScreenSize(pData["image"]) into tImageFile
21392139
set the filename of image "Image" of stack "revTutorial" to tImageFile
21402140
put the formattedWidth of image "Image" of stack "revTutorial" + 2 * kMargin into tImageWidth
21412141
put max(tWidthOverride, tImageWidth) into tWidthOverride
@@ -2173,6 +2173,23 @@ on revTutorialConfigureMessage pData
21732173
revTutorialPositionStack "", "", tWidthOverride, false
21742174
end revTutorialConfigureMessage
21752175

2176+
function revTutorialImageForScreenSize pImage
2177+
local tScreen, tScreenRect
2178+
put the screen of stack "revTutorial" into tScreen
2179+
put line tScreen of the the screenrects into tScreenRect
2180+
if item 4 of tScreenRect - item 2 of tScreenRect <= 1080 then
2181+
local tSmallImage, tFile
2182+
put pImage into tSmallImage
2183+
set the itemdelimiter to "."
2184+
put "_small" after item -2 of tSmallImage
2185+
put revIDETutorialInternalResource(tSmallImage) into tFile
2186+
if there is a file tFile then
2187+
return tFile
2188+
end if
2189+
end if
2190+
return revIDETutorialInternalResource(pImage)
2191+
end revTutorialImageForScreenSize
2192+
21762193
function revTutorialScriptRetry pCurrent
21772194
local tText
21782195
put "Your script is not quite right. You have:" & return & return after tText

notes/bugfix-20040.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Use smaller images of todo list on smaller screens

0 commit comments

Comments
 (0)