From 05ddc0f17e76e68b43e0d870d2bce60cb3347d3b Mon Sep 17 00:00:00 2001
From: dsizzle <dcieslak@yahoo.com>
Date: Tue, 25 Nov 2014 20:22:50 +0000
Subject: [PATCH] 3651: Enhancement 9 - set explicit minimum width of character
view to be a bit larger than fCodeView so that there isn't jumping of the
pane sizes when fCodeView's contents are too long
---
src/apps/charactermap/CharacterWindow.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/apps/charactermap/CharacterWindow.cpp b/src/apps/charactermap/CharacterWindow.cpp
index 1f860b8..bf7880b 100644
a
|
b
|
|
15 | 15 | #include <Catalog.h> |
16 | 16 | #include <File.h> |
17 | 17 | #include <FindDirectory.h> |
| 18 | #include <Font.h> |
18 | 19 | #include <LayoutBuilder.h> |
19 | 20 | #include <ListView.h> |
20 | 21 | #include <Menu.h> |
… |
… |
CharacterWindow::CharacterWindow()
|
210 | 211 | fCodeView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, |
211 | 212 | fCodeView->PreferredSize().Height())); |
212 | 213 | |
| 214 | // set minimum width for character pane to prevent UI |
| 215 | // from jumping when longer code strings are displayed. |
| 216 | // use 'w' character for sizing as it's likely the widest |
| 217 | // character for a Latin font. 40 characters is a little |
| 218 | // wider than needed so hopefully this covers other |
| 219 | // non-Latin fonts that may be wider. |
| 220 | BFont viewFont; |
| 221 | fCodeView->GetFont(&viewFont); |
| 222 | fCharacterView->SetExplicitMinSize(BSize(viewFont.StringWidth( |
| 223 | "w") * 40, |
| 224 | B_SIZE_UNSET)); |
| 225 | |
213 | 226 | BLayoutBuilder::Group<>(this, B_VERTICAL) |
214 | 227 | .Add(menuBar) |
215 | 228 | .AddGroup(B_HORIZONTAL) |