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

Commit e6b492d

Browse files
authored
refine revinspectorbehavior re manualHeight
Make sure manual height is not accidentally set when clicking in a stacks title bar by making sure PI is activated (resumed) when changing manual height. Remove option to cancel manualHeight by changing height of e.g. "text" to smaler and then full height.
1 parent 4c964c9 commit e6b492d

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

Toolset/palettes/behaviors/revinspectorbehavior.livecodescript

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ constant kMaxLabelSize = 200
44
# The inspector data
55
local sDataA
66

7+
# used by manualHeight
8+
local sStackIsInFront
9+
710
on setAsBehavior pTarget
811
dispatch "setAsBehavior" to revIDEFrameBehavior() with the long id of this me
912
set the behavior of pTarget to the long id of this me
@@ -36,6 +39,7 @@ before openStack
3639
end repeat
3740
set the stackfiles of me to tStackFiles
3841
revIDEPopDefaultFolder
42+
put true into sStackIsInFront
3943
end openStack
4044

4145
on resizeInspector
@@ -180,7 +184,8 @@ local sManualHeightOfStack, sNewHeight, sOldHeight
180184
on inspectorLayoutGroups pGroupList, pForceHeight
181185

182186
# store height of stack when manually resizing
183-
if pForceHeight is not true and the mouse is "down" and sNewHeight is not sOldHeight then
187+
if pForceHeight is not true and the mouse is "down" \
188+
and sNewHeight is not sOldHeight and the mouseStack is empty and sStackIsInFront then
184189
put the height of this stack into sManualHeightOfStack
185190
end if
186191

@@ -277,7 +282,11 @@ on inspectorLayoutGroups pGroupList, pForceHeight
277282

278283
local tStackHeight
279284
if tInspectorHeight is empty then
280-
put kInspectorMinHeight into tStackHeight
285+
if sManualHeightOfStack is not empty then
286+
put sManualHeightOfStack into tStackHeight
287+
else
288+
put kInspectorMinHeight into tStackHeight
289+
end if
281290
else
282291
put tInspectorHeight + tMargin into tStackHeight
283292
end if
@@ -288,11 +297,6 @@ on inspectorLayoutGroups pGroupList, pForceHeight
288297
set the maxheight of me to tStackHeight
289298
end if
290299

291-
# reset manualHeight if user expands a non-expandable tab to full height
292-
if not pForceHeight and not tCanExpand and sManualHeightOfStack is tStackHeight then
293-
put empty into sManualHeightOfStack
294-
end if
295-
296300
-- Make stack smaller rather than go offscreen
297301
local tScreenRect, tNewStackHeight
298302
put revIDEStackScreenRect(the long id of me, true) into tScreenRect
@@ -343,6 +347,16 @@ before resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
343347
pass resizeStack
344348
end resizeStack
345349

350+
on resumeStack
351+
put true into sStackIsInFront
352+
pass resumeStack
353+
end resumeStack
354+
355+
on suspendStack
356+
put false into sStackIsInFront
357+
pass suspendStack
358+
end suspendStack
359+
346360
function getManualHeight
347361
return sManualHeightOfStack
348362
end getManualHeight

0 commit comments

Comments
 (0)