diff --git a/src/preferences/mouse/MouseView.cpp b/src/preferences/mouse/MouseView.cpp index c15080df55..60b9c4b4ea 100644 --- a/src/preferences/mouse/MouseView.cpp +++ b/src/preferences/mouse/MouseView.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Haiku Inc. All rights reserved. + * Copyright 2003-2015 Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -102,6 +102,28 @@ MouseView::~MouseView() } +void +MouseView::SetMouseType(int32 type) +{ + fType = type; + Invalidate(); +} + + +void +MouseView::MouseMapUpdated() +{ + Invalidate(); +} + + +void +MouseView::UpdateFromSettings() +{ + SetMouseType(fSettings.MouseType()); +} + + void MouseView::GetPreferredSize(float* _width, float* _height) { @@ -112,6 +134,18 @@ MouseView::GetPreferredSize(float* _width, float* _height) } +void +MouseView::AttachedToWindow() +{ + if (Parent() != NULL) + SetViewColor(Parent()->ViewColor()); + else + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + + UpdateFromSettings(); +} + + void MouseView::MouseUp(BPoint) { @@ -183,18 +217,6 @@ MouseView::MouseDown(BPoint where) } -void -MouseView::AttachedToWindow() -{ - if (Parent() != NULL) - SetViewColor(Parent()->ViewColor()); - else - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - - UpdateFromSettings(); -} - - void MouseView::Draw(BRect updateFrame) { @@ -300,26 +322,3 @@ MouseView::_ConvertFromVisualOrder(int32 i) return 1; } } - - -void -MouseView::SetMouseType(int32 type) -{ - fType = type; - Invalidate(); -} - - -void -MouseView::MouseMapUpdated() -{ - Invalidate(); -} - - -void -MouseView::UpdateFromSettings() -{ - SetMouseType(fSettings.MouseType()); -} - diff --git a/src/preferences/mouse/MouseView.h b/src/preferences/mouse/MouseView.h index fb7c81423f..5c86525146 100644 --- a/src/preferences/mouse/MouseView.h +++ b/src/preferences/mouse/MouseView.h @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Haiku Inc. All rights reserved. + * Copyright 2003-2015 Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -20,31 +20,31 @@ class MouseSettings; class MouseView : public BView { public: - MouseView(const MouseSettings &settings); + MouseView(const MouseSettings& settings); virtual ~MouseView(); - virtual void AttachedToWindow(); - virtual void MouseDown(BPoint where); - virtual void MouseUp(BPoint where); - virtual void Draw(BRect frame); - virtual void GetPreferredSize(float *_width, float *_height); - void SetMouseType(int32 type); void MouseMapUpdated(); void UpdateFromSettings(); + virtual void GetPreferredSize(float* _width, float* _height); + virtual void AttachedToWindow(); + virtual void MouseUp(BPoint where); + virtual void MouseDown(BPoint where); + virtual void Draw(BRect frame); + private: - int32 _ConvertFromVisualOrder(int32 button); + int32 _ConvertFromVisualOrder(int32 button); - typedef BView inherited; +private: + typedef BView inherited; - const MouseSettings &fSettings; - BBitmap *fMouseBitmap, *fMouseDownBitmap; - BRect fMouseDownBounds; + const MouseSettings& fSettings; int32 fType; uint32 fButtons; uint32 fOldButtons; }; + #endif /* MOUSE_VIEW_H */