When using `--buttonstyle stack` the order of the buttons is flipped from v. 2 to v. 3
Describe the bug
In Dialog 2.x, when using --buttonstyle stack button 1 was on top and button2 was on the bottom.
In Dialog 3.x, this is now flipped.
Not clear if this is intentional.
To Reproduce
Run this command with the old/new version of Dialog:
dialog --centericon --icon "/System/Library/CoreServices/KeyboardSetupAssistant.app/Contents/Resources/AppIcon.icns" --buttonstyle stack --button1text "$(dialog --version)" --button2text "Cancel" --width 400
Expected behavior Would be nice if the order was reverted to v.2 , but if this is intentional for some reason then so be it.
Screenshots
Desktop (please complete the following information):
- macOS version 26.0.1
- swiftDialog version 3.0.0.4916
Unintended consequence of the re-factored button layout code which had an explicit layout for stacked mode. In the new code the layout will switch accordingly and is rendered left to right horizontally and top to bottom vertically. This places the primary button at the right or bottom depending on the layout.
the v2.x stack code came in as a PR. Reading around sources, it seems to come down to preference but general consensus is that in a vertical stack, primary buttons appear at the bottom, although there are plenty of sources that state the reverse. The HiG itself is ambiguous although the screenshot provided shows a primary at the top layout https://developer.apple.com/design/human-interface-guidelines/buttons#Role
Re-ordering the vertical orientation is trivial but results in duplication of button init code which I was trying to avoid by doing the refactor.