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:
Rene Gollent
2010-10-20 19:08:00 +00:00
parent 3fa608387d
commit 10cf5ccec2
2 changed files with 2 additions and 50 deletions
+2 -46
View File
@@ -59,7 +59,6 @@ enum {
kShowClock,
kChangeClock,
kHide,
kLongClick,
kShowCalendar
};
@@ -78,8 +77,7 @@ TTimeView::TTimeView(float maxWidth, float height, bool showSeconds,
fShowSeconds(showSeconds),
fMaxWidth(maxWidth),
fHeight(height),
fOrientation(true),
fLongClickMessageRunner(NULL)
fOrientation(true)
{
fTime = fLastTime = time(NULL);
fSeconds = fMinute = fHour = 0;
@@ -106,7 +104,6 @@ TTimeView::TTimeView(BMessage* data)
TTimeView::~TTimeView()
{
StopLongClickNotifier();
}
@@ -210,15 +207,6 @@ TTimeView::MessageReceived(BMessage* message)
Window()->PostMessage(message, Parent());
break;
case kLongClick:
{
StopLongClickNotifier();
BPoint where;
message->FindPoint("where", &where);
ShowCalendar(where);
break;
}
case kShowCalendar:
{
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
TTimeView::GetCurrentTime()
{
@@ -335,7 +298,7 @@ TTimeView::MouseDown(BPoint point)
ShowClockOptions(ConvertToScreen(point));
return;
} else if (buttons == B_PRIMARY_MOUSE_BUTTON) {
StartLongClickNotifier(point);
ShowCalendar(point);
}
// invalidate last time/date strings and call the pulse
@@ -346,13 +309,6 @@ TTimeView::MouseDown(BPoint point)
}
void
TTimeView::MouseUp(BPoint point)
{
StopLongClickNotifier();
}
void
TTimeView::Pulse()
{
-4
View File
@@ -71,14 +71,11 @@ class TTimeView : public BView {
void FrameMoved(BPoint);
void MessageReceived(BMessage*);
void MouseDown(BPoint where);
void MouseUp(BPoint where);
void Pulse();
bool ShowingSeconds() { return fShowSeconds; }
void ShowSeconds(bool);
void ShowCalendar(BPoint where);
void StartLongClickNotifier(BPoint where);
void StopLongClickNotifier();
bool Orientation() const;
void SetOrientation(bool o);
@@ -118,7 +115,6 @@ class TTimeView : public BView {
BPoint fDateLocation;
BMessenger fCalendarWindow;
BMessageRunner* fLongClickMessageRunner;
BLocale fLocale; // For date and time localizing purposes
};