Minor updates

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
David Zeuthen 2010-12-20 15:29:14 -05:00
parent 70f50d61e0
commit 71851a58e5
3 changed files with 17 additions and 22 deletions

View File

@ -55,51 +55,51 @@ function _getDigitWidth(actor){
return width; return width;
} }
function _getCalendarDayAbrreviation(day_number) { function _getCalendarDayAbbreviation(day_number) {
let ret; let ret;
switch (day_number) { switch (day_number) {
case 0: case 0:
/* Translators: One-letter calendar abbreviation for Sunday - note: all one-letter /* Translators: Abbreviation used in calendar grid
* calendar abbreviations are always shown together and in order, * widget. Note: all calendar abbreviations are always shown
* e.g. "S M T W T F S" * together and in order, e.g. "S M T W T F S"
*/ */
ret = _("S"); ret = _("S");
break; break;
case 1: case 1:
/* Translators: One-letter abbreaviation for Monday */ /* Translators: Calendar abbreviation for Monday */
ret = _("M"); ret = _("M");
break; break;
case 2: case 2:
/* Translators: One-letter abbreaviation for Tuesday */ /* Translators: Calendar abbreviation for Tuesday */
ret = _("T"); ret = _("T");
break; break;
case 3: case 3:
/* Translators: One-letter abbreaviation for Wednesday */ /* Translators: Calendar abbreviation for Wednesday */
ret = _("W"); ret = _("W");
break; break;
case 4: case 4:
/* Translators: One-letter abbreaviation for Thursday */ /* Translators: Calendar abbreviation for Thursday */
ret = _("T"); ret = _("T");
break; break;
case 5: case 5:
/* Translators: One-letter abbreaviation for Friday */ /* Translators: Calendar abbreviation for Friday */
ret = _("F"); ret = _("F");
break; break;
case 6: case 6:
/* Translators: One-letter abbreaviation for Saturday */ /* Translators: Calendar abbreviation for Saturday */
ret = _("S"); ret = _("S");
break; break;
} }
return ret; return ret;
} }
function _getEventDayAbrreviation(day_number) { function _getEventDayAbbreviation(day_number) {
let ret; let ret;
switch (day_number) { switch (day_number) {
case 0: case 0:
@ -397,7 +397,7 @@ Calendar.prototype = {
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
// Could use iter.toLocaleFormat('%a') but that normally gives three characters // Could use iter.toLocaleFormat('%a') but that normally gives three characters
// and we want, ideally, a single character for e.g. S M T W T F S // and we want, ideally, a single character for e.g. S M T W T F S
let custom_day_abbrev = _getCalendarDayAbrreviation(iter.getDay()); let custom_day_abbrev = _getCalendarDayAbbreviation(iter.getDay());
let label = new St.Label({ text: custom_day_abbrev }); let label = new St.Label({ text: custom_day_abbrev });
label.style_class = 'calendar-day-base calendar-day-heading'; label.style_class = 'calendar-day-base calendar-day-heading';
this.actor.add(label, this.actor.add(label,
@ -427,11 +427,11 @@ Calendar.prototype = {
switch (event.get_scroll_direction()) { switch (event.get_scroll_direction()) {
case Clutter.ScrollDirection.UP: case Clutter.ScrollDirection.UP:
case Clutter.ScrollDirection.LEFT: case Clutter.ScrollDirection.LEFT:
this._prevMonth(); this._onPrevMonthButtonClicked();
break; break;
case Clutter.ScrollDirection.DOWN: case Clutter.ScrollDirection.DOWN:
case Clutter.ScrollDirection.RIGHT: case Clutter.ScrollDirection.RIGHT:
this._nextMonth(); this._onNextMonthButtonClicked();
break; break;
} }
}, },
@ -601,7 +601,7 @@ EventsList.prototype = {
for (let n = 0; n < tasks.length; n++) { for (let n = 0; n < tasks.length; n++) {
let task = tasks[n]; let task = tasks[n];
let dayString = _getEventDayAbrreviation(task.date.getDay()); let dayString = _getEventDayAbbreviation(task.date.getDay());
let timeString = task.date.toLocaleFormat('%I:%M %p'); // TODO: locale considerations let timeString = task.date.toLocaleFormat('%I:%M %p'); // TODO: locale considerations
let summaryString = task.summary; let summaryString = task.summary;
this._addEvent(dayNameBox, timeBox, eventTitleBox, includeDayName, dayString, timeString, summaryString); this._addEvent(dayNameBox, timeBox, eventTitleBox, includeDayName, dayString, timeString, summaryString);

View File

@ -98,7 +98,7 @@ DateMenuButton.prototype = {
// Event list // Event list
hbox.add(this._event_list.actor); hbox.add(this._event_list.actor);
// Update event list and set it to today when opening the menu .. // Whenever the menu is opened, select today
// //
this.menu.connect('open-state-changed', Lang.bind(this, function(menu, is_open) { this.menu.connect('open-state-changed', Lang.bind(this, function(menu, is_open) {
if (is_open) { if (is_open) {
@ -106,10 +106,6 @@ DateMenuButton.prototype = {
this._calendar.setDate(now); this._calendar.setDate(now);
} }
})); }));
// .. and also update when selecting a new day
this._calendar.connect('selected-date-changed', Lang.bind(this, function(obj, day) {
// Nothing to do here since this._calendar is controlling this._event_list
}));
// Done with hbox for calendar and event list // Done with hbox for calendar and event list
// //

View File

@ -240,8 +240,7 @@ function _relayout() {
// To avoid updating the position and size of the workspaces // To avoid updating the position and size of the workspaces
// in the overview, we just hide the overview. The positions // in the overview, we just hide the overview. The positions
// will be updated when it is next shown. We do the same for // will be updated when it is next shown.
// the calendar popdown.
overview.hide(); overview.hide();
} }