<div dir="ltr"><div dir="ltr">inline...</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 11, 2021 at 2:30 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr">
                                        Still, it makes me wonder if you ever you "list filtering" in such dialogs? You seem to want to optimize the users browsing experience, not the searching experience.</div></div></blockquote><div>Actually, this even helps with filtering.  If I have large items (which I often do), and I don't know the exact combination of characters for what I want to choose, it can be frustrating with the default size.  Try:</div><div>  ListChooser chooseFrom: #(<br>    'A Really Big Option With Useful Stuff after: here, option Alpha'<br>    'A Really Big Option With Useful Stuff after: here, option Beta'<br>    'A Really Big Option With Useful Stuff after: here, option Gamma'<br>    'Not what we want'<br>  )<br></div><div>and filter by, say 'Stuff'.  Which one do you pick?</div><div><br></div><div>Further, the grippies on this dialog are frustrating. If the dialog is near the bottom right of the screen, just dragging the top left (or bottom left) to make the dialog bigger to be able to see the rest of the text doesn't work. The dialog only expands down and to the right - no matter which grippy you try to expand (or shrink) the dialog with.  So, I have to make it bigger, then move the dialog.  If you need to do this often enough, I at least get frustrated.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px"><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><div><span style="font-size:10pt">From my experience with the codebase in Squeak 3 and 4, any magic buffers such as "20" and "40" should be avoided for the sake of HI-DPI and hard-to-debug UI glitches. Deriving such buffers from the current font metrics seems to be more robust. Note that, in general, I am not opposed to giving content "more space to breathe" :-)</span></div></div></div></blockquote></div></div></blockquote><div>The buffer size I am talking about here isn't for more white space around the list, but for the size of the dialog that is outside of the list.  InitialExtent is for the complete dialog size, not just the list box.  So, you will never be able to see 15 lines in the previous version because of the other space taken up by buttons and filter box.  (Which is ok if the lists choices are small in few in number, of course.)</div><div><br></div><div>That said, you are right about HI-DPI and possible other font choices and/or future changes to ListChooser - I should derive the value and not hard code it.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px"><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><div><br></div><div><br></div><div>Having to iterate over all items in a list is too costly for larger lists. The LazyListMorph attempt to only consider a sample proved to entail annoying UI glitches such as shaky UI elements while scrolling.</div></div></div></blockquote></div></div></blockquote><div><snip good stuff> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px"><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><div><span style="font-size:10pt">All in all, you are oppsed to always make room for 15 items and (roughly) 20 characters per item. So, I suggest that we could make the 15 derived from the actual number of items ... plus 1-2 if you want to leave more whitespace. For the 20, I would suggest to only count the number of characters and multiply with that width-of-$m. For performance reasons:</span></div></div></div></blockquote></div></div></blockquote><div>Yes, agreed (and much better). Except extra space should not be based on the list items/count, but on the other Dialog stuff.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px"><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><div></div><div><div><span style="font-size:13.3333px">[items inject: 0 into: [:max :item | max max: item size]] bench.</span></div><div><span style="font-size:13.3333px">'30,200 per second. 33.1 microseconds per run. 0.05999 % GC time.'</span></div></div><div><br></div><div>Yes, we could watch out for the size of #currentWorld, as you suggested. But this already happens via RealEstateAgent class >> maximumUsableAreaInWorld: as well as sends of #translatedToBeWithin: to a world's bounds. No need to duplicate and scatter those constraints all over the code base. :-) ... That said ... I think there is a bug in DialogWindow >> #moveToPreferredPosition and also in its initial extent. DialogWindow does not talk to RealEstateAgent at all ...</div></div></div></blockquote></div></div></blockquote><div>I'll try removing my #currentWorld and see what happens with a really REALLY large list. I did notice that it will not open the dialog with any of it off the screen by default - but didn't try with an extent larger than the world.  So, at least that part is somehow handled.  (But not the growth of the dialog by grippies, unfortunately).</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px"><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><div></div><div>Best,</div><div>Marcel</div><div><br></div><div>P.S.: <span style="font-size:10pt">How can you know that "item" is something that works with #widthOfString:? :-) Could be an instance of Text, for example.</span></div></div></div></blockquote></div></div></blockquote><div>err, yeah.  I always use stuff that knows #widthOfString, but that's just me.  Will go with using size and width of $m.</div><div><br></div><div>Thank you!</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px"><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-1886239703248271740__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr"><div></div>
                                        <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px;min-width:500px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 08.01.2021 20:27:56 schrieb <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of ToolBuilder-Morphic was added to project The Inbox:<br><a href="http://source.squeak.org/inbox/ToolBuilder-Morphic-cbc.270.mcz" target="_blank">http://source.squeak.org/inbox/ToolBuilder-Morphic-cbc.270.mcz</a><br><br>==================== Summary ====================<br><br>Name: ToolBuilder-Morphic-cbc.270<br>Author: cbc<br>Time: 8 January 2021, 11:27:47.8204 am<br>UUID: abbbeb8a-9a8b-ef4a-b6a9-051b55cc2d5b<br>Ancestors: ToolBuilder-Morphic-mt.269<br><br>Set the initial extent of the ListChooser to not require resizing the dialog for reasonable sized lists (i.e., expand it so you can see all of the list).<br>At the small end, still object MT's suggested size; at the large end, will not take up more the 3/4ths of the world size.<br><br>=============== Diff against ToolBuilder-Morphic-mt.269 ===============<br><br>Item was changed:<br>  ----- Method: ListChooser>>initialExtent (in category 'building') -----<br>  initialExtent<br>+   | listFont width height |<br>- <br>-        | listFont |<br>          listFont := Preferences standardListFont.<br>+    width := (items collect: [:item| listFont widthOfString: item]) max + 20 "Acutal size of items plus dialog buffer left/right"<br>+              max: (20 * (listFont widthOf: $m)). "but we want a not-too-small box as well"<br>+      height := ((items size max: 15) * listFont height) + 40. "for various other stuff in dialog above/below list"<br>+      "But, don't use the whole world."<br>+      width := width min: (self currentWorld extent x * 0.75) asInteger.<br>+   height := height min: (self currentWorld extent y * 0.75) asInteger.<br>+         ^ width@height!<br>-      ^ (20 * (listFont widthOf: $m))@(15 * listFont height)!<br><br><br></div></blockquote></div></div></blockquote>
                                        </div></div><br>
</blockquote></div></div>