* take care of invalidating resized menufields on BeOS

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22227 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2007-09-13 11:49:38 +00:00
parent 8df44a6cda
commit cdb69c4a02
2 changed files with 25 additions and 2 deletions

View File

@ -48,13 +48,14 @@ StyleView::StyleView(BRect frame)
#ifdef __HAIKU__
: BView("style view", 0),
#else
: BView(frame, "style view", B_FOLLOW_LEFT | B_FOLLOW_TOP, 0),
: BView(frame, "style view", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_FRAME_EVENTS),
#endif
fCommandStack(NULL),
fCurrentColor(NULL),
fStyle(NULL),
fGradient(NULL),
fIgnoreCurrentColorNotifications(false)
fIgnoreCurrentColorNotifications(false),
fPreviousBounds(frame.OffsetToCopy(B_ORIGIN))
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@ -184,6 +185,25 @@ StyleView::AttachedToWindow()
fGradientType->Menu()->SetTargetForItems(this);
}
// FrameResized
void
StyleView::FrameResized(float width, float height)
{
BRect bounds = Bounds();
#ifndef __HAIKU__
// Grrr, babysit the menubars...
BRect dirty = bounds;
dirty.left = min_c(bounds.right, fPreviousBounds.right) - 25;
fStyleType->ConvertFromParent(&dirty);
fStyleType->MenuBar()->ConvertFromParent(&dirty);
fStyleType->MenuBar()->Invalidate(dirty);
fGradientType->MenuBar()->Invalidate(dirty);
#endif // !__HAIKU__
fPreviousBounds = bounds;
}
// MessageReceived
void
StyleView::MessageReceived(BMessage* message)

View File

@ -42,6 +42,7 @@ class StyleView : public BView,
// BView interface
virtual void AttachedToWindow();
virtual void FrameResized(float width, float height);
virtual void MessageReceived(BMessage* message);
#if __HAIKU__
@ -77,6 +78,8 @@ class StyleView : public BView,
GradientControl* fGradientControl;
BMenuField* fStyleType;
BMenuField* fGradientType;
BRect fPreviousBounds;
};
#endif // STYLE_VIEW_H