Toolbar difference between Xojo 2021R1 and 2020R2.1

Hi @Sam_Rowlands, you mean?

Self.SetToolbarStyle(NSWindowToolbarStyle.Unified)
Self.SetDisplayMode(NSToolbarDisplayMode.IconOnly)

Self.Height = Self.Height + 1
Self.Height = Self.Height - 1

Unfortunately, this does not help. The window looks the same :confused:

The problem is that I canā€™t subtract the height of the toolbar from the total height, because it returns 0 as the toolbar height, which seems wrong to me.

Var i As Integer = macOSToolbar1.Height

Self.Height = Self.Height - i

Iā€™m calculating the toolbar height:

dim ToolbarHeight as Integer = self.Bounds.Height - self.height + 1
self.Height = self.Height - ToolbarHeight

The second line, of course, works only once and then it screws up loading the height of the window from the preferences.

Damn!

If you disable this line, does it help?

Try
Dim chromeHeight as integer = self.bounds.height - self.height

I just typed this without checking.

Thanks @Beatrix_Willius and @Sam_Rowlands. This only helps, if the Controls are top bottom locked. If they are bottom locked, it fails again.


No difference.

At the moment I donā€™t have a good idea how to solve this problem. I really donā€™t want to calculate where controls are and where they should be. I wanted to offer the users the choice of BSifying the interface like I did with the outline icons.

Which Feedback Case Number is about this ā€œLocked: Bottomā€ issue?

https://xojo.com/issue/62842

Currently with Xojo 2021r1 the combination of two workarounds usually solves the positioning issues with bottom-locked Controls which may occur if you have modified the Toolbar using Declares:

  1. Make sure the Toolbar is the last added Control of the Window.
    ā†’ Go to the Layout Editor of the Window, Cut the Toolbar, Paste it again
    If you add more bottom-locked Controls later, do this step again.
  2. In the .Open Event of the Window add: self.Height = self.Height
3 Likes