* Made Deskbar not minimizable as well.
* Automatic whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31798 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -72,17 +72,20 @@ TBeMenu *TBarWindow::sBeMenu = NULL;
|
|||||||
|
|
||||||
|
|
||||||
TBarWindow::TBarWindow()
|
TBarWindow::TBarWindow()
|
||||||
: BWindow(BRect(-1000.0f, -1000.0f, -1000.0f, -1000.0f), "Deskbar",
|
:
|
||||||
|
BWindow(BRect(-1000.0f, -1000.0f, -1000.0f, -1000.0f), "Deskbar",
|
||||||
B_BORDERED_WINDOW,
|
B_BORDERED_WINDOW,
|
||||||
B_WILL_ACCEPT_FIRST_CLICK | B_NOT_ZOOMABLE | B_NOT_CLOSABLE
|
B_WILL_ACCEPT_FIRST_CLICK | B_NOT_ZOOMABLE | B_NOT_CLOSABLE
|
||||||
| B_NOT_MOVABLE | B_AVOID_FRONT | B_ASYNCHRONOUS_CONTROLS,
|
| B_NOT_MINIMIZABLE | B_NOT_MOVABLE | B_AVOID_FRONT
|
||||||
|
| B_ASYNCHRONOUS_CONTROLS,
|
||||||
B_ALL_WORKSPACES)
|
B_ALL_WORKSPACES)
|
||||||
{
|
{
|
||||||
desk_settings *settings = ((TBarApp *)be_app)->Settings();
|
desk_settings *settings = ((TBarApp *)be_app)->Settings();
|
||||||
if (settings->alwaysOnTop)
|
if (settings->alwaysOnTop)
|
||||||
SetFeel(B_FLOATING_ALL_WINDOW_FEEL);
|
SetFeel(B_FLOATING_ALL_WINDOW_FEEL);
|
||||||
fBarView = new TBarView(Bounds(), settings->vertical,settings->left, settings->top,
|
fBarView = new TBarView(Bounds(), settings->vertical, settings->left,
|
||||||
settings->ampmMode, settings->state, settings->width, settings->showTime);
|
settings->top, settings->ampmMode, settings->state, settings->width,
|
||||||
|
settings->showTime);
|
||||||
AddChild(fBarView);
|
AddChild(fBarView);
|
||||||
|
|
||||||
RemoveShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY);
|
RemoveShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY);
|
||||||
@@ -96,7 +99,7 @@ TBarWindow::DispatchMessage(BMessage *message, BHandler *handler)
|
|||||||
// Activate the window when you click on it (ie. on the tray area,
|
// Activate the window when you click on it (ie. on the tray area,
|
||||||
// the menu part will do this automatically)
|
// the menu part will do this automatically)
|
||||||
if (message->what == B_MOUSE_DOWN
|
if (message->what == B_MOUSE_DOWN
|
||||||
&& !((TBarApp *)be_app)->Settings()->autoRaise)
|
&& !((TBarApp *)be_app)->Settings()->autoRaise)
|
||||||
Activate(true);
|
Activate(true);
|
||||||
|
|
||||||
BWindow::DispatchMessage(message, handler);
|
BWindow::DispatchMessage(message, handler);
|
||||||
@@ -112,7 +115,7 @@ TBarWindow::MenusBeginning()
|
|||||||
find_directory (B_USER_DESKBAR_DIRECTORY, &path);
|
find_directory (B_USER_DESKBAR_DIRECTORY, &path);
|
||||||
get_ref_for_path(path.Path(), &ref);
|
get_ref_for_path(path.Path(), &ref);
|
||||||
|
|
||||||
BEntry entry(&ref, true);
|
BEntry entry(&ref, true);
|
||||||
if (entry.InitCheck() == B_OK && entry.IsDirectory()) {
|
if (entry.InitCheck() == B_OK && entry.IsDirectory()) {
|
||||||
// need the entry_ref to the actual item
|
// need the entry_ref to the actual item
|
||||||
entry.GetRef(&ref);
|
entry.GetRef(&ref);
|
||||||
@@ -127,7 +130,7 @@ TBarWindow::MenusBeginning()
|
|||||||
dir.CreateDirectory("be", &bedir);
|
dir.CreateDirectory("be", &bedir);
|
||||||
if (bedir.GetEntry(&entry) == B_OK
|
if (bedir.GetEntry(&entry) == B_OK
|
||||||
&& entry.GetRef(&ref) == B_OK)
|
&& entry.GetRef(&ref) == B_OK)
|
||||||
sBeMenu->SetNavDir(&ref);
|
sBeMenu->SetNavDir(&ref);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// this really should never happen
|
// this really should never happen
|
||||||
@@ -275,7 +278,7 @@ TBarWindow::BeMenu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TBarWindow::ShowBeMenu()
|
TBarWindow::ShowBeMenu()
|
||||||
{
|
{
|
||||||
BMenuBar *menuBar = fBarView->BarMenuBar();
|
BMenuBar *menuBar = fBarView->BarMenuBar();
|
||||||
@@ -289,7 +292,7 @@ TBarWindow::ShowBeMenu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TBarWindow::ShowTeamMenu()
|
TBarWindow::ShowTeamMenu()
|
||||||
{
|
{
|
||||||
int32 index = 0;
|
int32 index = 0;
|
||||||
@@ -449,7 +452,7 @@ TBarWindow::ItemInfo(BMessage *message)
|
|||||||
#if SHELF_AWARE
|
#if SHELF_AWARE
|
||||||
replyMsg.AddInt32("shelf", (int32)shelf);
|
replyMsg.AddInt32("shelf", (int32)shelf);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else if (message->FindString("name", &name) == B_OK) {
|
} else if (message->FindString("name", &name) == B_OK) {
|
||||||
if (fBarView->ItemInfo(name, &id, &shelf) == B_OK) {
|
if (fBarView->ItemInfo(name, &id, &shelf) == B_OK) {
|
||||||
replyMsg.AddInt32("id", id);
|
replyMsg.AddInt32("id", id);
|
||||||
@@ -476,13 +479,13 @@ TBarWindow::ItemExists(BMessage *message)
|
|||||||
#endif
|
#endif
|
||||||
shelf = B_DESKBAR_TRAY;
|
shelf = B_DESKBAR_TRAY;
|
||||||
|
|
||||||
bool exists = false;
|
bool exists = false;
|
||||||
if (message->FindInt32("id", &id) == B_OK)
|
if (message->FindInt32("id", &id) == B_OK)
|
||||||
exists = fBarView->ItemExists(id, shelf);
|
exists = fBarView->ItemExists(id, shelf);
|
||||||
else if (message->FindString("name", &name) == B_OK)
|
else if (message->FindString("name", &name) == B_OK)
|
||||||
exists = fBarView->ItemExists(name, shelf);
|
exists = fBarView->ItemExists(name, shelf);
|
||||||
|
|
||||||
replyMsg.AddBool("exists", exists);
|
replyMsg.AddBool("exists", exists);
|
||||||
message->SendReply(&replyMsg);
|
message->SendReply(&replyMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user