mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Fix button order on Win32
On Windows, the button order is left to right, with the primary action on the left (i.e. "Ok" "Cancel"). On Mac, the button order is that the primary action is nearest to the corner.
This commit is contained in:
@@ -195,7 +195,10 @@ void MessageDialog::Layout() {
|
||||
int x = bounds.width();
|
||||
int height = buttons_[0]->GetPreferredSize().height() +
|
||||
views::kRelatedControlVerticalSpacing;
|
||||
for (size_t i = 0; i < buttons_.size(); ++i) {
|
||||
|
||||
// NB: We iterate through the buttons backwards here because
|
||||
// Mac and Windows buttons are laid out in opposite order.
|
||||
for (int i = buttons_.size() - 1; i >= 0; --i) {
|
||||
gfx::Size size = buttons_[i]->GetPreferredSize();
|
||||
x -= size.width() + views::kRelatedButtonHSpacing;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user