diff --git a/src/apps/deskbar/WindowMenu.cpp b/src/apps/deskbar/WindowMenu.cpp
index 895b890..59e31fc 100644
a
|
b
|
Except as contained in this notice, the name of Be Incorporated shall not be
|
26 | 26 | used in advertising or otherwise to promote the sale, use or other dealings in |
27 | 27 | this Software without prior written authorization from Be Incorporated. |
28 | 28 | |
29 | | Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks |
30 | | of Be Incorporated in the United States and other countries. Other brand product |
31 | | names are registered trademarks or trademarks of their respective holders. |
| 29 | Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered |
| 30 | trademarks of Be Incorporated in the United States and other countries. Other |
| 31 | brand product names are registered trademarks or trademarks of their respective |
| 32 | holders. |
32 | 33 | All rights reserved. |
33 | 34 | */ |
34 | 35 | |
… |
… |
void
|
88 | 89 | TWindowMenu::AttachedToWindow() |
89 | 90 | { |
90 | 91 | SetFont(be_plain_font); |
91 | | |
92 | 92 | RemoveItems(0, CountItems(), true); |
93 | | |
94 | 93 | int32 miniCount = 0; |
95 | 94 | |
96 | 95 | bool dragging = false; |
97 | 96 | TBarView* barview =(static_cast<TBarApp*>(be_app))->BarView(); |
98 | 97 | if (barview && barview->LockLooper()) { |
99 | | // 'dragging' mode set in BarView::CacheDragData |
100 | | // invoke in MouseEnter in ExpandoMenuBar |
| 98 | // 'dragging' mode set in BarView::CacheDragData |
| 99 | // invoke in MouseEnter in ExpandoMenuBar |
101 | 100 | dragging = barview->Dragging(); |
102 | 101 | if (dragging) { |
103 | 102 | // We don't want to show the menu when dragging, but it's not |
… |
… |
TWindowMenu::AttachedToWindow()
|
105 | 104 | // Don't call BMenu::Hide(), it causes the menu to pop up every now |
106 | 105 | // and then. |
107 | 106 | Window()->Hide(); |
108 | | // if in expando (horizontal or vertical) |
| 107 | // if in expando (horizontal or vertical) |
109 | 108 | if (barview->Expando()) { |
110 | 109 | SetTrackingHook(barview->MenuTrackingHook, |
111 | 110 | barview->GetTrackingHookData()); |
… |
… |
TWindowMenu::AttachedToWindow()
|
177 | 176 | |
178 | 177 | int32 itemCount = CountItems() + parentMenuItems; |
179 | 178 | if (itemCount < 1) { |
180 | | TWindowMenuItem* noWindowsItem = |
181 | | new TWindowMenuItem(B_TRANSLATE("No windows"), -1, false, false); |
| 179 | TWindowMenuItem* noWindowsItem |
| 180 | = new TWindowMenuItem(B_TRANSLATE("No windows"), -1, false, false); |
182 | 181 | |
183 | 182 | noWindowsItem->SetEnabled(false); |
184 | 183 | |
… |
… |
TWindowMenu::AttachedToWindow()
|
186 | 185 | |
187 | 186 | // if an application has no windows, this feature makes it easy to quit |
188 | 187 | // it. (but we only add this option if the application is not Tracker.) |
189 | | if (fApplicationSignature.ICompare(kTrackerSignature) != 0) { |
| 188 | if (fApplicationSignature.ICompare(kTrackerSignature) != 0) { |
190 | 189 | AddSeparatorItem(); |
191 | 190 | AddItem(new TShowHideMenuItem(B_TRANSLATE("Quit application"), |
192 | 191 | fTeam, B_QUIT_REQUESTED)); |
193 | | } |
| 192 | } |
194 | 193 | } else { |
195 | | // if we are in drag mode, then don't add the window controls |
196 | | // to the menu |
| 194 | // if we are in drag mode, then don't add the window controls |
| 195 | // to the menu |
197 | 196 | if (!dragging) { |
198 | | TShowHideMenuItem* hide = |
199 | | new TShowHideMenuItem(B_TRANSLATE("Hide all"), fTeam, |
| 197 | TShowHideMenuItem* hide |
| 198 | = new TShowHideMenuItem(B_TRANSLATE("Hide all"), fTeam, |
200 | 199 | B_MINIMIZE_WINDOW); |
201 | | TShowHideMenuItem* show = |
202 | | new TShowHideMenuItem(B_TRANSLATE("Show all"), fTeam, |
| 200 | TShowHideMenuItem* show |
| 201 | = new TShowHideMenuItem(B_TRANSLATE("Show all"), fTeam, |
203 | 202 | B_BRING_TO_FRONT); |
204 | | TShowHideMenuItem* close = |
205 | | new TShowHideMenuItem(B_TRANSLATE("Close all"), fTeam, |
| 203 | TShowHideMenuItem* close |
| 204 | = new TShowHideMenuItem(B_TRANSLATE("Close all"), fTeam, |
206 | 205 | B_QUIT_REQUESTED); |
207 | 206 | |
208 | 207 | if (miniCount == itemCount) |
… |
… |
TWindowMenu::AttachedToWindow()
|
212 | 211 | |
213 | 212 | if (!parentMenuItems) |
214 | 213 | AddSeparatorItem(); |
| 214 | |
215 | 215 | AddItem(hide); |
216 | 216 | AddItem(show); |
217 | 217 | AddItem(close); |
… |
… |
TWindowMenu::AttachedToWindow()
|
225 | 225 | void |
226 | 226 | TWindowMenu::DetachedFromWindow() |
227 | 227 | { |
228 | | // in expando mode the teammenu will not call DragStop, |
229 | | // thus, it needs to be called from here |
| 228 | // in expando mode the teammenu will not call DragStop, thus, it needs to |
| 229 | // be called from here |
230 | 230 | TBarView* barview = (dynamic_cast<TBarApp*>(be_app))->BarView(); |
231 | 231 | if (barview && barview->Expando() && barview->Dragging() |
232 | 232 | && barview->LockLooper()) { |
233 | | // We changed the show level in AttachedToWindow(). Undo it. |
| 233 | // We changed the show level in AttachedToWindow(). Undo it. |
234 | 234 | Window()->Show(); |
235 | 235 | barview->DragStop(); |
236 | 236 | barview->UnlockLooper(); |