Maps the C++ enum to the string the QSS selectors key off.
| 22 | |
| 23 | // Maps the C++ enum to the string the QSS selectors key off. |
| 24 | const char* roleToToken(MessageBox::ButtonRole role) { |
| 25 | switch (role) { |
| 26 | case MessageBox::kPrimaryRole: |
| 27 | return "primary"; |
| 28 | case MessageBox::kNeutralRole: |
| 29 | return "neutral"; |
| 30 | case MessageBox::kDestructiveRole: |
| 31 | return "destructive"; |
| 32 | case MessageBox::kCancelRole: |
| 33 | return "cancel"; |
| 34 | } |
| 35 | return "neutral"; |
| 36 | } |
| 37 | |
| 38 | // Layout insets used to derive the per-line wrap budget for button labels. |
| 39 | // They mirror values set elsewhere — the card content margin in the ctor |