pharo icon indicating copy to clipboard operation
pharo copied to clipboard

#dialog: method of setting builder is bound to Morphic

Open jecisc opened this issue 1 year ago • 2 comments

I found that some settings are using a method named #dialog:. This method expect that a morph get returned and this bind the settings to Morphic.

Since we need to replace Morphic, this should be updated. I'm not yet sure what is the best way to replace it. Maybe with Spec instead of Morphic?

jecisc avatar Jun 24 '24 14:06 jecisc

It would involve replacing the backend packages which uses Morphs:

  • [X] Create SHStylePresenter to replace SHPreferences class>>#styleTableRow
  • [x] Replace ShortcutReminder>>#createResetCountButtonMorph
  • [x] Replace IceTipCredentialsSettings class>>#settingsOn:
  • [x] Replace GraphicFontSettings class>>#fontSizeRow
  • [x] Replace FreeTypeSystemSettings class>>#ft2LibraryVersion
  • [x] Replace ThemeIcons class>>#createSettingRow
  • [x] Replace ReSettings class>>#resetButtonSettingsOn:

hernanmd avatar Jul 30 '24 16:07 hernanmd

Today I checked how this works. I leave here some notes as I work on this front.

The dialog is a Block, that is, it works as a callback. And it must respond to a Morphic created in Polymorph (e.g. createSettingRow).

The problem is that SettingNode is so glued to Morphic, that you can't even reply to an object that is not a Morph (see e.g. inputMorphFor:). Even the message string that replies to a Morph that will be placed in a Morph container of rows, is a bit strange since it forces to always ask if it is nil:

SettingNode>>inputMorphFor: -> ifNotNil:
SettingDeclaration>>inputMorphFor: -> ifNotNil:
SettingDeclaration>>inputWidget -> ifNotNil:

So replacing the dialog callback with something that opens a window with Spec is a bit impractical for now, as it requires completely re-architecting the old SettingBrowser.

My plan here is to create a SettingBrowser-Morphic package, move all the code that depends on Morphic there, and then it will be easier to disassemble the dependency to Morphic.

hernanmd avatar Aug 12 '24 21:08 hernanmd