From 729f10dfe6db1043af3872234f8c7b0256047a71 Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Sun, 3 Dec 2023 23:22:21 +0100 Subject: [PATCH 1/5] Reworked #labelGraphic: and #labelGraphic on IconicButtonMorph to #labelFormSet: and #labelFormSet. --- .../IconicButtonMorph.class.st | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Morphic-Widgets-Basic/IconicButtonMorph.class.st b/src/Morphic-Widgets-Basic/IconicButtonMorph.class.st index bf4fc3caa74..61a1ef4630b 100644 --- a/src/Morphic-Widgets-Basic/IconicButtonMorph.class.st +++ b/src/Morphic-Widgets-Basic/IconicButtonMorph.class.st @@ -120,6 +120,24 @@ IconicButtonMorph >> interactSelector [ ^ #interact ] +{ #category : 'accessing' } +IconicButtonMorph >> labelFormSet [ + + ^ graphicalMorph formSet +] + +{ #category : 'accessing' } +IconicButtonMorph >> labelFormSet: aFormSet [ + "Changed to look for any image morph rather than just a sketch." + + graphicalMorph ifNotNil: [graphicalMorph delete]. + graphicalMorph := ImageMorph new formSet: aFormSet. + self extent: graphicalMorph extent + (self borderWidth + self extraBorder). + graphicalMorph position: self center - (graphicalMorph extent // 2). + self addMorph: graphicalMorph. + graphicalMorph lock +] + { #category : 'accessing' } IconicButtonMorph >> labelFromString: aString [ "Make an iconic label from aString" @@ -130,19 +148,13 @@ IconicButtonMorph >> labelFromString: aString [ { #category : 'accessing' } IconicButtonMorph >> labelGraphic [ - ^ graphicalMorph form + ^ self labelFormSet asForm ] { #category : 'accessing' } IconicButtonMorph >> labelGraphic: aForm [ - "Changed to look for any image morph rather than just a sketch." - graphicalMorph ifNotNil: [graphicalMorph delete]. - graphicalMorph := ImageMorph new form: aForm. - self extent: graphicalMorph extent + (self borderWidth + self extraBorder). - graphicalMorph position: self center - (graphicalMorph extent // 2). - self addMorph: graphicalMorph. - graphicalMorph lock + ^ self labelFormSet: (FormSet form: aForm) ] { #category : 'mouse events' } From c301f49aed9adfe3262be9ce6bda74e38f469693 Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Sun, 3 Dec 2023 23:23:45 +0100 Subject: [PATCH 2/5] Made #buildEditButton and #buildResetButton on ClyProtocolEditorMorph use the FormSet for the icon. --- src/Calypso-SystemTools-Core/ClyProtocolEditorMorph.class.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Calypso-SystemTools-Core/ClyProtocolEditorMorph.class.st b/src/Calypso-SystemTools-Core/ClyProtocolEditorMorph.class.st index 722878b92d5..10285ca4161 100644 --- a/src/Calypso-SystemTools-Core/ClyProtocolEditorMorph.class.st +++ b/src/Calypso-SystemTools-Core/ClyProtocolEditorMorph.class.st @@ -58,7 +58,7 @@ ClyProtocolEditorMorph >> buildEditButton [ target: self; actionSelector: #openEditor; arguments: #(); - labelGraphic: (self iconNamed: #edit); + labelFormSet: (self iconFormSetNamed: #edit); color: Color transparent; borderWidth: 0 ] @@ -93,7 +93,7 @@ ClyProtocolEditorMorph >> buildResetButton [ target: self; actionSelector: #resetProtocolAndPackage; arguments: #(); - labelGraphic: (self iconNamed: #glamorousClose); + labelFormSet: (self iconFormSetNamed: #glamorousClose); color: Color transparent; borderWidth: 0; hResizing: #shinkWrap; From 62bcd8d873da95884d497426ed741d257035ed26 Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Sun, 3 Dec 2023 23:25:06 +0100 Subject: [PATCH 3/5] Made #build on ClyToolContextNavigatorMorph use the FormSet for each of the icons. --- src/Calypso-Browser/ClyToolContextNavigatorMorph.class.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Calypso-Browser/ClyToolContextNavigatorMorph.class.st b/src/Calypso-Browser/ClyToolContextNavigatorMorph.class.st index a3614f40b07..c30676f7218 100644 --- a/src/Calypso-Browser/ClyToolContextNavigatorMorph.class.st +++ b/src/Calypso-Browser/ClyToolContextNavigatorMorph.class.st @@ -23,13 +23,13 @@ ClyToolContextNavigatorMorph >> build [ | goButton contextLabel | contextLabel := ownerTool printContext. contextLabel ifEmpty: [ ^self ]. "if ownerTool not defines meaningfull context name we ignore it" - self addMorphBack: (self iconNamed: #uncommentedClass) asMorph. + self addMorphBack: (self iconFormSetNamed: #uncommentedClass) asMorph. self addMorphBack: contextLabel asMorph. goButton := IconicButtonMorph new target: self; actionSelector: #restoreBrowserState; arguments: {}; - labelGraphic: (self iconNamed: #forward); + labelFormSet: (self iconFormSetNamed: #forward); color: Color transparent; helpText: 'Move browser to ', contextLabel; borderWidth: 0. From c63eaf0443daf900c8f67b939b1051d521dcff40 Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Sun, 3 Dec 2023 23:26:45 +0100 Subject: [PATCH 4/5] Made #expandedButton and #collapsedButton on ClyMainItemCellMorph use the FormSet for the expand/collapse toggle. --- src/Calypso-Browser/ClyMainItemCellMorph.class.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Calypso-Browser/ClyMainItemCellMorph.class.st b/src/Calypso-Browser/ClyMainItemCellMorph.class.st index 4dc20db0b2e..daa51bfe6f1 100644 --- a/src/Calypso-Browser/ClyMainItemCellMorph.class.st +++ b/src/Calypso-Browser/ClyMainItemCellMorph.class.st @@ -159,7 +159,7 @@ ClyMainItemCellMorph >> collapsedButton [ target: item; actionSelector: #expand; arguments: {}; - labelGraphic: self theme treeUnexpandedForm; + labelFormSet: self theme treeUnexpandedFormSet; color: Color transparent; helpText: 'Expand Item'; borderWidth: 0 @@ -212,7 +212,7 @@ ClyMainItemCellMorph >> expandedButton [ target: item; actionSelector: #collapse; arguments: {}; - labelGraphic: self theme treeExpandedForm; + labelFormSet: self theme treeExpandedFormSet; color: Color transparent; helpText: 'Unexpand Item'; borderWidth: 0 From 7329e0c219ecfc488959f8e6b65c061eee646a4a Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Sun, 3 Dec 2023 23:30:24 +0100 Subject: [PATCH 5/5] Made #expandedButton and #collpasedButton on FTBasicItem use the FormSet for the expand/collapse toggle. --- src/Morphic-Widgets-FastTable/FTBasicItem.class.st | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Morphic-Widgets-FastTable/FTBasicItem.class.st b/src/Morphic-Widgets-FastTable/FTBasicItem.class.st index cc7764f0df2..d055b1c0240 100644 --- a/src/Morphic-Widgets-FastTable/FTBasicItem.class.st +++ b/src/Morphic-Widgets-FastTable/FTBasicItem.class.st @@ -52,8 +52,8 @@ Class { } { #category : 'expanding-collapsing' } -FTBasicItem class >> expandedForm [ - ^ self theme treeExpandedForm +FTBasicItem class >> expandedFormSet [ + ^ self theme treeExpandedFormSet ] { #category : 'accessing' } @@ -62,8 +62,8 @@ FTBasicItem class >> theme [ ] { #category : 'expanding-collapsing' } -FTBasicItem class >> unexpandedForm [ - ^ self theme treeUnexpandedForm +FTBasicItem class >> unexpandedFormSet [ + ^ self theme treeUnexpandedFormSet ] { #category : 'accessing' } @@ -125,7 +125,7 @@ FTBasicItem >> collpasedButton [ target: self; actionSelector: #expandAndRefresh; arguments: {}; - labelGraphic: self class unexpandedForm; + labelFormSet: self class unexpandedFormSet; color: Color transparent; helpText: 'Expand Item'; borderWidth: 0 @@ -199,7 +199,7 @@ FTBasicItem >> expandedButton [ target: self; actionSelector: #collapseAndRefresh; arguments: {}; - labelGraphic: self class expandedForm; + labelFormSet: self class expandedFormSet; color: Color transparent; helpText: 'Unexpand Item'; borderWidth: 0