The Inbox: ToolBuilder-Morphic-cbc.271.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: ToolBuilder-Morphic-cbc.271.mcz

commits-2
A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-cbc.271.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-cbc.271
Author: cbc
Time: 11 January 2021, 10:15:51.0644 am
UUID: 76f9fb95-5700-1b43-a9af-9ab88aaa890f
Ancestors: ToolBuilder-Morphic-mt.270

Let the width of List Chooser try to accomodate better to the actual size of the string.

=============== Diff against ToolBuilder-Morphic-mt.270 ===============

Item was changed:
  ----- Method: ListChooser>>initialExtent (in category 'building') -----
  initialExtent
+ | listFont itemCount width |
-
- | listFont itemCount maxItemSize cellSize |
  listFont := Preferences standardListFont.
  itemCount := items size.
+ width := ((items take: 15) collect: [:item| listFont widthOfString: item]) max.
+ ^ (width min: (self currentWorld extent x * 0.75) asInteger max:  ((listFont widthOf: $m) * 12))
+ @ ((itemCount min: 15 max: 5) * listFont height + self searchBarHeight)
+ !
- maxItemSize := items inject: 0 into: [:max :item | max max: item size].
- cellSize := (listFont widthOf: $m) @ listFont height.
-
- ^ ((maxItemSize + 1 "breathing space" min: 20 max: 10)
- @ (itemCount + 1 "breathing space" min: 15 max: 5)
- * cellSize) + (0@ self searchBarHeight)!


cbc
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: ToolBuilder-Morphic-cbc.271.mcz

cbc
image.png
and
image.png
close enough.

On Mon, Jan 11, 2021 at 10:16 AM <[hidden email]> wrote:
A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-cbc.271.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-cbc.271
Author: cbc
Time: 11 January 2021, 10:15:51.0644 am
UUID: 76f9fb95-5700-1b43-a9af-9ab88aaa890f
Ancestors: ToolBuilder-Morphic-mt.270

Let the width of List Chooser try to accomodate better to the actual size of the string.

=============== Diff against ToolBuilder-Morphic-mt.270 ===============

Item was changed:
  ----- Method: ListChooser>>initialExtent (in category 'building') -----
  initialExtent
+       | listFont itemCount width |
-
-       | listFont itemCount maxItemSize cellSize |
        listFont := Preferences standardListFont.
        itemCount := items size.
+       width := ((items take: 15) collect: [:item| listFont widthOfString: item]) max.
+       ^ (width min: (self currentWorld extent x * 0.75) asInteger max:  ((listFont widthOf: $m) * 12))
+               @ ((itemCount min: 15 max: 5) * listFont height + self searchBarHeight)
+ !
-       maxItemSize := items inject: 0 into: [:max :item | max max: item size].
-       cellSize := (listFont widthOf: $m) @ listFont height.
-       
-       ^ ((maxItemSize + 1 "breathing space" min: 20 max: 10)
-               @ (itemCount + 1 "breathing space" min: 15 max: 5)
-               * cellSize) + (0@ self searchBarHeight)!




cbc
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: ToolBuilder-Morphic-cbc.271.mcz

cbc
It looks like it is 2 pixels short for height.  If the size list size is between 5 and 15, it will include the vertical scroll bar to scroll for those 2 pixels (or, I am guessing, however big the list box boundary line is).

It looks like the width is short by the padding size before and after the text - maybe adding an $m width to the horizontal size would make it better (or figure out what the right padding + list box boundary line width is and add it in).

On Mon, Jan 11, 2021 at 10:17 AM Chris Cunningham <[hidden email]> wrote:
image.png
and
image.png
close enough.

On Mon, Jan 11, 2021 at 10:16 AM <[hidden email]> wrote:
A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-cbc.271.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-cbc.271
Author: cbc
Time: 11 January 2021, 10:15:51.0644 am
UUID: 76f9fb95-5700-1b43-a9af-9ab88aaa890f
Ancestors: ToolBuilder-Morphic-mt.270

Let the width of List Chooser try to accomodate better to the actual size of the string.

=============== Diff against ToolBuilder-Morphic-mt.270 ===============

Item was changed:
  ----- Method: ListChooser>>initialExtent (in category 'building') -----
  initialExtent
+       | listFont itemCount width |
-
-       | listFont itemCount maxItemSize cellSize |
        listFont := Preferences standardListFont.
        itemCount := items size.
+       width := ((items take: 15) collect: [:item| listFont widthOfString: item]) max.
+       ^ (width min: (self currentWorld extent x * 0.75) asInteger max:  ((listFont widthOf: $m) * 12))
+               @ ((itemCount min: 15 max: 5) * listFont height + self searchBarHeight)
+ !
-       maxItemSize := items inject: 0 into: [:max :item | max max: item size].
-       cellSize := (listFont widthOf: $m) @ listFont height.
-       
-       ^ ((maxItemSize + 1 "breathing space" min: 20 max: 10)
-               @ (itemCount + 1 "breathing space" min: 15 max: 5)
-               * cellSize) + (0@ self searchBarHeight)!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: ToolBuilder-Morphic-cbc.271.mcz

marcel.taeumel
It looks like it is 2 pixels short for height.

Yes. That's a bug that occurs when resolving the layout frame in the proportional layout. The 2 pixels are the border widths not considered correctly for fixed-height/width frames. I will investigate. :-)

If you want to even avoid clicking the expand button in a dialog, what are good average widths for an item? Even for more than 20 characters?

Best,
Marcel

Am 11.01.2021 20:20:32 schrieb Chris Cunningham <[hidden email]>:

It looks like it is 2 pixels short for height.  If the size list size is between 5 and 15, it will include the vertical scroll bar to scroll for those 2 pixels (or, I am guessing, however big the list box boundary line is).

It looks like the width is short by the padding size before and after the text - maybe adding an $m width to the horizontal size would make it better (or figure out what the right padding + list box boundary line width is and add it in).

On Mon, Jan 11, 2021 at 10:17 AM Chris Cunningham <[hidden email]> wrote:
image.png
and
image.png
close enough.

On Mon, Jan 11, 2021 at 10:16 AM <[hidden email]> wrote:
A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-cbc.271.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-cbc.271
Author: cbc
Time: 11 January 2021, 10:15:51.0644 am
UUID: 76f9fb95-5700-1b43-a9af-9ab88aaa890f
Ancestors: ToolBuilder-Morphic-mt.270

Let the width of List Chooser try to accomodate better to the actual size of the string.

=============== Diff against ToolBuilder-Morphic-mt.270 ===============

Item was changed:
  ----- Method: ListChooser>>initialExtent (in category 'building') -----
  initialExtent
+       | listFont itemCount width |
-
-       | listFont itemCount maxItemSize cellSize |
        listFont := Preferences standardListFont.
        itemCount := items size.
+       width := ((items take: 15) collect: [:item| listFont widthOfString: item]) max.
+       ^ (width min: (self currentWorld extent x * 0.75) asInteger max:  ((listFont widthOf: $m) * 12))
+               @ ((itemCount min: 15 max: 5) * listFont height + self searchBarHeight)
+ !
-       maxItemSize := items inject: 0 into: [:max :item | max max: item size].
-       cellSize := (listFont widthOf: $m) @ listFont height.
-       
-       ^ ((maxItemSize + 1 "breathing space" min: 20 max: 10)
-               @ (itemCount + 1 "breathing space" min: 15 max: 5)
-               * cellSize) + (0@ self searchBarHeight)!