Appearance: add some extra margin around menufield labels

The font antialiasing settings make the font rendering change. It can
make strings longer or shorter, and this can result in the menufield
being moved by a few pixels. So add a safe margin around the menu field
to accomodate for it.

Fixes #13039.

Change-Id: I73de08b747dc8cade58bcc674dd4f94fb6a9f9eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2630
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Adrien Destugues
2020-05-09 19:41:27 +00:00
committed by waddlesplash
parent 39c68f46dd
commit 2b4c59635f
@@ -104,17 +104,17 @@ AntialiasingSettingsView::AntialiasingSettingsView(const char* name)
BLayoutBuilder::Grid<>(this, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
// controls pane
.Add(fHintingMenuField->CreateLabelLayoutItem(), 0, 0)
.Add(fHintingMenuField->CreateMenuBarLayoutItem(), 1, 0)
.AddMenuField(fHintingMenuField, 0, 0)
.AddMenuField(fAntialiasingMenuField, 0, 1)
.Add(fAverageWeightControl, 0, 2, 3)
.Add(fAntialiasingMenuField->CreateLabelLayoutItem(), 0, 1)
.Add(fAntialiasingMenuField->CreateMenuBarLayoutItem(), 1, 1)
.Add(fAverageWeightControl, 0, 2, 2)
.AddGlue(0, 4)
.AddGlue(0, 3)
.SetInsets(B_USE_WINDOW_SPACING);
BGridLayout* layout = dynamic_cast<BGridLayout*>(GetLayout());
layout->SetMinColumnWidth(0,
StringWidth(B_TRANSLATE("Antialiasing type:")) * 2);
_SetCurrentAntialiasing();
_SetCurrentHinting();
_SetCurrentAverageWeight();