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

Commit 5782258

Browse files
BerndNlivecodepanos
authored andcommitted
[Bug 16933] Adapt icon size to text size in Project Browser (#2104)
* [Bug 16933] Adapt icon size to text size in Project Browser * Update revideprojectbrowsercontrolrowbehavior.livecodescript * Update revideprojectbrowsergrouprowbehavior.livecodescript * Update revideprojectbrowserlibraryrowbehavior.livecodescript * Update revideprojectbrowsersectionrowbehavior.livecodescript * Create bugfix-16933.md
1 parent 3b22722 commit 5782258

6 files changed

+101
-5
lines changed

Toolset/palettes/project browser/behaviors/revideprojectbrowsercontainerrowbehavior.livecodescript

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,26 @@ command connectorResize pControl
485485
set the width of group pControl of me to 20
486486
set the top of group pControl of me to the top of me
487487

488-
set the width of widget "icon" of group pControl of me to 13
488+
local tTextSize, tWidgetSize
489+
put the effective textsize of me into tTextSize
490+
switch
491+
case tTextSize >= 8 and tTextSize < 12
492+
put 11 into tWidgetSize
493+
break
494+
case tTextSize >= 12 and tTextSize < 14
495+
put 13 into tWidgetSize
496+
break
497+
case tTextSize >= 14 and tTextSize < 18
498+
put 15 into tWidgetSize
499+
break
500+
case tTextSize >= 18
501+
put 17 into tWidgetSize
502+
break
503+
default
504+
put 13 into tWidgetSize
505+
end switch
506+
507+
set the width of widget "icon" of group pControl of me to tWidgetSize
489508
set the height of widget "icon" of group pControl of me to the width of widget "icon" of group pControl of me
490509
set the loc of widget "icon" of group pControl of me to the loc of group pControl of me
491510
end connectorResize

Toolset/palettes/project browser/behaviors/revideprojectbrowsercontrolrowbehavior.livecodescript

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,26 @@ command connectorResize pControl
435435
set the width of group pControl of me to 20
436436
set the top of group pControl of me to the top of me
437437

438-
set the width of widget "icon" of group pControl of me to 13
438+
local tTextSize, tWidgetSize
439+
put the effective textsize of me into tTextSize
440+
switch
441+
case tTextSize >= 8 and tTextSize < 12
442+
put 11 into tWidgetSize
443+
break
444+
case tTextSize >= 12 and tTextSize < 14
445+
put 13 into tWidgetSize
446+
break
447+
case tTextSize >= 14 and tTextSize < 18
448+
put 15 into tWidgetSize
449+
break
450+
case tTextSize >= 18
451+
put 17 into tWidgetSize
452+
break
453+
default
454+
put 13 into tWidgetSize
455+
end switch
456+
457+
set the width of widget "icon" of group pControl of me to tWidgetSize
439458
set the height of widget "icon" of group pControl of me to the width of widget "icon" of group pControl of me
440459
set the loc of widget "icon" of group pControl of me to the loc of group pControl of me
441460
end connectorResize

Toolset/palettes/project browser/behaviors/revideprojectbrowsergrouprowbehavior.livecodescript

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,26 @@ command connectorResize pControl
464464
set the width of group pControl of me to 20
465465
set the top of group pControl of me to the top of me
466466

467-
set the width of widget "icon" of group pControl of me to 13
467+
local tTextSize, tWidgetSize
468+
put the effective textsize of me into tTextSize
469+
switch
470+
case tTextSize >= 8 and tTextSize < 12
471+
put 11 into tWidgetSize
472+
break
473+
case tTextSize >= 12 and tTextSize < 14
474+
put 13 into tWidgetSize
475+
break
476+
case tTextSize >= 14 and tTextSize < 18
477+
put 15 into tWidgetSize
478+
break
479+
case tTextSize >= 18
480+
put 17 into tWidgetSize
481+
break
482+
default
483+
put 13 into tWidgetSize
484+
end switch
485+
486+
set the width of widget "icon" of group pControl of me to tWidgetSize
468487
set the height of widget "icon" of group pControl of me to the width of widget "icon" of group pControl of me
469488
set the loc of widget "icon" of group pControl of me to the loc of group pControl of me
470489
end connectorResize

Toolset/palettes/project browser/behaviors/revideprojectbrowserlibraryrowbehavior.livecodescript

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,26 @@ command connectorResize pControl
151151
set the width of group pControl of me to 20
152152
set the top of group pControl of me to the top of me
153153

154-
set the width of widget "icon" of group pControl of me to 13
154+
local tTextSize, tWidgetSize
155+
put the effective textsize of me into tTextSize
156+
switch
157+
case tTextSize >= 8 and tTextSize < 12
158+
put 11 into tWidgetSize
159+
break
160+
case tTextSize >= 12 and tTextSize < 14
161+
put 13 into tWidgetSize
162+
break
163+
case tTextSize >= 14 and tTextSize < 18
164+
put 15 into tWidgetSize
165+
break
166+
case tTextSize >= 18
167+
put 17 into tWidgetSize
168+
break
169+
default
170+
put 13 into tWidgetSize
171+
end switch
172+
173+
set the width of widget "icon" of group pControl of me to tWidgetSize
155174
set the height of widget "icon" of group pControl of me to the width of widget "icon" of group pControl of me
156175
set the loc of widget "icon" of group pControl of me to the loc of group pControl of me
157176
end connectorResize

Toolset/palettes/project browser/behaviors/revideprojectbrowsersectionrowbehavior.livecodescript

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,26 @@ command connectorResize pControl
117117
set the width of group pControl of me to 20
118118
set the top of group pControl of me to the top of me
119119

120-
set the width of widget "icon" of group pControl of me to 13
120+
local tTextSize, tWidgetSize
121+
put the effective textsize of me into tTextSize
122+
switch
123+
case tTextSize >= 8 and tTextSize < 12
124+
put 11 into tWidgetSize
125+
break
126+
case tTextSize >= 12 and tTextSize < 14
127+
put 13 into tWidgetSize
128+
break
129+
case tTextSize >= 14 and tTextSize < 18
130+
put 15 into tWidgetSize
131+
break
132+
case tTextSize >= 18
133+
put 17 into tWidgetSize
134+
break
135+
default
136+
put 13 into tWidgetSize
137+
end switch
138+
139+
set the width of widget "icon" of group pControl of me to tWidgetSize
121140
set the height of widget "icon" of group pControl of me to the width of widget "icon" of group pControl of me
122141
set the loc of widget "icon" of group pControl of me to the loc of group pControl of me
123142
end connectorResize

notes/bugfix-16933.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Adapt icon size to text size in Project Browser

0 commit comments

Comments
 (0)