Replace calls to DragRegion() with fDragRegion avoiding a function call. Move variables in MouseMoved down to just before they are used.
This commit is contained in:
@@ -254,19 +254,19 @@ TBarView::MessageReceived(BMessage* message)
|
|||||||
void
|
void
|
||||||
TBarView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage)
|
TBarView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage)
|
||||||
{
|
{
|
||||||
desk_settings* settings = ((TBarApp*)be_app)->Settings();
|
if (fDragRegion->IsDragging()) {
|
||||||
bool alwaysOnTop = settings->alwaysOnTop;
|
fDragRegion->MouseMoved(where, transit, dragMessage);
|
||||||
bool autoRaise = settings->autoRaise;
|
|
||||||
bool autoHide = settings->autoHide;
|
|
||||||
|
|
||||||
if (DragRegion()->IsDragging()) {
|
|
||||||
DragRegion()->MouseMoved(where, transit, dragMessage);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transit == B_ENTERED_VIEW && EventMask() == 0)
|
if (transit == B_ENTERED_VIEW && EventMask() == 0)
|
||||||
SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||||
|
|
||||||
|
desk_settings* settings = ((TBarApp*)be_app)->Settings();
|
||||||
|
bool alwaysOnTop = settings->alwaysOnTop;
|
||||||
|
bool autoRaise = settings->autoRaise;
|
||||||
|
bool autoHide = settings->autoHide;
|
||||||
|
|
||||||
if (!autoRaise && !autoHide) {
|
if (!autoRaise && !autoHide) {
|
||||||
if (transit == B_EXITED_VIEW || transit == B_OUTSIDE_VIEW)
|
if (transit == B_EXITED_VIEW || transit == B_OUTSIDE_VIEW)
|
||||||
SetEventMask(0);
|
SetEventMask(0);
|
||||||
@@ -324,8 +324,7 @@ TBarView::MouseDown(BPoint where)
|
|||||||
if ((modifiers() & (B_CONTROL_KEY | B_COMMAND_KEY | B_OPTION_KEY
|
if ((modifiers() & (B_CONTROL_KEY | B_COMMAND_KEY | B_OPTION_KEY
|
||||||
| B_SHIFT_KEY)) == (B_CONTROL_KEY | B_COMMAND_KEY)) {
|
| B_SHIFT_KEY)) == (B_CONTROL_KEY | B_COMMAND_KEY)) {
|
||||||
// The window key was pressed - enter dragging code
|
// The window key was pressed - enter dragging code
|
||||||
DragRegion()->MouseDown(
|
fDragRegion->MouseDown(fDragRegion->DragRegion().LeftTop());
|
||||||
DragRegion()->DragRegion().LeftTop());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -504,7 +503,7 @@ TBarView::GetPreferredWindowSize(BRect screenFrame, float* width, float* height)
|
|||||||
float windowHeight = 0;
|
float windowHeight = 0;
|
||||||
float windowWidth = sMinimumWindowWidth;
|
float windowWidth = sMinimumWindowWidth;
|
||||||
bool setToHiddenSize = ((TBarApp*)be_app)->Settings()->autoHide
|
bool setToHiddenSize = ((TBarApp*)be_app)->Settings()->autoHide
|
||||||
&& IsHidden() && !DragRegion()->IsDragging();
|
&& IsHidden() && !fDragRegion->IsDragging();
|
||||||
int32 iconSize = static_cast<TBarApp*>(be_app)->IconSize();
|
int32 iconSize = static_cast<TBarApp*>(be_app)->IconSize();
|
||||||
|
|
||||||
if (setToHiddenSize) {
|
if (setToHiddenSize) {
|
||||||
|
|||||||
Reference in New Issue
Block a user