Imported files from OT-current:

* ExpandoMenuBar.cpp 1.18
* CalendarMenuItem.cpp 1.6
* WindowMenu.cpp 1.3
* TimeView.cpp 1.14
* StatusView.cpp 1.18
* BarWindow.cpp 1.8


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18482 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-08-11 13:24:57 +00:00
parent 4f459891dd
commit a5210ab17d
6 changed files with 41 additions and 31 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2005, Axel Dörfler, [email protected]. All rights reserved. * Copyright 2005-2006, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -13,7 +13,7 @@
#include <time.h> #include <time.h>
static const int32 kDaysPerMonth[] = {31, 28, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31}; static const int32 kDaysPerMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
// Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec // Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
static const int32 kTitleFontSize = 9; static const int32 kTitleFontSize = 9;
+17 -7
View File
@@ -300,8 +300,7 @@ TReplicantTray::AdjustPlacement()
{ {
// called when an add-on has been added or removed // called when an add-on has been added or removed
// need to resize the parent of this accordingly // need to resize the parent of this accordingly
//
// call to Parent will call ResizeToPreferred
BRect bounds = Bounds(); BRect bounds = Bounds();
float width, height; float width, height;
GetPreferredSize(&width, &height); GetPreferredSize(&width, &height);
@@ -348,7 +347,7 @@ TReplicantTray::MessageReceived(BMessage *message)
AdjustPlacement(); AdjustPlacement();
break; break;
case 'trfm': case 'Trfm':
// time string reformat -> realign // time string reformat -> realign
DealWithClock(fBarView->ShowingClock()); DealWithClock(fBarView->ShowingClock());
RealignReplicants(); RealignReplicants();
@@ -1065,11 +1064,26 @@ TReplicantTray::AddIcon(BMessage *icon, int32 *id, const entry_ref *addOn)
if (icon->what == B_ARCHIVED_OBJECT) if (icon->what == B_ARCHIVED_OBJECT)
icon->what = 0; icon->what = 0;
BRect originalBounds = icon->FindRect("_frame");
// this is a work-around for buggy replicants that change their
// size in AttachedToWindow() (such as "SVM")
// !! check for name collisions? // !! check for name collisions?
status = fShelf->AddReplicant(icon, BPoint(1, 1)); status = fShelf->AddReplicant(icon, BPoint(1, 1));
if (status != B_OK) if (status != B_OK)
return status; return status;
int32 count = fShelf->CountReplicants();
BView *view;
fShelf->ReplicantAt(count - 1, &view, (uint32 *)id, NULL);
if (originalBounds != view->Bounds()) {
// The replicant changed its size when added to the window, so we need
// to recompute all over again (it's already done once via BShelf::AddReplicant()
// and TReplicantShelf::CanAcceptReplicantView())
RealignReplicants();
}
float oldWidth = Bounds().Width(); float oldWidth = Bounds().Width();
float oldHeight = Bounds().Height(); float oldHeight = Bounds().Height();
float width, height; float width, height;
@@ -1077,10 +1091,6 @@ TReplicantTray::AddIcon(BMessage *icon, int32 *id, const entry_ref *addOn)
if (oldWidth != width || oldHeight != height) if (oldWidth != width || oldHeight != height)
AdjustPlacement(); AdjustPlacement();
int32 count = fShelf->CountReplicants();
BView *view;
fShelf->ReplicantAt(count-1, &view, (uint32 *)id, NULL);
// add the item to the add-on list // add the item to the add-on list
AddItem(*id, nodeRef, entry, addOn != NULL); AddItem(*id, nodeRef, entry, addOn != NULL);
+7 -7
View File
@@ -49,6 +49,11 @@ All rights reserved.
#include <string.h> #include <string.h>
const char *kShortDateFormat = "%m/%d/%y";
const char *kShortEuroDateFormat = "%d/%m/%y";
const char *kLongDateFormat = "%a, %B %d, %Y";
const char *kLongEuroDateFormat = "%a, %d %B, %Y";
static const char * const kMinString = "99:99 AM"; static const char * const kMinString = "99:99 AM";
@@ -263,12 +268,6 @@ TTimeView::GetCurrentTime()
} }
const char *kShortDateFormat = "%m/%d/%y";
const char *kShortEuroDateFormat = "%d/%m/%y";
const char *kLongDateFormat = "%a, %B %d, %Y";
const char *kLongEuroDateFormat = "%a, %d %B, %Y";
void void
TTimeView::GetCurrentDate() TTimeView::GetCurrentDate()
{ {
@@ -477,7 +476,8 @@ TTimeView::Update()
CalculateTextPlacement(); CalculateTextPlacement();
if (fParent) { if (fParent) {
fParent->MessageReceived(new BMessage('trfm')); BMessage reformat('Trfm');
fParent->MessageReceived(&reformat);
// time string format realign // time string format realign
fParent->Invalidate(); fParent->Invalidate();
} }
+1 -1
View File
@@ -174,7 +174,7 @@ TWindowMenu::AttachedToWindow()
// if an application has no windows, this feature makes it easy to quit it. // if an application has no windows, this feature makes it easy to quit it.
// (but we only add this option if the application is not Tracker.) // (but we only add this option if the application is not Tracker.)
if (fApplicationSignature.Compare(kTrackerSignature) != 0) { if (fApplicationSignature.ICompare(kTrackerSignature) != 0) {
AddSeparatorItem(); AddSeparatorItem();
AddItem(new TShowHideMenuItem("Quit Application", fTeam, B_QUIT_REQUESTED)); AddItem(new TShowHideMenuItem("Quit Application", fTeam, B_QUIT_REQUESTED));
} }