mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
Fix main menu night theme layout for non-English.
The place for the phrase was too small because of huge left padding.
This commit is contained in:
parent
10906e2e16
commit
794ad7bda7
1 changed files with 3 additions and 3 deletions
|
@ -134,9 +134,9 @@ int Menu::processAction(QAction *action, int index, int width) {
|
||||||
int textw = _st.itemFont->width(actionText);
|
int textw = _st.itemFont->width(actionText);
|
||||||
int goodw = _st.itemPadding.left() + textw + _st.itemPadding.right();
|
int goodw = _st.itemPadding.left() + textw + _st.itemPadding.right();
|
||||||
if (data.hasSubmenu) {
|
if (data.hasSubmenu) {
|
||||||
goodw += _st.itemPadding.left() + _st.arrow.width();
|
goodw += _st.itemPadding.right() + _st.arrow.width();
|
||||||
} else if (!actionShortcut.isEmpty()) {
|
} else if (!actionShortcut.isEmpty()) {
|
||||||
goodw += _st.itemPadding.left() + _st.itemFont->width(actionShortcut);
|
goodw += _st.itemPadding.right() + _st.itemFont->width(actionShortcut);
|
||||||
}
|
}
|
||||||
if (action->isCheckable()) {
|
if (action->isCheckable()) {
|
||||||
auto updateCallback = [this, index] { updateItem(index); };
|
auto updateCallback = [this, index] { updateItem(index); };
|
||||||
|
@ -146,7 +146,7 @@ int Menu::processAction(QAction *action, int index, int width) {
|
||||||
} else {
|
} else {
|
||||||
data.toggle = std::make_unique<ToggleView>(_st.itemToggle, action->isChecked(), updateCallback);
|
data.toggle = std::make_unique<ToggleView>(_st.itemToggle, action->isChecked(), updateCallback);
|
||||||
}
|
}
|
||||||
goodw += _st.itemPadding.left() + data.toggle->getSize().width() - _st.itemToggleShift;
|
goodw += _st.itemPadding.right() + data.toggle->getSize().width() - _st.itemToggleShift;
|
||||||
} else {
|
} else {
|
||||||
data.toggle.reset();
|
data.toggle.reset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue