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

Commit 24998ae

Browse files
Merge pull request #2053 from BerndN/patch-4
refine revinspectorbehavior re manualHeight
2 parents 1750c11 + e68d8e7 commit 24998ae

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

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

Toolset/palettes/inspector/editors/com.livecode.pi.customprops.behavior.livecodescript

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
script "com.livecode.pi.customprops.behavior"
22
local sPropSet, sHilitePath
3-
constant kWidgetHeight = 150
43

54
on editorInitialize
65
put empty into sPropSet
@@ -91,9 +90,10 @@ end editorUpdate
9190
constant kControlGap = 5
9291
constant kKeyFieldHeight = 21
9392
constant kLabelFieldHeight = 21
94-
constant kValueFieldHeight = 63
93+
constant kValueFieldHeight = 126
9594
constant kLabelSize = 50
9695
constant kSetButtonsHeight = 30
96+
constant kWidgetHeight = 150
9797

9898
on editorResize
9999
lock screen
@@ -112,12 +112,15 @@ on editorResize
112112
set the lockLoc of group "Set buttons" of me to true
113113
send "groupResize kLabelSize, kControlGap" to group "Set buttons" of me
114114

115+
local tTopGroupHeight
116+
put the bottom of group "background" into tTopGroupHeight
117+
115118
# Use all space not taken by other elements for main array display
116-
local tWidgetHeight, tValueHeight
119+
local tWidgetHeight, tValueHeight
117120
put kWidgetHeight into tWidgetHeight
118-
put max (the height of this card - ( 12 * kControlGap + kLabelFieldHeight \
121+
put max(the height of this card - ( 6 * kControlGap + kLabelFieldHeight \
119122
+ kKeyFieldHeight + kValueFieldHeight + kSetButtonsHeight \
120-
+ tWidgetHeight), kValueFieldHeight) into tValueHeight
123+
+ tWidgetHeight + tTopGroupHeight), 0) into tValueHeight
121124

122125
set the height of widget 1 of me to tWidgetHeight
123126
set the width of widget 1 of me to the width of me

0 commit comments

Comments
 (0)