From 0e55a366bedd04bf48e123958489e294c5785b98 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 22 May 2020 10:16:15 +0200 Subject: [PATCH] FirstBootPrompt: adjust window size to font size At 12pt, we try to fit a 640x480 display. But at larger font sizes we have to allow some more space. Fixes #16066. --- src/apps/firstbootprompt/BootPromptWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/firstbootprompt/BootPromptWindow.cpp b/src/apps/firstbootprompt/BootPromptWindow.cpp index d8d36bef45..60e1ca14b2 100644 --- a/src/apps/firstbootprompt/BootPromptWindow.cpp +++ b/src/apps/firstbootprompt/BootPromptWindow.cpp @@ -68,7 +68,7 @@ static const char* kLanguageKeymapMappings[] = { // Cyrillic keymaps are not usable alone, as latin alphabet is required to // use Terminal. So we stay in US international until the user has a chance - // to set up KeymapSwitcher. TODO enable KeymapSwitcher automatically. + // to set up KeymapSwitcher. "Belarusian", "US-International", "Russian", "US-International", "Ukrainian", "US-International", @@ -202,7 +202,7 @@ BootPromptWindow::BootPromptWindow() fLanguagesListView, B_WILL_DRAW, false, true); // Carefully designed to not exceed the 640x480 resolution with a 12pt font. - float width = 640 - (labelWidth + 96); + float width = 640 * be_plain_font->Size() / 12 - (labelWidth + 64); float height = be_plain_font->Size() * 23; fInfoTextView->SetExplicitMinSize(BSize(width, height)); fInfoTextView->SetExplicitMaxSize(BSize(width, B_SIZE_UNSET));