* 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:
parent
8df44a6cda
commit
cdb69c4a02
@ -48,13 +48,14 @@ StyleView::StyleView(BRect frame)
|
|||||||
#ifdef __HAIKU__
|
#ifdef __HAIKU__
|
||||||
: BView("style view", 0),
|
: BView("style view", 0),
|
||||||
#else
|
#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
|
#endif
|
||||||
fCommandStack(NULL),
|
fCommandStack(NULL),
|
||||||
fCurrentColor(NULL),
|
fCurrentColor(NULL),
|
||||||
fStyle(NULL),
|
fStyle(NULL),
|
||||||
fGradient(NULL),
|
fGradient(NULL),
|
||||||
fIgnoreCurrentColorNotifications(false)
|
fIgnoreCurrentColorNotifications(false),
|
||||||
|
fPreviousBounds(frame.OffsetToCopy(B_ORIGIN))
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
@ -184,6 +185,25 @@ StyleView::AttachedToWindow()
|
|||||||
fGradientType->Menu()->SetTargetForItems(this);
|
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
|
// MessageReceived
|
||||||
void
|
void
|
||||||
StyleView::MessageReceived(BMessage* message)
|
StyleView::MessageReceived(BMessage* message)
|
||||||
|
@ -42,6 +42,7 @@ class StyleView : public BView,
|
|||||||
|
|
||||||
// BView interface
|
// BView interface
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
|
virtual void FrameResized(float width, float height);
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
#if __HAIKU__
|
#if __HAIKU__
|
||||||
@ -77,6 +78,8 @@ class StyleView : public BView,
|
|||||||
GradientControl* fGradientControl;
|
GradientControl* fGradientControl;
|
||||||
BMenuField* fStyleType;
|
BMenuField* fStyleType;
|
||||||
BMenuField* fGradientType;
|
BMenuField* fGradientType;
|
||||||
|
|
||||||
|
BRect fPreviousBounds;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STYLE_VIEW_H
|
#endif // STYLE_VIEW_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user