From ba16cf709b147bf9ca55ccdbfd94b3aa2d14ae2f Mon Sep 17 00:00:00 2001 From: Pierre Laborde Date: Wed, 22 Apr 2026 17:51:56 +0200 Subject: [PATCH 1/2] Implement issue #239: Inspector Graph: better component titles --- .../MolComponentImpl.extension.st | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/Molecule-IDE/MolComponentImpl.extension.st b/src/Molecule-IDE/MolComponentImpl.extension.st index abd7f34..e8dc490 100644 --- a/src/Molecule-IDE/MolComponentImpl.extension.st +++ b/src/Molecule-IDE/MolComponentImpl.extension.st @@ -3,26 +3,41 @@ Extension { #name : #MolComponentImpl } { #category : #'*Molecule-IDE' } MolComponentImpl >> asRSMoleculeShape [ - | classNameLabel componentNameLabel contracts composite | - classNameLabel := RSLabel new - text: self className; - color: Color black lighter lighter; - italic; - fontSize: 14; + | implementationLabel componentNameLabel contracts composite componentTypeLabel componentNameText | + + componentTypeLabel := RSLabel new + text: (self class componentType asString); + color: Color black; + bold; + fontSize: 18; yourself. + + "don't display the default name to have better visual identification of named components" + componentNameText := self componentName = (MolUtils defaultComponentName) + ifTrue:[ '' ] + ifFalse:[ '#', self componentName ]. + componentNameLabel := RSLabel new - text: self componentName; - color: Color black; - fontSize: 18; + text: componentNameText; + color: Color black lighter; + fontSize: 16; yourself. + implementationLabel := RSLabel new + text: (self className); + color: Color black lighter lighter; + italic; + fontSize: 12; + yourself. + contracts := MolComponentToRoassal makeContractShapesFor: self. RSVerticalLineLayout new alignCenter; on: { + componentTypeLabel. + implementationLabel. componentNameLabel. - classNameLabel. contracts }. composite := RSComposite new @@ -32,8 +47,9 @@ MolComponentImpl >> asRSMoleculeShape [ withBorder; color: Color gray muchLighter; shapes: { - componentNameLabel. - classNameLabel. + componentTypeLabel. + implementationLabel. + componentNameLabel. contracts }; yourself. composite adjustToChildren. From a4678048eabfcae2ed2deddd7fe6cde3e017b23d Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Thu, 30 Apr 2026 11:26:40 +0200 Subject: [PATCH 2/2] Better hover text --- .../MolComponentImpl.extension.st | 148 +++++++++--------- 1 file changed, 76 insertions(+), 72 deletions(-) diff --git a/src/Molecule-IDE/MolComponentImpl.extension.st b/src/Molecule-IDE/MolComponentImpl.extension.st index e8dc490..ca9cedf 100644 --- a/src/Molecule-IDE/MolComponentImpl.extension.st +++ b/src/Molecule-IDE/MolComponentImpl.extension.st @@ -4,32 +4,32 @@ Extension { #name : #MolComponentImpl } MolComponentImpl >> asRSMoleculeShape [ | implementationLabel componentNameLabel contracts composite componentTypeLabel componentNameText | - componentTypeLabel := RSLabel new - text: (self class componentType asString); - color: Color black; - bold; - fontSize: 18; - yourself. - + text: self class componentType asString; + color: Color black; + bold; + fontSize: 18; + yourself. + + implementationLabel := RSLabel new + text: self className; + color: Color black lighter lighter; + italic; + fontSize: 12; + yourself. + "don't display the default name to have better visual identification of named components" - componentNameText := self componentName = (MolUtils defaultComponentName) - ifTrue:[ '' ] - ifFalse:[ '#', self componentName ]. - + componentNameText := self componentName + = MolUtils defaultComponentName + ifTrue: [ '' ] + ifFalse: [ '#' , self componentName ]. + componentNameLabel := RSLabel new text: componentNameText; color: Color black lighter; fontSize: 16; yourself. - implementationLabel := RSLabel new - text: (self className); - color: Color black lighter lighter; - italic; - fontSize: 12; - yourself. - contracts := MolComponentToRoassal makeContractShapesFor: self. RSVerticalLineLayout new @@ -42,71 +42,75 @@ MolComponentImpl >> asRSMoleculeShape [ composite := RSComposite new draggable; - popupText: [ :comp | comp componentName ]; + popupText: [ :comp | + 'Type: <1s>Impl: <2s>Name: <3s>' + expandMacrosWith: comp class componentType asString + with: comp className asString + with: comp componentName asString ]; model: self; withBorder; color: Color gray muchLighter; shapes: { componentTypeLabel. implementationLabel. - componentNameLabel. + componentNameLabel. contracts }; yourself. composite adjustToChildren. composite extent: composite extent + (0 @ 20). composite @ (RSMenuActivable new menuDo: [ :aMenuMorph :anRSBox | - (aMenuMorph - add: 'Inspect component' - target: self - selector: #inspect - argument: #( )) icon: - (Smalltalk ui icons iconNamed: #smallInspectIt). - (aMenuMorph - add: 'Browse component' - target: self - selector: #browse - argument: #( )) icon: (Smalltalk ui icons iconNamed: #nautilus). - (aMenuMorph - add: 'Inspect component type implementors' - target: self - selector: #showComponentTypeImplementor - argument: #( )) icon: (Smalltalk ui icons iconNamed: #dropDown). - aMenuMorph addSeparator. - (aMenuMorph - add: 'Break once when state switch to #initialize' - target: self class - selector: #breakOnceOnComponentInitialize) icon: - (Smalltalk ui icons iconNamed: #halt). - (aMenuMorph - add: 'Break once when state switch to #activate' - target: self class - selector: #breakOnceOnComponentActivate) icon: - (Smalltalk ui icons iconNamed: #halt). - (aMenuMorph - add: 'Break once when state switch to #passivate' - target: self class - selector: #breakOnceOnComponentPassivate) icon: - (Smalltalk ui icons iconNamed: #halt). - (aMenuMorph - add: 'Break once when state switch to #remove' - target: self class - selector: #breakOnceOnComponentRemove) icon: - (Smalltalk ui icons iconNamed: #halt). - (aMenuMorph - add: 'Break once when this component state switch to #activate' - target: self - selector: #breakObjectOrientedOnceOnComponentActivate) icon: - (Smalltalk ui icons iconNamed: #bug). - (aMenuMorph - add: 'Break once when state this component switch to #passivate' - target: self - selector: #breakObjectOrientedOnceOnComponentPassivate) icon: - (Smalltalk ui icons iconNamed: #bug). - (aMenuMorph - add: 'Break once when state this component switch to #remove' - target: self - selector: #breakObjectOrientedOnceOnComponentRemove) icon: - (Smalltalk ui icons iconNamed: #bug) ]). + (aMenuMorph + add: 'Inspect component' + target: self + selector: #inspect + argument: #( )) icon: + (Smalltalk ui icons iconNamed: #smallInspectIt). + (aMenuMorph + add: 'Browse component' + target: self + selector: #browse + argument: #( )) icon: (Smalltalk ui icons iconNamed: #nautilus). + (aMenuMorph + add: 'Inspect component type implementors' + target: self + selector: #showComponentTypeImplementor + argument: #( )) icon: (Smalltalk ui icons iconNamed: #dropDown). + aMenuMorph addSeparator. + (aMenuMorph + add: 'Break once when state switch to #initialize' + target: self class + selector: #breakOnceOnComponentInitialize) icon: + (Smalltalk ui icons iconNamed: #halt). + (aMenuMorph + add: 'Break once when state switch to #activate' + target: self class + selector: #breakOnceOnComponentActivate) icon: + (Smalltalk ui icons iconNamed: #halt). + (aMenuMorph + add: 'Break once when state switch to #passivate' + target: self class + selector: #breakOnceOnComponentPassivate) icon: + (Smalltalk ui icons iconNamed: #halt). + (aMenuMorph + add: 'Break once when state switch to #remove' + target: self class + selector: #breakOnceOnComponentRemove) icon: + (Smalltalk ui icons iconNamed: #halt). + (aMenuMorph + add: 'Break once when this component state switch to #activate' + target: self + selector: #breakObjectOrientedOnceOnComponentActivate) icon: + (Smalltalk ui icons iconNamed: #bug). + (aMenuMorph + add: 'Break once when state this component switch to #passivate' + target: self + selector: #breakObjectOrientedOnceOnComponentPassivate) icon: + (Smalltalk ui icons iconNamed: #bug). + (aMenuMorph + add: 'Break once when state this component switch to #remove' + target: self + selector: #breakObjectOrientedOnceOnComponentRemove) icon: + (Smalltalk ui icons iconNamed: #bug) ]). ^ composite