Skip to content

Commit

Permalink
- Stronger Rekatu rule for Smalltalk ui theme matching
Browse files Browse the repository at this point in the history
- More fixes on the Smalltalk ui  theme use
- Add class method theme to Model
  • Loading branch information
hilaire committed Sep 15, 2019
1 parent 83c68a6 commit 0f35d3b
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 78 deletions.
5 changes: 0 additions & 5 deletions src/HelpSystem-Core/CustomHelp.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,6 @@ CustomHelp class >> systemIcon [
^self icon
]

{ #category : #accessing }
CustomHelp class >> theme [
^ Smalltalk ui theme
]

{ #category : #formatting }
CustomHelp class >> underlined: aString [
"Return Text object with underlined emphasis."
Expand Down
5 changes: 0 additions & 5 deletions src/HelpSystem-Core/HelpBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ HelpBrowser class >> taskbarIconName [
^ #bookIcon
]

{ #category : #accessing }
HelpBrowser class >> theme [
^ Smalltalk ui theme
]

{ #category : #ui }
HelpBrowser >> close [
window notNil ifTrue: [window delete]
Expand Down
5 changes: 0 additions & 5 deletions src/Morphic-Widgets-Tree/MorphTreeModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ MorphTreeModel class >> itemsList: itemsList itemsHeaderName: aName wrapBlockOrS
yourself
]

{ #category : #accessing }
MorphTreeModel class >> theme [
^ Smalltalk ui theme
]

{ #category : #'keyboard managing' }
MorphTreeModel >> arrowEvent: event key: aChar target: aMorph [
"Give model the capability of handle a key before is handled by MorphTreeListManager"
Expand Down
1 change: 0 additions & 1 deletion src/Morphic-Widgets-Windows/BorderedMorph.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ BorderedMorph >> removeCornerGrips [

{ #category : #'*Morphic-Widgets-Windows' }
BorderedMorph >> removePaneSplitters [

self splitters do: [:each | each delete]
]

Expand Down
2 changes: 1 addition & 1 deletion src/Polymorph-Widgets/Model.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Extension { #name : #Model }

{ #category : #'*Polymorph-Widgets' }
Model >> theme [
^ Smalltalk ui theme
^ self class theme
]
2 changes: 1 addition & 1 deletion src/Polymorph-Widgets/UITheme.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ UITheme class >> cleanUp [
{ #category : #accessing }
UITheme class >> current [
"Answer the current ui theme.
WARNING: Direct access to this method is ill-adviced, use Smalltalk ui theme instead."
WARNING: Direct access to this method is ill-adviced, use self theme instead."

^Current ifNil: [
Current := PharoLightTheme newDefault.
Expand Down
7 changes: 6 additions & 1 deletion src/Renraku/ReThemeAccess.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ ReThemeAccess class >> checksMethod [
^ true
]

{ #category : #'class initialization' }
ReThemeAccess class >> initialize [
" ReRuleManager cleanUp "
]

{ #category : #running }
ReThemeAccess >> basicCheck: aMethod [
^ ((aMethod methodClass inheritsFrom: Morph)
or: [aMethod methodClass inheritsFrom: Model])
and: [aMethod sourceCode includesAll: 'Smalltalk ui theme']
and: [aMethod sourceCode matchesRegex: '.*Smalltalk\s+ui\s+theme.*']

]

Expand Down
11 changes: 3 additions & 8 deletions src/SUnit-UI/TestRunner.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ TestRunner class >> taskbarIconName [
^#testRunnerIcon
]

{ #category : #theme }
TestRunner class >> theme [
^ Smalltalk ui theme
]

{ #category : #actions }
TestRunner >> addDeclaredPackagesUnderTestTo: listOfPackages [
"This method looks for #packageNamesUnderTest method in class side of classes defined packages in listOfPackages.
Expand Down Expand Up @@ -388,7 +383,7 @@ TestRunner >> classSelected: anInteger [
TestRunner >> classesFrame [
^LayoutFrame new
leftFraction: 0.25;
topOffset: (Smalltalk ui theme textFont height + 13);
topOffset: (self theme textFont height + 13);
rightFraction: 0.5;
bottomOffset: self buttonHeight negated
]
Expand Down Expand Up @@ -768,7 +763,7 @@ TestRunner >> packageMenu: aMenu [
TestRunner >> packageSearchFrame [
^LayoutFrame new
rightFraction: 0.25;
bottomFraction: 0 offset: (Smalltalk ui theme textFont height + 6)
bottomFraction: 0 offset: (self theme textFont height + 6)
]

{ #category : #building }
Expand All @@ -794,7 +789,7 @@ TestRunner >> packageSelected: anInteger [
TestRunner >> packagesFrame [
^LayoutFrame new
rightFraction: 0.25;
topOffset: (Smalltalk ui theme textFont height + 13);
topOffset: (self theme textFont height + 13);
bottomOffset: self buttonHeight negated
]

Expand Down
5 changes: 0 additions & 5 deletions src/Settings-Graphics/GraphicFontSettings.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,3 @@ GraphicFontSettings class >> standardFontsSettingsOn: aBuilder [


]

{ #category : #fonts }
GraphicFontSettings class >> theme [
^ Smalltalk ui theme
]
2 changes: 1 addition & 1 deletion src/Spec-Core/AbstractWidgetPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ AbstractWidgetPresenter >> color: aColor [

{ #category : #initialization }
AbstractWidgetPresenter >> defaultColor [
^ Smalltalk ui theme backgroundColor
^ self theme backgroundColor
]

{ #category : #'drag and drop' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec-Core/LabelPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ LabelPresenter class >> title [

{ #category : #initialization }
LabelPresenter >> defaultColor [
^ Smalltalk ui theme textColor
^ self theme textColor
]

{ #category : #api }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec-Core/ListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ ListPresenter >> initializeValueHolders [
multiSelectionHolder := IdentityDictionary new asValueHolder.
multiSelection := false asValueHolder.
allowToSelect := true asValueHolder.
backgroundColorBlock := [ :item :index | Smalltalk ui theme backgroundColor ] asValueHolder.
backgroundColorBlock := [ :item :index | self theme backgroundColor ] asValueHolder.
autoDeselect := true asValueHolder.
listAnnouncer := Announcer new.

Expand Down
6 changes: 3 additions & 3 deletions src/Spec-Core/TreePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,9 @@ TreePresenter >> initialize [
isCheckList := false asValueHolder.
keyStroke := [ :key | ] asValueHolder.
multiSelection := false asValueHolder.
evenRowColor := Smalltalk ui theme backgroundColor asValueHolder.
oddRowColor := Smalltalk ui theme backgroundColor asValueHolder.
preferedPaneColor := Smalltalk ui theme backgroundColor asValueHolder.
evenRowColor := self theme backgroundColor asValueHolder.
oddRowColor := self theme backgroundColor asValueHolder.
preferedPaneColor := self theme backgroundColor asValueHolder.
resizerWidth := 2 asValueHolder.
rowInset := 2 asValueHolder.
iconBlock := [ :each : node | node icon ] asValueHolder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ MorphicTextInputFieldAdapter >> acceptOnCR [
MorphicTextInputFieldAdapter >> adapt: aModel [

super adapt: aModel.
aModel whenBuiltDo: [ :w | w widget color: Smalltalk ui theme backgroundColor ]
aModel whenBuiltDo: [ :w | w widget color: self theme backgroundColor ]
]

{ #category : #factory }
Expand Down
14 changes: 7 additions & 7 deletions src/Spec-MorphicAdapters/ToolDockingBarMorph.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ ToolDockingBarMorph >> adoptMenuGroupModel: aGroupModel first: aBoolean [

aBoolean ifFalse: [
self
addMorphBack: (Smalltalk ui theme newToolSpacerIn: self);
addMorphBack: (Smalltalk ui theme newToolbarHandleIn: self);
addMorphBack: (Smalltalk ui theme newToolSpacerIn: self) ].
addMorphBack: (self theme newToolSpacerIn: self);
addMorphBack: (self theme newToolbarHandleIn: self);
addMorphBack: (self theme newToolSpacerIn: self) ].

controls := OrderedCollection new.
aGroupModel menuItems do: [ :item | self adoptMenuItemModel: item accumulator: controls ].
Expand All @@ -25,14 +25,14 @@ ToolDockingBarMorph >> adoptMenuItemModel: item accumulator: controls [
controls add: button ]
ifNotNil: [
self emptyAccumulator: controls.
self addMorphBack: (Smalltalk ui theme newToolSpacerIn: self).
self addMorphBack: (self theme newToolSpacerIn: self).
self
add: item name
font: Smalltalk ui theme menuBarFont
font: self theme menuBarFont
icon: item icon
help: item description
subMenu: item subMenu buildWithSpecAsPopup.
self addMorphBack: (Smalltalk ui theme newToolSpacerIn: self) ]
self addMorphBack: (self theme newToolSpacerIn: self) ]
]

{ #category : #'*Spec-MorphicAdapters' }
Expand All @@ -47,7 +47,7 @@ ToolDockingBarMorph >> adoptMenuModel: aMenuModel [
{ #category : #'*Spec-MorphicAdapters' }
ToolDockingBarMorph >> buildButtonFor: item [

^ Smalltalk ui theme
^ self theme
newButtonIn: self for: item
getState: nil
action: #performMenuActionWith:
Expand Down
5 changes: 1 addition & 4 deletions src/Spec-MorphicAdapters/WorldPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ WorldPresenter class >> defaultSpec [

{ #category : #private }
WorldPresenter class >> setUpWorld [

World changeProportionalLayout.
World submorphs do: [:e | e delete ].

(Smalltalk at: #PolymorphSystemSettings)
perform: #desktopColor:
with: Smalltalk ui theme backgroundColor.
"((Smalltalk at: #UITheme) perform: #currentSettings) perform: #windowColor: with: (Color r: 0.745 g: 0.745 b: 0.745)."
with: self theme backgroundColor.
(Smalltalk at: #TaskbarMorph) perform: #showTaskbar: with: false
]

Expand Down
5 changes: 5 additions & 0 deletions src/System-Model/Model.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Class {
#category : #'System-Model-Base'
}

{ #category : #accessing }
Model class >> theme [
^ Smalltalk ui theme
]

{ #category : #'dependents-private' }
Model >> actAsExecutor [
"Prepare the receiver to act as executor for any resources associated with it"
Expand Down
2 changes: 1 addition & 1 deletion src/System-Settings-Browser/SettingBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ SettingBrowser >> treeMorphIn: aMorph [
doubleClickSelector: #doubleClick;
rowInset: 6;
columnInset: 6;
rowColorForEven: Smalltalk ui theme lightBackgroundColor;
rowColorForEven: self theme lightBackgroundColor;
yourself.
^ treeMorph buildContents
]
Expand Down
5 changes: 0 additions & 5 deletions src/System-Settings-Browser/SettingTree.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,6 @@ SettingTree >> storeSettingNodes [
self persistence storeSettingNodes
]

{ #category : #theme }
SettingTree >> theme [
^ Smalltalk ui theme
]

{ #category : #querying }
SettingTree >> unclassified [
^ self nodeList select: [:node | node parentName notNil and: [node parentNode isNil]].
Expand Down
5 changes: 0 additions & 5 deletions src/Tool-Base/AbstractTool.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ AbstractTool class >> requestProtocolNameFor: aClass initialAnswer: aString [
^ ui chooseFromOwner: self currentWorld
]

{ #category : #'world menu' }
AbstractTool class >> theme [
^ Smalltalk ui theme
]

{ #category : #class }
AbstractTool >> browseClassRefsOf: aClass [

Expand Down
5 changes: 0 additions & 5 deletions src/Tool-CriticBrowser/CriticBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ CriticBrowser class >> taskbarIconName [
^#smallWarningIcon
]

{ #category : #menu }
CriticBrowser class >> theme [
^ Smalltalk ui theme
]

{ #category : #'user interface' }
CriticBrowser >> addModelItemsToWindowMenu: aMenu [
"Add model-related items to the window menu"
Expand Down
5 changes: 0 additions & 5 deletions src/Tool-FileList/FileList.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,6 @@ FileList class >> taskbarIconName [
^#smallOpenIcon
]

{ #category : #accessing }
FileList class >> theme [
^ Smalltalk ui theme
]

{ #category : #'drag\'n\'drop' }
FileList >> acceptDroppingMorph: aTransferMorph event: evt inMorph: dest [
| oldEntry destDirectory newEntry response |
Expand Down
5 changes: 0 additions & 5 deletions src/Tool-ProcessBrowser/ProcessBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,6 @@ ProcessBrowser class >> terminateProcess: aProcess [

]

{ #category : #theme }
ProcessBrowser class >> theme [
^ Smalltalk ui theme
]

{ #category : #'process control' }
ProcessBrowser class >> unregisterWellKnownProcess: aProcess [
"Remove the first registry entry that matches aProcess. Use
Expand Down
4 changes: 2 additions & 2 deletions src/Tool-Profilers/TimeProfiler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ TimeProfiler >> time [
{ #category : #'UI specific' }
TimeProfiler >> toolBarOn: aWindow [
| uiTheme toolBar |
uiTheme := Smalltalk ui theme.
uiTheme :=self theme.
toolBar := toolBar := aWindow
newToolbar:
{((uiTheme
Expand Down Expand Up @@ -769,7 +769,7 @@ TimeProfiler >> treeMorph [
treeLineDashes: {5. 1};
lineColorBlock: [:node | {Color gray. Color orange. Color brown. Color magenta. Color blue} at: ((node level \\ 5) + 1)];
doubleClickSelector: #browseItem;
rowColorForEven: Smalltalk ui theme lightBackgroundColor;
rowColorForEven: self theme lightBackgroundColor;
yourself

]
Expand Down

0 comments on commit 0f35d3b

Please sign in to comment.