Bring up Calendar immediately on left click instead of long click, since
there's no longer a need for the differentation. Clean up consequently unused code. Thanks Axel! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39026 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -59,7 +59,6 @@ enum {
|
|||||||
kShowClock,
|
kShowClock,
|
||||||
kChangeClock,
|
kChangeClock,
|
||||||
kHide,
|
kHide,
|
||||||
kLongClick,
|
|
||||||
kShowCalendar
|
kShowCalendar
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -78,8 +77,7 @@ TTimeView::TTimeView(float maxWidth, float height, bool showSeconds,
|
|||||||
fShowSeconds(showSeconds),
|
fShowSeconds(showSeconds),
|
||||||
fMaxWidth(maxWidth),
|
fMaxWidth(maxWidth),
|
||||||
fHeight(height),
|
fHeight(height),
|
||||||
fOrientation(true),
|
fOrientation(true)
|
||||||
fLongClickMessageRunner(NULL)
|
|
||||||
{
|
{
|
||||||
fTime = fLastTime = time(NULL);
|
fTime = fLastTime = time(NULL);
|
||||||
fSeconds = fMinute = fHour = 0;
|
fSeconds = fMinute = fHour = 0;
|
||||||
@@ -106,7 +104,6 @@ TTimeView::TTimeView(BMessage* data)
|
|||||||
|
|
||||||
TTimeView::~TTimeView()
|
TTimeView::~TTimeView()
|
||||||
{
|
{
|
||||||
StopLongClickNotifier();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -210,15 +207,6 @@ TTimeView::MessageReceived(BMessage* message)
|
|||||||
Window()->PostMessage(message, Parent());
|
Window()->PostMessage(message, Parent());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kLongClick:
|
|
||||||
{
|
|
||||||
StopLongClickNotifier();
|
|
||||||
BPoint where;
|
|
||||||
message->FindPoint("where", &where);
|
|
||||||
ShowCalendar(where);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case kShowCalendar:
|
case kShowCalendar:
|
||||||
{
|
{
|
||||||
BRect bounds(Bounds());
|
BRect bounds(Bounds());
|
||||||
@@ -260,31 +248,6 @@ TTimeView::ShowCalendar(BPoint where)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TTimeView::StartLongClickNotifier(BPoint where)
|
|
||||||
{
|
|
||||||
StopLongClickNotifier();
|
|
||||||
|
|
||||||
BMessage longClickMessage(kLongClick);
|
|
||||||
longClickMessage.AddPoint("where", where);
|
|
||||||
|
|
||||||
bigtime_t longClickThreshold;
|
|
||||||
get_click_speed(&longClickThreshold);
|
|
||||||
// use the doubleClickSpeed as a threshold
|
|
||||||
|
|
||||||
fLongClickMessageRunner = new BMessageRunner(BMessenger(this),
|
|
||||||
&longClickMessage, longClickThreshold, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TTimeView::StopLongClickNotifier()
|
|
||||||
{
|
|
||||||
delete fLongClickMessageRunner;
|
|
||||||
fLongClickMessageRunner = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TTimeView::GetCurrentTime()
|
TTimeView::GetCurrentTime()
|
||||||
{
|
{
|
||||||
@@ -335,7 +298,7 @@ TTimeView::MouseDown(BPoint point)
|
|||||||
ShowClockOptions(ConvertToScreen(point));
|
ShowClockOptions(ConvertToScreen(point));
|
||||||
return;
|
return;
|
||||||
} else if (buttons == B_PRIMARY_MOUSE_BUTTON) {
|
} else if (buttons == B_PRIMARY_MOUSE_BUTTON) {
|
||||||
StartLongClickNotifier(point);
|
ShowCalendar(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
// invalidate last time/date strings and call the pulse
|
// invalidate last time/date strings and call the pulse
|
||||||
@@ -346,13 +309,6 @@ TTimeView::MouseDown(BPoint point)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TTimeView::MouseUp(BPoint point)
|
|
||||||
{
|
|
||||||
StopLongClickNotifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TTimeView::Pulse()
|
TTimeView::Pulse()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,14 +71,11 @@ class TTimeView : public BView {
|
|||||||
void FrameMoved(BPoint);
|
void FrameMoved(BPoint);
|
||||||
void MessageReceived(BMessage*);
|
void MessageReceived(BMessage*);
|
||||||
void MouseDown(BPoint where);
|
void MouseDown(BPoint where);
|
||||||
void MouseUp(BPoint where);
|
|
||||||
void Pulse();
|
void Pulse();
|
||||||
|
|
||||||
bool ShowingSeconds() { return fShowSeconds; }
|
bool ShowingSeconds() { return fShowSeconds; }
|
||||||
void ShowSeconds(bool);
|
void ShowSeconds(bool);
|
||||||
void ShowCalendar(BPoint where);
|
void ShowCalendar(BPoint where);
|
||||||
void StartLongClickNotifier(BPoint where);
|
|
||||||
void StopLongClickNotifier();
|
|
||||||
|
|
||||||
bool Orientation() const;
|
bool Orientation() const;
|
||||||
void SetOrientation(bool o);
|
void SetOrientation(bool o);
|
||||||
@@ -118,7 +115,6 @@ class TTimeView : public BView {
|
|||||||
BPoint fDateLocation;
|
BPoint fDateLocation;
|
||||||
|
|
||||||
BMessenger fCalendarWindow;
|
BMessenger fCalendarWindow;
|
||||||
BMessageRunner* fLongClickMessageRunner;
|
|
||||||
|
|
||||||
BLocale fLocale; // For date and time localizing purposes
|
BLocale fLocale; // For date and time localizing purposes
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user