The Trunk: Tools-cmm.572.mcz

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

The Trunk: Tools-cmm.572.mcz

commits-2
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.572.mcz

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

Name: Tools-cmm.572
Author: cmm
Time: 1 April 2015, 2:43:55.003 pm
UUID: cc792d4a-a258-496c-bffe-ad6db90b52b6
Ancestors: Tools-cmm.571

- Fix test for scrollbar presence for Vertical Smart Splitter support.
- Fix "Reuse Windows" preference for ObjectExplorers.

=============== Diff against Tools-cmm.571 ===============

Item was changed:
  ----- Method: IndentingListItemMorph>>charactersOccluded (in category 'private') -----
  charactersOccluded
  "Answer the number of characters occluded in my #visibleList by my right edge."
  | listIndex leftEdgeOfRightmostColumn eachString indexOfLastVisible iconWidth totalWidth |
  listIndex := 0.
  leftEdgeOfRightmostColumn := container columns
  ifNil: [ 0 ]
  ifNotNil:
  [ : cols | (1 to: cols size - 1)
  inject: 0
  into:
  [ : sum : each | sum + (self widthOfColumn: each) ] ].
  eachString := container columns
  ifNil: [ self complexContents asString ]
  ifNotNil:
  [ : cols | self contentsAtColumn: container columns size ].
  iconWidth := self icon
  ifNil: [ 0 ]
  ifNotNil:
  [ : icon | icon width + 2 ].
  totalWidth := self toggleBounds right.
  indexOfLastVisible := ((1 to: eachString size)
  detect:
  [ : stringIndex | (totalWidth:=totalWidth+(self fontToUse widthOf: (eachString at: stringIndex))) >
  (container width -
+ (container vIsScrollbarShowing
+ ifTrue: [ container scrollBar width ]
+ ifFalse: [ 0 ]) - iconWidth - leftEdgeOfRightmostColumn) ]
- (container scrollBar
- ifNil: [ 0 ]
- ifNotNil: [ container scrollBar width ]) - iconWidth - leftEdgeOfRightmostColumn) ]
  ifNone: [ eachString size + 1 ]) - 1.
  ^ eachString size - indexOfLastVisible!

Item was changed:
  ----- Method: ObjectExplorer>>openExplorerFor:withLabel: (in category 'user interface') -----
  openExplorerFor: anObject withLabel: label
+ "ObjectExplorer new openExplorerFor: Smalltalk withLabel: 'Smalltalk'"
+ "Model must be set to support Reuse Windows preference."
+ self rootObject: anObject.
+ ToolBuilder
+ open: self
+ label: label.
+ "Set model again to ensure window title updated (hmm, why not the first time?)."
+ self rootObject: anObject!
-      "ObjectExplorer new openExplorerFor: Smalltalk withLabel: 'Smalltalk'"
-
- ToolBuilder open: self label: label.
- self rootObject: anObject.!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.572.mcz

Chris Muller-3
Hi Marcel, I don't care for this code in #openExplorerFor: but I ran
out of time to understand why the window title would not update until
the model was set only AFTERward, not beforehand..

On Wed, Apr 1, 2015 at 2:44 PM,  <[hidden email]> wrote:

> Chris Muller uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-cmm.572.mcz
>
> ==================== Summary ====================
>
> Name: Tools-cmm.572
> Author: cmm
> Time: 1 April 2015, 2:43:55.003 pm
> UUID: cc792d4a-a258-496c-bffe-ad6db90b52b6
> Ancestors: Tools-cmm.571
>
> - Fix test for scrollbar presence for Vertical Smart Splitter support.
> - Fix "Reuse Windows" preference for ObjectExplorers.
>
> =============== Diff against Tools-cmm.571 ===============
>
> Item was changed:
>   ----- Method: IndentingListItemMorph>>charactersOccluded (in category 'private') -----
>   charactersOccluded
>         "Answer the number of characters occluded in my #visibleList by my right edge."
>         | listIndex leftEdgeOfRightmostColumn eachString indexOfLastVisible iconWidth totalWidth |
>         listIndex := 0.
>         leftEdgeOfRightmostColumn := container columns
>                 ifNil: [ 0 ]
>                 ifNotNil:
>                         [ : cols | (1 to: cols size - 1)
>                                 inject: 0
>                                 into:
>                                         [ : sum : each | sum + (self widthOfColumn: each) ] ].
>         eachString := container columns
>                 ifNil: [ self complexContents asString ]
>                 ifNotNil:
>                         [ : cols | self contentsAtColumn: container columns size ].
>         iconWidth := self icon
>                 ifNil: [ 0 ]
>                 ifNotNil:
>                         [ : icon | icon width + 2 ].
>         totalWidth := self toggleBounds right.
>         indexOfLastVisible := ((1 to: eachString size)
>                 detect:
>                         [ : stringIndex | (totalWidth:=totalWidth+(self fontToUse widthOf: (eachString at: stringIndex))) >
>                                 (container width -
> +                                       (container vIsScrollbarShowing
> +                                               ifTrue: [ container scrollBar width ]
> +                                               ifFalse: [ 0 ]) - iconWidth - leftEdgeOfRightmostColumn) ]
> -                                       (container scrollBar
> -                                               ifNil: [ 0 ]
> -                                               ifNotNil: [ container scrollBar width ]) - iconWidth - leftEdgeOfRightmostColumn) ]
>                 ifNone: [ eachString size + 1 ]) - 1.
>         ^ eachString size - indexOfLastVisible!
>
> Item was changed:
>   ----- Method: ObjectExplorer>>openExplorerFor:withLabel: (in category 'user interface') -----
>   openExplorerFor: anObject withLabel: label
> +       "ObjectExplorer new openExplorerFor: Smalltalk withLabel: 'Smalltalk'"
> +       "Model must be set to support Reuse Windows preference."
> +       self rootObject: anObject.
> +       ToolBuilder
> +               open: self
> +               label: label.
> +       "Set model again to ensure window title updated (hmm, why not the first time?)."
> +       self rootObject: anObject!
> -      "ObjectExplorer new openExplorerFor: Smalltalk withLabel: 'Smalltalk'"
> -
> -       ToolBuilder open: self label: label.
> -       self rootObject: anObject.!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.572.mcz

marcel.taeumel (old)
I will look into it. Sending #rootObject: should always work and update the title.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.572.mcz

marcel.taeumel (old)
In reply to this post by Chris Muller-3
I cannot match your commit code + message to this problem? Could you try making smaller commits? You can right-click on a method in the save-dialog and "ignore" particular methods.

Anyway: Label update works fine for me with the prior version of "openExplorerFor: anObject withLabel: label"

What did you try and when did it not work? This works fine:

ObjectExplorer new openExplorerFor: Morph new.

Then inspecting it and trying

self rootObject: Color yellow.

does also work fine.

-> I will revert that change until we can reproduce your bug. :)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.572.mcz

marcel.taeumel (old)
In reply to this post by Chris Muller-3
I fixed something here: http://forum.world.st/The-Trunk-Tools-mt-576-mcz-td4816865.html

Does it now work for you?

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.572.mcz

Chris Muller-3
On Thu, Apr 2, 2015 at 6:52 AM, Marcel Taeumel
<[hidden email]> wrote:
> I fixed something here:
> http://forum.world.st/The-Trunk-Tools-mt-576-mcz-td4816865.html
>
> Does it now work for you?

Yes, we now have the correct window label thank you.