Set proper minimum width of name display modes dropdown (#2976)

This commit is contained in:
Paweł 2021-07-11 12:47:23 +02:00 committed by GitHub
parent 94a99ac4f0
commit 735c0ad1ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -617,16 +617,19 @@ void GeneralPage::initLayout(GeneralPageView &layout)
const QStringList usernameDisplayModes = {"Username", "Localized name",
"Username and localized name"};
layout.addDropdown<std::underlying_type<UsernameDisplayMode>::type>(
"Username style", usernameDisplayModes, s.usernameDisplayMode,
[usernameDisplayModes](auto val) {
return usernameDisplayModes.at(val - 1);
// UsernameDisplayMode enum indexes from 1
},
[](auto args) {
return args.index + 1;
},
false);
ComboBox *nameDropdown =
layout.addDropdown<std::underlying_type<UsernameDisplayMode>::type>(
"Username style", usernameDisplayModes, s.usernameDisplayMode,
[usernameDisplayModes](auto val) {
return usernameDisplayModes.at(val - 1);
// UsernameDisplayMode enum indexes from 1
},
[](auto args) {
return args.index + 1;
},
false);
nameDropdown->setMinimumWidth(nameDropdown->minimumSizeHint().width());
layout.addDropdown<float>(
"Username font weight", {"50", "Default", "75", "100"}, s.boldScale,
[](auto val) {