Ticket #7052: Deskbar WindowMenu Refactoring 1.diff
File Deskbar WindowMenu Refactoring 1.diff, 2.4 KB (added by , 13 years ago) |
---|
-
src/apps/deskbar/WindowMenu.cpp
81 81 fExpandedIndex(0) 82 82 { 83 83 SetItemMargins(0.0f, 0.0f, 0.0f, 0.0f); 84 fBarView = static_cast<TBarApp*>(be_app)->BarView(); 84 85 } 85 86 86 87 … … 94 95 int32 miniCount = 0; 95 96 96 97 bool dragging = false; 97 TBarView* barview =(static_cast<TBarApp*>(be_app))->BarView(); 98 if (barview && barview->LockLooper()) { 98 if (fBarView && fBarView->LockLooper()) { 99 99 // 'dragging' mode set in BarView::CacheDragData 100 100 // invoke in MouseEnter in ExpandoMenuBar 101 dragging = barview->Dragging();101 dragging = fBarView->Dragging(); 102 102 if (dragging) { 103 103 // We don't want to show the menu when dragging, but it's not 104 104 // possible to remove a submenu once it exists, so we simply hide it … … 106 106 // and then. 107 107 Window()->Hide(); 108 108 // if in expando (horizontal or vertical) 109 if ( barview->Expando()) {110 SetTrackingHook( barview->MenuTrackingHook,111 barview->GetTrackingHookData());109 if (fBarView->Expando()) { 110 SetTrackingHook(fBarView->MenuTrackingHook, 111 fBarView->GetTrackingHookData()); 112 112 } 113 barview->DragStart();113 fBarView->DragStart(); 114 114 } 115 barview->UnlockLooper();115 fBarView->UnlockLooper(); 116 116 } 117 117 118 118 int32 parentMenuItems = 0; … … 227 227 { 228 228 // in expando mode the teammenu will not call DragStop, 229 229 // thus, it needs to be called from here 230 TBarView* barview = (dynamic_cast<TBarApp*>(be_app))->BarView(); 231 if (barview && barview->Expando() && barview->Dragging() 232 && barview->LockLooper()) { 230 if (fBarView && fBarView->Expando() && fBarView->Dragging() 231 && fBarView->LockLooper()) { 233 232 // We changed the show level in AttachedToWindow(). Undo it. 234 233 Window()->Show(); 235 barview->DragStop();236 barview->UnlockLooper();234 fBarView->DragStop(); 235 fBarView->UnlockLooper(); 237 236 } 238 237 239 238 BMenu::DetachedFromWindow(); -
src/apps/deskbar/WindowMenu.h
55 55 static bool WindowShouldBeListed(uint32 behavior); 56 56 57 57 private: 58 const BList *fTeam; 58 const BList* fTeam; 59 TBarView* fBarView; 59 60 BString fApplicationSignature; 60 61 bool fExpanded; 61 62 int fExpandedIndex;