Remove time zone clock option and Time preferences button.
* Nobody thought time zone was a particularly useful option to have in the clock. * You can still open Time preferences from Deskbar by right clicking on the clock, but, since there isn't a big connection between the clock settings in Deskbar and Time preferences anymore this button isn't needed here. * There are still 2 clock options, Show seconds, and Show day of week and day of week is localized as well so this wasn't a total wash.
This commit is contained in:
parent
41651bb3fd
commit
f5be13ecc7
@ -207,7 +207,6 @@ TBarApp::SaveSettings()
|
||||
storedSettings.AddBool("showTime", fSettings.showTime);
|
||||
storedSettings.AddBool("showSeconds", fSettings.showSeconds);
|
||||
storedSettings.AddBool("showDayOfWeek", fSettings.showDayOfWeek);
|
||||
storedSettings.AddBool("showTimeZone", fSettings.showTimeZone);
|
||||
|
||||
storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc);
|
||||
storedSettings.AddInt32("recentAppsCount", fSettings.recentAppsCount);
|
||||
@ -248,7 +247,6 @@ TBarApp::InitSettings()
|
||||
settings.showTime = true;
|
||||
settings.showSeconds = false;
|
||||
settings.showDayOfWeek = false;
|
||||
settings.showTimeZone = false;
|
||||
settings.state = kExpandoState;
|
||||
settings.width = 0;
|
||||
settings.switcherLoc = BPoint(5000, 5000);
|
||||
@ -315,10 +313,6 @@ TBarApp::InitSettings()
|
||||
!= B_OK) {
|
||||
settings.showDayOfWeek = false;
|
||||
}
|
||||
if (storedSettings.FindBool("showTimeZone", &settings.showTimeZone)
|
||||
!= B_OK) {
|
||||
settings.showTimeZone = false;
|
||||
}
|
||||
if (storedSettings.FindPoint("switcherLoc", &settings.switcherLoc)
|
||||
!= B_OK) {
|
||||
settings.switcherLoc = BPoint(5000, 5000);
|
||||
|
@ -78,7 +78,6 @@ struct desk_settings {
|
||||
bool showTime;
|
||||
bool showSeconds;
|
||||
bool showDayOfWeek;
|
||||
bool showTimeZone;
|
||||
uint32 state;
|
||||
float width;
|
||||
BPoint switcherLoc;
|
||||
|
@ -401,7 +401,6 @@ TDeskbarMenu::ResetTargets()
|
||||
case kShowHideTime:
|
||||
case kShowSeconds:
|
||||
case kShowDayOfWeek:
|
||||
case kShowTimeZone:
|
||||
item->SetTarget(fBarView->fReplicantTray);
|
||||
break;
|
||||
}
|
||||
|
@ -90,8 +90,6 @@ PreferencesWindow::PreferencesWindow(BRect frame)
|
||||
new BMessage(kShowSeconds));
|
||||
fShowDayOfWeek = new BCheckBox(B_TRANSLATE("Show day of week"),
|
||||
new BMessage(kShowDayOfWeek));
|
||||
fShowTimeZone = new BCheckBox(B_TRANSLATE("Show time zone"),
|
||||
new BMessage(kShowTimeZone));
|
||||
|
||||
// Get settings from BarApp
|
||||
TBarApp* barApp = static_cast<TBarApp*>(be_app);
|
||||
@ -157,11 +155,9 @@ PreferencesWindow::PreferencesWindow(BRect frame)
|
||||
if (replicantTray->Time() != NULL) {
|
||||
fShowSeconds->SetValue(replicantTray->Time()->ShowSeconds());
|
||||
fShowDayOfWeek->SetValue(replicantTray->Time()->ShowDayOfWeek());
|
||||
fShowTimeZone->SetValue(replicantTray->Time()->ShowTimeZone());
|
||||
} else {
|
||||
fShowSeconds->SetValue(settings->showSeconds);
|
||||
fShowDayOfWeek->SetValue(settings->showDayOfWeek);
|
||||
fShowTimeZone->SetValue(settings->showTimeZone);
|
||||
}
|
||||
|
||||
EnableDisableDependentItems();
|
||||
@ -179,7 +175,6 @@ PreferencesWindow::PreferencesWindow(BRect frame)
|
||||
|
||||
fShowSeconds->SetTarget(replicantTray);
|
||||
fShowDayOfWeek->SetTarget(replicantTray);
|
||||
fShowTimeZone->SetTarget(replicantTray);
|
||||
|
||||
// Layout
|
||||
fMenuBox = new BBox("fMenuBox");
|
||||
@ -253,14 +248,8 @@ PreferencesWindow::PreferencesWindow(BRect frame)
|
||||
|
||||
view = BLayoutBuilder::Group<>()
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
.SetInsets(0, 0, 0, B_USE_DEFAULT_SPACING)
|
||||
.Add(fShowSeconds)
|
||||
.Add(fShowDayOfWeek)
|
||||
.Add(fShowTimeZone)
|
||||
.End()
|
||||
.Add(new BButton(B_TRANSLATE("Time preferences" B_UTF8_ELLIPSIS),
|
||||
new BMessage(kTimePreferences)))
|
||||
.Add(fShowSeconds)
|
||||
.Add(fShowDayOfWeek)
|
||||
.AddGlue()
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
@ -311,11 +300,6 @@ PreferencesWindow::MessageReceived(BMessage* message)
|
||||
EnableDisableDependentItems();
|
||||
break;
|
||||
|
||||
case kTimePreferences:
|
||||
// launch the time prefs app
|
||||
be_roster->Launch("application/x-vnd.Haiku-Time");
|
||||
break;
|
||||
|
||||
default:
|
||||
BWindow::MessageReceived(message);
|
||||
break;
|
||||
|
@ -26,8 +26,6 @@ const uint32 kAutoHide = 'AtHd';
|
||||
const uint32 kShowHideTime = 'ShTm';
|
||||
const uint32 kShowSeconds = 'SwSc';
|
||||
const uint32 kShowDayOfWeek = 'SwDw';
|
||||
const uint32 kShowTimeZone = 'SwTz';
|
||||
const uint32 kTimePreferences = 'TmPr';
|
||||
|
||||
class BBox;
|
||||
class BButton;
|
||||
@ -76,7 +74,6 @@ private:
|
||||
|
||||
BCheckBox* fShowSeconds;
|
||||
BCheckBox* fShowDayOfWeek;
|
||||
BCheckBox* fShowTimeZone;
|
||||
};
|
||||
|
||||
|
||||
|
@ -150,8 +150,7 @@ TReplicantTray::TReplicantTray(TBarView* parent, bool vertical)
|
||||
|
||||
// Create the time view
|
||||
fTime = new TTimeView(fMinimumTrayWidth, kMaxReplicantHeight - 1.0,
|
||||
use24HourClock, settings->showSeconds, settings->showDayOfWeek,
|
||||
settings->showTimeZone);
|
||||
use24HourClock, settings->showSeconds, settings->showDayOfWeek);
|
||||
}
|
||||
|
||||
|
||||
@ -319,17 +318,6 @@ TReplicantTray::MessageReceived(BMessage* message)
|
||||
AdjustPlacement();
|
||||
break;
|
||||
|
||||
case kShowTimeZone:
|
||||
if (fTime == NULL)
|
||||
return;
|
||||
|
||||
fTime->SetShowTimeZone(!fTime->ShowTimeZone());
|
||||
|
||||
// time string reformat -> realign
|
||||
RealignReplicants();
|
||||
AdjustPlacement();
|
||||
break;
|
||||
|
||||
#ifdef DB_ADDONS
|
||||
case B_NODE_MONITOR:
|
||||
HandleEntryUpdate(message);
|
||||
@ -1252,7 +1240,6 @@ TReplicantTray::SaveTimeSettings()
|
||||
settings->showTime = !fTime->IsHidden();
|
||||
settings->showSeconds = fTime->ShowSeconds();
|
||||
settings->showDayOfWeek = fTime->ShowDayOfWeek();
|
||||
settings->showTimeZone = fTime->ShowTimeZone();
|
||||
}
|
||||
|
||||
|
||||
@ -1599,4 +1586,3 @@ TDragRegion::SetDragRegionLocation(int32 location)
|
||||
fDragLocation = location;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ enum {
|
||||
|
||||
|
||||
TTimeView::TTimeView(float maxWidth, float height, bool use24HourClock,
|
||||
bool showSeconds, bool showDayOfWeek, bool showTimeZone)
|
||||
bool showSeconds, bool showDayOfWeek)
|
||||
:
|
||||
BView(BRect(-100, -100, -90, -90), "_deskbar_tv_",
|
||||
B_FOLLOW_RIGHT | B_FOLLOW_TOP,
|
||||
@ -79,8 +79,7 @@ TTimeView::TTimeView(float maxWidth, float height, bool use24HourClock,
|
||||
fOrientation(true),
|
||||
fUse24HourClock(use24HourClock),
|
||||
fShowSeconds(showSeconds),
|
||||
fShowDayOfWeek(showDayOfWeek),
|
||||
fShowTimeZone(showTimeZone)
|
||||
fShowDayOfWeek(showDayOfWeek)
|
||||
{
|
||||
fCurrentTime = fLastTime = time(NULL);
|
||||
fSeconds = fMinute = fHour = 0;
|
||||
@ -354,21 +353,6 @@ TTimeView::SetShowDayOfWeek(bool show)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TTimeView::ShowTimeZone() const
|
||||
{
|
||||
return fShowTimeZone;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TTimeView::SetShowTimeZone(bool show)
|
||||
{
|
||||
fShowTimeZone = show;
|
||||
Update();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TTimeView::ShowCalendar(BPoint where)
|
||||
{
|
||||
@ -433,14 +417,6 @@ TTimeView::CalculateTextPlacement()
|
||||
BFont font;
|
||||
GetFont(&font);
|
||||
|
||||
// If 12 hour clock with all options turned on shrink font size to fit.
|
||||
if (!fUse24HourClock && fShowSeconds && fShowDayOfWeek && fShowTimeZone)
|
||||
font.SetSize(11.0);
|
||||
else
|
||||
font.SetSize(12.0);
|
||||
|
||||
SetFont(&font, B_FONT_SIZE);
|
||||
|
||||
const char* stringArray[1];
|
||||
stringArray[0] = fCurrentTimeStr;
|
||||
BRect rectArray[1];
|
||||
@ -517,8 +493,5 @@ TTimeView::UpdateTimeFormat()
|
||||
if (!fUse24HourClock)
|
||||
timeFormat.Append(" a");
|
||||
|
||||
if (fShowTimeZone)
|
||||
timeFormat.Append(" V");
|
||||
|
||||
fTimeFormat = timeFormat;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class TTimeView : public BView {
|
||||
public:
|
||||
TTimeView(float maxWidth, float height,
|
||||
bool use24HourClock, bool showSeconds,
|
||||
bool showDayOfWeek, bool showTimeZone);
|
||||
bool showDayOfWeek);
|
||||
TTimeView(BMessage* data);
|
||||
~TTimeView();
|
||||
|
||||
@ -86,9 +86,6 @@ public:
|
||||
bool ShowDayOfWeek() const;
|
||||
void SetShowDayOfWeek(bool show);
|
||||
|
||||
bool ShowTimeZone() const;
|
||||
void SetShowTimeZone(bool show);
|
||||
|
||||
void ShowCalendar(BPoint where);
|
||||
|
||||
private:
|
||||
@ -123,7 +120,6 @@ private:
|
||||
bool fUse24HourClock;
|
||||
bool fShowSeconds;
|
||||
bool fShowDayOfWeek;
|
||||
bool fShowTimeZone;
|
||||
BString fTimeFormat;
|
||||
|
||||
BPoint fTimeLocation;
|
||||
|
Loading…
x
Reference in New Issue
Block a user