* 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:
Axel Dörfler
2009-05-04 19:53:12 +00:00
parent 0b218f6dd7
commit f7b4d19dc4
3 changed files with 22 additions and 15 deletions
+14 -5
View File
@@ -33,6 +33,8 @@ CharacterView::CharacterView(const char* name)
{ {
fTitleTops = new int32[kNumUnicodeBlocks]; fTitleTops = new int32[kNumUnicodeBlocks];
fCharacterFont.SetSize(fCharacterFont.Size() * 1.5f); fCharacterFont.SetSize(fCharacterFont.Size() * 1.5f);
_UpdateFontSize();
} }
@@ -479,12 +481,8 @@ CharacterView::_GetCharacterAt(BPoint point, uint32& character, BRect* _frame)
void void
CharacterView::_UpdateSize() CharacterView::_UpdateFontSize()
{ {
// Compute data rect
BRect bounds = Bounds();
font_height fontHeight; font_height fontHeight;
GetFontHeight(&fontHeight); GetFontHeight(&fontHeight);
fTitleHeight = (int32)ceilf(fontHeight.ascent + fontHeight.descent fTitleHeight = (int32)ceilf(fontHeight.ascent + fontHeight.descent
@@ -510,6 +508,17 @@ CharacterView::_UpdateSize()
fCharacterHeight += fGap; fCharacterHeight += fGap;
fTitleGap = fGap * 3; fTitleGap = fGap * 3;
}
void
CharacterView::_UpdateSize()
{
// Compute data rect
BRect bounds = Bounds();
_UpdateFontSize();
fDataRect.right = bounds.Width(); fDataRect.right = bounds.Width();
fDataRect.bottom = 0; fDataRect.bottom = 0;
+1
View File
@@ -59,6 +59,7 @@ private:
int32 _BlockAt(BPoint point); int32 _BlockAt(BPoint point);
bool _GetCharacterAt(BPoint point, uint32& character, bool _GetCharacterAt(BPoint point, uint32& character,
BRect* _frame = NULL); BRect* _frame = NULL);
void _UpdateFontSize();
void _UpdateSize(); void _UpdateSize();
bool _GetTopmostCharacter(uint32& character, bool _GetTopmostCharacter(uint32& character,
int32& offset); int32& offset);
@@ -126,9 +126,6 @@ CharacterWindow::CharacterWindow()
if (settings.FindRect("window frame", &frame) == B_OK) { if (settings.FindRect("window frame", &frame) == B_OK) {
MoveTo(frame.LeftTop()); MoveTo(frame.LeftTop());
ResizeTo(frame.Width(), frame.Height()); ResizeTo(frame.Width(), frame.Height());
} else {
MoveTo(BPoint(100, 100));
ResizeTo(600, 450);
} }
// create GUI // create GUI