| Summary: | DateTime doesn't mark current date with SWT.CALENDAR style | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Arun Thondapu <arunkumar.thondapu> | ||||||
| Component: | SWT | Assignee: | Sravan Kumar Lakkimsetti <sravankumarl> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | sravankumarl | ||||||
| Version: | 4.1 | ||||||||
| Target Milestone: | 4.4 M5 | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux-GTK | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Arun Thondapu
Sravan, can you please provide a patch for this? Thanks! The approach I am looking is set the gtk_calendar_mark_day() when the calendar is showing the current month and year. otherwise remove the highlighting marks on the calendar using gtk_calendar_clear_marks This will highlight the todays date. Created attachment 238955 [details] Proposed Patch Here is the proposed patch for Bug339754. I am unable to submit the patch to gerrit. Due to this I am attaching the patch here Thanks Sravan Arun, Can you please review the patch attached? Thanks Sravan Created attachment 239049 [details]
Revised Patch
revised patch to include fix for highlighting the current date(today) when we move
to current month using arrow keys.
For example if the current month is jan 2014 and using arrow keys move to different month and comeback to jan 2014 the current date is not getting highlighted. This patch fixes the problem.
Description of the fix
The highlighting of current date is taken care by the calendar sendselectionevent method. In the mouse movement for the popupCalendar there is a call to clear all the marks, this is causing the problem. Since the highlighting is handled by the Calendar object already this is not required anymore
(In reply to Sravan Kumar Lakkimsetti from comment #5) > Created attachment 239049 [details] > Revised Patch > > revised patch to include fix for highlighting the current date(today) when > we move > to current month using arrow keys. > For example if the current month is jan 2014 and using arrow keys move to > different month and comeback to jan 2014 the current date is not getting > highlighted. This patch fixes the problem. Thanks for the patch Sravan! I have tested it and it seems to be working fine for me but there are a couple of changes to be made. 1) The current date is not highlighted when the calendar becomes visible for the first time after creation, it seems to work only after some date change event is processed. (tested with ControlExample and Snippet250). 2) Please change the if ... else code block to follow SWT coding style as follows: if (something) { // do something } else { // do something else } Fixed this bug with the following commit https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6c621148e4f8d62b288aaf2751c64105309afd20 |