* Reverted r30529 as this was pretty much bogus (sorry stpere, but the size of
the window was already set with its constructor). * Fixed the actual cause of bug #3752 instead: the fCharacterHeight and fTitleHeight members were not initialized when MinSize() was called. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30629 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -33,6 +33,8 @@ CharacterView::CharacterView(const char* name)
|
||||
{
|
||||
fTitleTops = new int32[kNumUnicodeBlocks];
|
||||
fCharacterFont.SetSize(fCharacterFont.Size() * 1.5f);
|
||||
|
||||
_UpdateFontSize();
|
||||
}
|
||||
|
||||
|
||||
@@ -479,12 +481,8 @@ CharacterView::_GetCharacterAt(BPoint point, uint32& character, BRect* _frame)
|
||||
|
||||
|
||||
void
|
||||
CharacterView::_UpdateSize()
|
||||
CharacterView::_UpdateFontSize()
|
||||
{
|
||||
// Compute data rect
|
||||
|
||||
BRect bounds = Bounds();
|
||||
|
||||
font_height fontHeight;
|
||||
GetFontHeight(&fontHeight);
|
||||
fTitleHeight = (int32)ceilf(fontHeight.ascent + fontHeight.descent
|
||||
@@ -510,6 +508,17 @@ CharacterView::_UpdateSize()
|
||||
|
||||
fCharacterHeight += fGap;
|
||||
fTitleGap = fGap * 3;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CharacterView::_UpdateSize()
|
||||
{
|
||||
// Compute data rect
|
||||
|
||||
BRect bounds = Bounds();
|
||||
|
||||
_UpdateFontSize();
|
||||
|
||||
fDataRect.right = bounds.Width();
|
||||
fDataRect.bottom = 0;
|
||||
|
||||
@@ -59,6 +59,7 @@ private:
|
||||
int32 _BlockAt(BPoint point);
|
||||
bool _GetCharacterAt(BPoint point, uint32& character,
|
||||
BRect* _frame = NULL);
|
||||
void _UpdateFontSize();
|
||||
void _UpdateSize();
|
||||
bool _GetTopmostCharacter(uint32& character,
|
||||
int32& offset);
|
||||
|
||||
@@ -126,9 +126,6 @@ CharacterWindow::CharacterWindow()
|
||||
if (settings.FindRect("window frame", &frame) == B_OK) {
|
||||
MoveTo(frame.LeftTop());
|
||||
ResizeTo(frame.Width(), frame.Height());
|
||||
} else {
|
||||
MoveTo(BPoint(100, 100));
|
||||
ResizeTo(600, 450);
|
||||
}
|
||||
|
||||
// create GUI
|
||||
|
||||
Reference in New Issue
Block a user