From d3673933a87c691643c77efc4261b9347fbabd89 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 31 Oct 2006 22:56:53 +0000 Subject: [PATCH] Monotone-Parent: 26ae83c519411a3dbc3e5d45991a5ed34a6756db Monotone-Revision: 520d3359a27192e2a9761e453f816cdd755a1509 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-31T22:56:53 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 +++ UI/Scheduler/UIxCalCalendarsListView.m | 32 +++++++++++++++++++ .../SchedulerUI/UIxCalCalendarsListView.wox | 4 +++ 3 files changed, 40 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9fb63e9da..b4af5aa39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-31 Wolfgang Sourdeau + * UI/Scheduler/UIxCalCalendarsListView.m ([UIxCalCalendarsListView + -currentContactAptBorder]): new method that returns the + appropriate border color for the specified user. + * SoObjects/Appointments/SOGoAppointmentObject.m ([SOGoAppointmentObject -saveContentString:contentStringbaseVersion:baseVersion]): diff --git a/UI/Scheduler/UIxCalCalendarsListView.m b/UI/Scheduler/UIxCalCalendarsListView.m index c724553d3..c84369be9 100644 --- a/UI/Scheduler/UIxCalCalendarsListView.m +++ b/UI/Scheduler/UIxCalCalendarsListView.m @@ -30,6 +30,23 @@ #import "UIxCalCalendarsListView.h" +static inline char +darkenedColor (const char value) +{ + char newValue; + + if (value >= '0' && value <= '9') + newValue = ((value - '0') / 2) + '0'; + else if (value >= 'a' && value <= 'f') + newValue = ((value + 10 - 'a') / 2) + '0'; + else if (value >= 'A' && value <= 'F') + newValue = ((value + 10 - 'A') / 2) + '0'; + else + newValue = value; + + return newValue; +} + @implementation UIxCalCalendarsListView - (id) init @@ -177,6 +194,21 @@ return [colors objectForKey: [currentContactPerson cn]]; } +- (NSString *) currentContactAptBorder +{ + NSString *spanBG; + char cColor[8]; + unsigned int count; + + spanBG = [colors objectForKey: [currentContactPerson cn]]; + [spanBG getCString: cColor]; + cColor[7] = 0; + for (count = 1; count < 7; count++) + cColor[count] = darkenedColor(cColor[count]); + + return [NSString stringWithCString: cColor]; +} + - (NSDictionary *) colors { return colors; diff --git a/UI/Templates/SchedulerUI/UIxCalCalendarsListView.wox b/UI/Templates/SchedulerUI/UIxCalCalendarsListView.wox index 88934555d..ac07bde67 100644 --- a/UI/Templates/SchedulerUI/UIxCalCalendarsListView.wox +++ b/UI/Templates/SchedulerUI/UIxCalCalendarsListView.wox @@ -11,6 +11,10 @@ { background-color: !important; } + DIV[class~='appointmentView'].ownerIs + { + border: 1px solid !important; + }