-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update after selection in Color Picker #766
Merged
Ducasse
merged 2 commits into
pharo-spec:Pharo13
from
hernanmd:fix_st_browser_color_update
Jun 13, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,21 +10,23 @@ SettingDeclaration >> asSettingPresenter [ | |
] | ||
|
||
{ #category : '*NewTools-SettingsBrowser' } | ||
SettingDeclaration >> getColor [ | ||
SettingDeclaration >> getColorFor: aPresenter [ | ||
|
||
(SpPresenter new instantiate: SpColorPickerWindow on: self) | ||
whenColorChangedDo: [ : c | | ||
| colorPickerPresenter | | ||
|
||
colorPickerPresenter := aPresenter instantiate: SpColorPickerWindow on: self. | ||
colorPickerPresenter | ||
whenChangedDo: [ : c | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer real names "aColor" or something like that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, I will address the changes in a new issue. |
||
| changedAspect | | ||
"First we need to get the setter selector, then apply it" | ||
"Some settings are built 'customized' configuring its setter in a different way than using #targetSelector (see #customSettingsOn:)" | ||
self targetSelector | ||
ifNil: [ | ||
self realTarget perform: self name asMutator with: c. | ||
self realTarget perform: self name asMutator with: c value. | ||
changedAspect := self realTarget ] | ||
ifNotNil: [ | ||
changedAspect := self realTarget perform: self targetSelector. | ||
changedAspect perform: self setSelector with: c. ]. | ||
|
||
self announcer announce: (StSettingsChanged new aspect: changedAspect value: c) ]; | ||
changedAspect perform: self setSelector with: c value. ]. | ||
aPresenter updateColor: c value ]; | ||
open | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is equivallent to just
StSettingSHStyleButtonColorPresenterItem on: aSettingDeclaration
, no need of the bureaucracy... and in any case is not recommended to do it like that. Which is the application that presenter belongs to?(this still can work if you will after add that presenter to another that knows its app, or set the app, but as is, it doesn't)
The recommended way of doing this is by passing a builder (see
SpPresenterBuilder
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'll address the suggested changes in a new issue