Skip to content

Commit a467804

Browse files
committed
Better hover text
1 parent ba16cf7 commit a467804

1 file changed

Lines changed: 76 additions & 72 deletions

File tree

src/Molecule-IDE/MolComponentImpl.extension.st

Lines changed: 76 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ Extension { #name : #MolComponentImpl }
44
MolComponentImpl >> asRSMoleculeShape [
55

66
| implementationLabel componentNameLabel contracts composite componentTypeLabel componentNameText |
7-
87
componentTypeLabel := RSLabel new
9-
text: (self class componentType asString);
10-
color: Color black;
11-
bold;
12-
fontSize: 18;
13-
yourself.
14-
8+
text: self class componentType asString;
9+
color: Color black;
10+
bold;
11+
fontSize: 18;
12+
yourself.
13+
14+
implementationLabel := RSLabel new
15+
text: self className;
16+
color: Color black lighter lighter;
17+
italic;
18+
fontSize: 12;
19+
yourself.
20+
1521
"don't display the default name to have better visual identification of named components"
16-
componentNameText := self componentName = (MolUtils defaultComponentName)
17-
ifTrue:[ '' ]
18-
ifFalse:[ '#', self componentName ].
19-
22+
componentNameText := self componentName
23+
= MolUtils defaultComponentName
24+
ifTrue: [ '' ]
25+
ifFalse: [ '#' , self componentName ].
26+
2027
componentNameLabel := RSLabel new
2128
text: componentNameText;
2229
color: Color black lighter;
2330
fontSize: 16;
2431
yourself.
2532

26-
implementationLabel := RSLabel new
27-
text: (self className);
28-
color: Color black lighter lighter;
29-
italic;
30-
fontSize: 12;
31-
yourself.
32-
3333
contracts := MolComponentToRoassal makeContractShapesFor: self.
3434

3535
RSVerticalLineLayout new
@@ -42,71 +42,75 @@ MolComponentImpl >> asRSMoleculeShape [
4242

4343
composite := RSComposite new
4444
draggable;
45-
popupText: [ :comp | comp componentName ];
45+
popupText: [ :comp |
46+
'Type: <1s><r>Impl: <2s><r>Name: <3s>'
47+
expandMacrosWith: comp class componentType asString
48+
with: comp className asString
49+
with: comp componentName asString ];
4650
model: self;
4751
withBorder;
4852
color: Color gray muchLighter;
4953
shapes: {
5054
componentTypeLabel.
5155
implementationLabel.
52-
componentNameLabel.
56+
componentNameLabel.
5357
contracts };
5458
yourself.
5559
composite adjustToChildren.
5660
composite extent: composite extent + (0 @ 20).
5761
composite @ (RSMenuActivable new menuDo: [ :aMenuMorph :anRSBox |
58-
(aMenuMorph
59-
add: 'Inspect component'
60-
target: self
61-
selector: #inspect
62-
argument: #( )) icon:
63-
(Smalltalk ui icons iconNamed: #smallInspectIt).
64-
(aMenuMorph
65-
add: 'Browse component'
66-
target: self
67-
selector: #browse
68-
argument: #( )) icon: (Smalltalk ui icons iconNamed: #nautilus).
69-
(aMenuMorph
70-
add: 'Inspect component type implementors'
71-
target: self
72-
selector: #showComponentTypeImplementor
73-
argument: #( )) icon: (Smalltalk ui icons iconNamed: #dropDown).
74-
aMenuMorph addSeparator.
75-
(aMenuMorph
76-
add: 'Break once when state switch to #initialize'
77-
target: self class
78-
selector: #breakOnceOnComponentInitialize) icon:
79-
(Smalltalk ui icons iconNamed: #halt).
80-
(aMenuMorph
81-
add: 'Break once when state switch to #activate'
82-
target: self class
83-
selector: #breakOnceOnComponentActivate) icon:
84-
(Smalltalk ui icons iconNamed: #halt).
85-
(aMenuMorph
86-
add: 'Break once when state switch to #passivate'
87-
target: self class
88-
selector: #breakOnceOnComponentPassivate) icon:
89-
(Smalltalk ui icons iconNamed: #halt).
90-
(aMenuMorph
91-
add: 'Break once when state switch to #remove'
92-
target: self class
93-
selector: #breakOnceOnComponentRemove) icon:
94-
(Smalltalk ui icons iconNamed: #halt).
95-
(aMenuMorph
96-
add: 'Break once when this component state switch to #activate'
97-
target: self
98-
selector: #breakObjectOrientedOnceOnComponentActivate) icon:
99-
(Smalltalk ui icons iconNamed: #bug).
100-
(aMenuMorph
101-
add: 'Break once when state this component switch to #passivate'
102-
target: self
103-
selector: #breakObjectOrientedOnceOnComponentPassivate) icon:
104-
(Smalltalk ui icons iconNamed: #bug).
105-
(aMenuMorph
106-
add: 'Break once when state this component switch to #remove'
107-
target: self
108-
selector: #breakObjectOrientedOnceOnComponentRemove) icon:
109-
(Smalltalk ui icons iconNamed: #bug) ]).
62+
(aMenuMorph
63+
add: 'Inspect component'
64+
target: self
65+
selector: #inspect
66+
argument: #( )) icon:
67+
(Smalltalk ui icons iconNamed: #smallInspectIt).
68+
(aMenuMorph
69+
add: 'Browse component'
70+
target: self
71+
selector: #browse
72+
argument: #( )) icon: (Smalltalk ui icons iconNamed: #nautilus).
73+
(aMenuMorph
74+
add: 'Inspect component type implementors'
75+
target: self
76+
selector: #showComponentTypeImplementor
77+
argument: #( )) icon: (Smalltalk ui icons iconNamed: #dropDown).
78+
aMenuMorph addSeparator.
79+
(aMenuMorph
80+
add: 'Break once when state switch to #initialize'
81+
target: self class
82+
selector: #breakOnceOnComponentInitialize) icon:
83+
(Smalltalk ui icons iconNamed: #halt).
84+
(aMenuMorph
85+
add: 'Break once when state switch to #activate'
86+
target: self class
87+
selector: #breakOnceOnComponentActivate) icon:
88+
(Smalltalk ui icons iconNamed: #halt).
89+
(aMenuMorph
90+
add: 'Break once when state switch to #passivate'
91+
target: self class
92+
selector: #breakOnceOnComponentPassivate) icon:
93+
(Smalltalk ui icons iconNamed: #halt).
94+
(aMenuMorph
95+
add: 'Break once when state switch to #remove'
96+
target: self class
97+
selector: #breakOnceOnComponentRemove) icon:
98+
(Smalltalk ui icons iconNamed: #halt).
99+
(aMenuMorph
100+
add: 'Break once when this component state switch to #activate'
101+
target: self
102+
selector: #breakObjectOrientedOnceOnComponentActivate) icon:
103+
(Smalltalk ui icons iconNamed: #bug).
104+
(aMenuMorph
105+
add: 'Break once when state this component switch to #passivate'
106+
target: self
107+
selector: #breakObjectOrientedOnceOnComponentPassivate) icon:
108+
(Smalltalk ui icons iconNamed: #bug).
109+
(aMenuMorph
110+
add: 'Break once when state this component switch to #remove'
111+
target: self
112+
selector: #breakObjectOrientedOnceOnComponentRemove) icon:
113+
(Smalltalk ui icons iconNamed: #bug) ]).
110114

111115

112116
^ composite

0 commit comments

Comments
 (0)