From 10cf5ccec2581318ec86ff445d4aaf8e4c1d4636 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 20 Oct 2010 19:08:00 +0000 Subject: [PATCH] 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 --- src/apps/deskbar/TimeView.cpp | 48 ++--------------------------------- src/apps/deskbar/TimeView.h | 4 --- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp index 7b621e1e35..3aacc31819 100644 --- a/src/apps/deskbar/TimeView.cpp +++ b/src/apps/deskbar/TimeView.cpp @@ -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() { diff --git a/src/apps/deskbar/TimeView.h b/src/apps/deskbar/TimeView.h index 9d6f42d295..6034fb0fbd 100644 --- a/src/apps/deskbar/TimeView.h +++ b/src/apps/deskbar/TimeView.h @@ -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 };