From d858695df82cc9e457637675ea28d97629e75b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 4 Mar 2004 02:02:09 +0000 Subject: [PATCH] Some R5 fixes that don't affect Dano/Zeta, and hopefully won't affect us, too: - BWindow::SetSizeLimits() don't change the window size if it's bigger than the maximum. - BTabView::Select() crashes when the view is not yet attached to a window. - BMenuItem::DrawContent() has wrong drawing mode set (not really a big issue, but I think Draw() should call DrawContent() with correct and usable values) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6894 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/diskprobe/AttributeWindow.cpp | 3 +++ src/apps/diskprobe/ProbeView.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/apps/diskprobe/AttributeWindow.cpp b/src/apps/diskprobe/AttributeWindow.cpp index f8f803163a..bce20951cd 100644 --- a/src/apps/diskprobe/AttributeWindow.cpp +++ b/src/apps/diskprobe/AttributeWindow.cpp @@ -150,6 +150,9 @@ EditorTabView::SetTypeEditorTab(BView *view) tab->SetView(view); FrameResized(0, 0); +#ifdef COMPILE_FOR_R5 + if (Parent() != NULL) +#endif Select(0); } diff --git a/src/apps/diskprobe/ProbeView.cpp b/src/apps/diskprobe/ProbeView.cpp index e9ae1e6021..372c674c41 100644 --- a/src/apps/diskprobe/ProbeView.cpp +++ b/src/apps/diskprobe/ProbeView.cpp @@ -896,6 +896,10 @@ TypeMenuItem::DrawContent() point.x = Frame().right - 4 - Menu()->StringWidth(fType.String()); point.y += fontHeight.ascent; +#ifdef COMPILE_FOR_R5 + Menu()->SetDrawingMode(B_OP_ALPHA); +#endif + Menu()->DrawString(fType.String(), point); } @@ -1096,6 +1100,14 @@ ProbeView::UpdateSizeLimits() 200, height + frame.bottom + 4 + B_H_SCROLL_BAR_HEIGHT); } else Window()->SetSizeLimits(200, 32768, 200, 32768); + +#ifdef COMPILE_FOR_R5 + BRect bounds = Window()->Bounds(); + float minWidth, maxWidth, minHeight, maxHeight; + Window()->GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight); + if (maxWidth < bounds.Width() || maxHeight < bounds.Height()) + Window()->ResizeTo(MIN(maxWidth, bounds.Width()), MIN(maxHeight, bounds.Height())); +#endif }