From a0c20849b5a6d4ab645f2e4387f9a21570382bef Mon Sep 17 00:00:00 2001 From: Phil Greenway Date: Wed, 21 Jul 2004 06:17:50 +0000 Subject: [PATCH] Updates by Mark Hogben git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8444 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/prefs/fonts/CacheView.cpp | 6 ++---- src/prefs/fonts/FontSelectionView.cpp | 14 +++++++++++--- src/prefs/fonts/MainWindow.cpp | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/prefs/fonts/CacheView.cpp b/src/prefs/fonts/CacheView.cpp index 327da20953..d4b45a9ead 100644 --- a/src/prefs/fonts/CacheView.cpp +++ b/src/prefs/fonts/CacheView.cpp @@ -19,8 +19,6 @@ CacheView::CacheView(BRect rect, int minVal, int maxVal, int32 printCurrVal, int : BView(rect, "CacheView", B_FOLLOW_ALL, B_WILL_DRAW) { - float x; - float y; BRect viewSize = Bounds(); char sliderMinLabel[10]; char sliderMaxLabel[10]; @@ -37,7 +35,7 @@ CacheView::CacheView(BRect rect, int minVal, int maxVal, int32 printCurrVal, int viewSize.InsetBy(15, 10); - sprintf(msg, "Screen font cache size : %d kB", screenCurrVal); + sprintf(msg, "Screen font cache size : %d kB", static_cast(screenCurrVal)); screenFCS = new BSlider(*(new BRect(viewSize.left, viewSize.top, viewSize.right, viewSize.top + 25.0)), "screenFontCache", @@ -57,7 +55,7 @@ CacheView::CacheView(BRect rect, int minVal, int maxVal, int32 printCurrVal, int viewSize.top = viewSize.top + 65.0; - sprintf(msg, "Printing font cache size : %d kB", printCurrVal); + sprintf(msg, "Printing font cache size : %d kB", static_cast(printCurrVal)); printFCS = new BSlider(*(new BRect(viewSize.left, viewSize.top, viewSize.right, viewSize.top + 25.0)), "printFontCache", diff --git a/src/prefs/fonts/FontSelectionView.cpp b/src/prefs/fonts/FontSelectionView.cpp index 312910f279..3da9ce55da 100644 --- a/src/prefs/fonts/FontSelectionView.cpp +++ b/src/prefs/fonts/FontSelectionView.cpp @@ -87,9 +87,17 @@ FontSelectionView::FontSelectionView(BRect rect, const char *name, int type) fontListField->SetDivider(7 * x); sizeListField = new BMenuField(*(new BRect((27 * x), y, (36 * x), (3 * y))), "fontField", "Size", sizeList); sizeListField->SetDivider(31 * x); - testText = new BStringView(*(new BRect((8 * x), (5 * y), (35 * x), (8 * y))), "testText", "The quick brown fox jumped over the lazy dog.", B_FOLLOW_ALL, B_WILL_DRAW); - testText->SetFont(&workingFont); + testTextBox = new BBox(*(new BRect((8 * x), (5 * y), (36 * x), (8 * y))), "TestTextBox", B_FOLLOW_ALL, B_WILL_DRAW, B_FANCY_BORDER); + + // Place the text slightly inside the entire box area, so it doesn't overlap the box outline. + BRect testTextRect(testTextBox->Bounds()); + testTextRect.top = 2; + testTextRect.left = 4; + testTextRect.bottom = testTextRect.bottom - 2; + testTextRect.right = testTextRect.right - 4; + testText = new BStringView(testTextRect, "testText", "The quick brown fox jumped over the lazy dog.", B_FOLLOW_ALL, B_WILL_DRAW); + testText->SetFont(&workingFont); fontList->SetLabelFromMarked(true); @@ -98,7 +106,7 @@ FontSelectionView::FontSelectionView(BRect rect, const char *name, int type) SetViewColor(216, 216, 216, 0); AddChild(testTextBox); - AddChild(testText); + testTextBox->AddChild(testText); AddChild(sizeListField); AddChild(fontListField); diff --git a/src/prefs/fonts/MainWindow.cpp b/src/prefs/fonts/MainWindow.cpp index a1177a059e..d9785b3457 100644 --- a/src/prefs/fonts/MainWindow.cpp +++ b/src/prefs/fonts/MainWindow.cpp @@ -48,9 +48,9 @@ MainWindow::MainWindow(BRect frame) topLevelView = new BBox(Bounds(), "TopLevelView", B_FOLLOW_ALL, B_WILL_DRAW, B_NO_BORDER); - AddChild(buttonView); - AddChild(tabView); AddChild(topLevelView); + topLevelView->AddChild(buttonView); + topLevelView->AddChild(tabView); }