[squeak-dev] The Trunk: ToolBuilder-Morphic-mt.308.mcz
christoph.thiede at student.hpi.uni-potsdam.de
christoph.thiede at student.hpi.uni-potsdam.de
Wed Apr 6 16:44:20 UTC 2022
Hi Marcel,
is it intended that this also affects the comment/inheritance/reorganize modes of browsers? They are not really code ...
Best,
Christoph
---
Sent from Squeak Inbox Talk
On 2022-03-14T15:39:08+00:00, commits at source.squeak.org wrote:
> Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
> http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.308.mcz
>
> ==================== Summary ====================
>
> Name: ToolBuilder-Morphic-mt.308
> Author: mt
> Time: 14 March 2022, 4:39:06.716786 pm
> UUID: bbb9bbdb-e30d-9243-8123-ea7b6a828e32
> Ancestors: ToolBuilder-Morphic-mt.307
>
> Fixes regression in expand button in list-chooser dialogs.
>
> Allow longer text lines in pluggable dialogs (e.g., file-save dialog).
>
> Make #softLineWrapAtVisualWrapBorder preference functional. Still disabled by default. Only for source-code panes.
>
> Tweak #initialExtent in list-chooser dialogs.
>
> =============== Diff against ToolBuilder-Morphic-mt.307 ===============
>
> Item was changed:
> ----- Method: DirectoryChooserDialog>>initialExtent (in category 'toolbuilder') -----
> initialExtent
> "Since this is a single list it can be a bit narrower than a FileChooserDialog"
>
> + ^ super initialExtent * (0.6 @ 1)!
> - ^ super initialExtent * (0.5 @ 1)!
>
> Item was changed:
> ----- Method: ListChooser>>initialExtent (in category 'building') -----
> initialExtent
>
> + | listFont listStyle itemCount maxItemSize |
> - | listFont itemCount maxItemSize cellSize |
> listFont := Preferences standardListFont.
> + listStyle := listFont asNewTextStyle.
> itemCount := items size.
> + maxItemSize := (items take: 15) inject: 0 into: [:max :item | max max: item asString size].
> - maxItemSize := items inject: 0 into: [:max :item | max max: item asString size].
> - cellSize := (listFont widthOf: $m) @ listFont height.
>
> + ^ (listStyle compositionWidthFor: (maxItemSize min: 50 max: 35))
> - ^ ((maxItemSize min: 20 max: 10) * (listFont widthOf: $m))
> @ ((ToolBuilder default listHeightFor: (itemCount min: 15 max: 5))
> + self searchBarHeight
> + ToolBuilder default dialogSpacing)!
>
> Item was changed:
> ----- Method: ListMultipleChooser>>initialExtent (in category 'toolbuilder') -----
> initialExtent
>
> + | listFont listStyle itemCount maxItemSize |
> - | listFont itemCount maxItemSize |
> listFont := Preferences standardListFont.
> + listStyle := listFont asNewTextStyle.
> itemCount := labels size.
> + maxItemSize := (labels take: 15) inject: 0 into: [:max :item | max max: item asString size].
> - maxItemSize := labels inject: 0 into: [:max :item | max max: item asString size].
>
> + ^ (listStyle compositionWidthFor: (maxItemSize min: 50 max: 35))
> - ^ ((maxItemSize min: 20 max: 10) * (listFont widthOf: $m))
> @ (ToolBuilder default listHeightFor: (itemCount min: 15 max: 5))!
>
> Item was changed:
> ----- Method: MorphicToolBuilder>>buildPluggableCodePane: (in category 'widgets optional') -----
> buildPluggableCodePane: aSpec
>
> | widget |
> widget := super buildPluggableCodePane: aSpec.
>
> "Override code-specific default properties."
> widget wantsWrapBorder: PluggableTextMorph visualWrapBorder.
> + PluggableTextMorph softLineWrapAtVisualWrapBorder
> + ifTrue: [widget numCharactersPerLine: PluggableTextMorph visualWrapBorderLimit].
> widget wrapFlag: (aSpec softLineWrap ifNil: [PluggableTextMorph softLineWrap]).
> ^ widget!
>
> Item was changed:
> ----- Method: MorphicToolBuilder>>buildPluggableDialog: (in category 'widgets optional') -----
> buildPluggableDialog: aSpec
>
> | widget |
>
> widget := self dialogClass new.
> self register: widget id: aSpec name.
>
> widget model: aSpec model.
>
> "Set child dependent layout properties. The pane morph holds the special contents."
> widget paneMorph wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
> self setLayoutHintsFor: widget paneMorph spec: aSpec.
> widget paneMorph layoutInset: (aSpec padding ifNil: [self dialogPadding]).
> widget morphicLayerNumber: widget class dialogLayer.
>
> "Performance. Flip the #wantsPaneSplitters flag only after all children where added."
> widget paneMorph cellGap: 0.
> widget paneMorph wantsPaneSplitters: false; wantsGrips: false.
> widget paneMorph removePaneSplitters; removeGrips.
>
> "Now create the children."
> panes := OrderedCollection new.
> aSpec children isSymbol
> ifTrue: [
> widget getChildrenSelector: aSpec children.
> widget update: aSpec children]
> ifFalse: [
> self buildAll: aSpec children in: widget paneMorph].
>
> "Avoid strange behavior in #addMorph:fullFrame:"
> widget paneMorph cellGap: (aSpec spacing ifNil: [self dialogSpacing]).
> widget paneMorph wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
> widget paneMorph wantsPaneSplitters ifTrue: [
> widget paneMorph wantsGrips: true.
> widget paneMorph addPaneSplitters; addCornerGrips"; addEdgeGrips".
> widget paneMorph grips do: [:ea | ea showHandle: true]].
>
> + "Increase the line width of the dialog's message to allow that longer messages accompany complex paneMorph contents."
> + widget messageMorph numCharactersPerLine: 65.
> +
> "Now create the buttons."
> aSpec buttons isSymbol
> ifTrue: [
> widget getButtonsSelector: aSpec buttons.
> widget update: aSpec buttons]
> ifFalse: [
> self buildAll: aSpec buttons in: widget buttonRowMorph.
> widget updateButtonProperties].
>
> aSpec title ifNotNil: [:label |
> label isSymbol
> ifTrue:[widget getTitleSelector: label; update: label]
> ifFalse:[widget title: label]].
> aSpec message ifNotNil: [:label |
> label isSymbol
> ifTrue:[widget getMessageSelector: label; update: label]
> ifFalse:[widget message: label]].
>
> "Interaction behavior."
> aSpec autoCancel ifNotNil: [:b | widget autoCancel: b].
> aSpec exclusive ifNotNil: [:b | widget exclusive: b].
>
> widget closeDialogSelector: aSpec closeAction.
> self buildHelpFor: widget spec: aSpec.
>
> "Everything is shrink-wrapped around the pane morph."
> widget paneMorph extent: (aSpec extent ifNil:[widget initialExtent])
> + (widget paneMorph layoutInset * 2) asPoint.
>
> ^ widget!
>
> Item was changed:
> ----- Method: PluggableDialogWindow>>expandDialogPane (in category 'running') -----
> expandDialogPane
> "Expand the dialog pane to its preferred extent, including the pane's extra layout inset used for grips. Then try again to move to the dialog's preferred position."
>
> | extra |
> self flag: #preferredExtentWorkaround. "mt: Working with a widget's min, max, and preferred extent is still very awkward using proportional layouts and layout frames. For now, approximate extra spacing to accommodate ListChooser and ListMultipleChooser only."
> + extra := PluggableListMorph listMargins.
> + extra := extra topLeft + extra bottomRight.
> - extra := LazyListMorph new cellInset. extra := extra topLeft + extra bottomRight.
>
> self paneMorph extent:
> (self model preferredExtent
> + (self paneMorph layoutInset * 2) asPoint
> + extra).
> self moveToPreferredPosition.!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220406/ba1cc890/attachment-0001.html>
More information about the Squeak-dev
mailing list
|