From: znek Date: Mon, 14 Jun 2004 14:41:46 +0000 (+0000) Subject: stylesheet work X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14142ff8017b0a94d38e28e8dc576054b4712121;p=scalable-opengroupware.org stylesheet work git-svn-id: http://svn.opengroupware.org/SOGo/trunk@32 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ZideStore/UI-X/ChangeLog b/ZideStore/UI-X/ChangeLog index a21da544..00be6031 100644 --- a/ZideStore/UI-X/ChangeLog +++ b/ZideStore/UI-X/ChangeLog @@ -1,3 +1,14 @@ +2004-06-14 Marcus Mueller + + * Common/UIxTabView.[hm]: more stylesheet support via headerStyle + and bodyStyle bindings. + + * Common/zidestoreui.css: styles for tabs, resembling OGo look. + + * Scheduler/OGoCalSelectTab.m: implemented dateLabel (for testing). + + * Scheduler/OGoCalSelectTab.wox: corrected selection binding namespace. + 2004-06-08 Helge Hess * Scheduler/NOTES: added class hierarchy diff --git a/ZideStore/UI-X/Common/UIxTabView.h b/ZideStore/UI-X/Common/UIxTabView.h index 699a5e45..8224b442 100644 --- a/ZideStore/UI-X/Common/UIxTabView.h +++ b/ZideStore/UI-X/Common/UIxTabView.h @@ -48,6 +48,7 @@ /* config: */ WOAssociation *headerStyle; + WOAssociation *bodyStyle; WOAssociation *tabStyle; WOAssociation *selectedTabStyle; diff --git a/ZideStore/UI-X/Common/UIxTabView.m b/ZideStore/UI-X/Common/UIxTabView.m index e43c51ac..19fb8729 100644 --- a/ZideStore/UI-X/Common/UIxTabView.m +++ b/ZideStore/UI-X/Common/UIxTabView.m @@ -61,6 +61,7 @@ static NSNumber *YesNumber; self->selection = WOExtGetProperty(_config, @"selection"); self->headerStyle = WOExtGetProperty(_config, @"headerStyle"); + self->bodyStyle = WOExtGetProperty(_config, @"bodyStyle"); self->tabStyle = WOExtGetProperty(_config, @"tabStyle"); self->selectedTabStyle = WOExtGetProperty(_config, @"selectedTabStyle"); @@ -92,6 +93,7 @@ static NSNumber *YesNumber; [self->selection release]; [self->headerStyle release]; + [self->bodyStyle release]; [self->tabStyle release]; [self->selectedTabStyle release]; @@ -144,7 +146,7 @@ static NSNumber *YesNumber; NSString *activeTabKey; activeTabKey = [self->selection stringValueInComponent:[_ctx component]]; - + NSLog(@"%s activeTabKey:%@", __PRETTY_FUNCTION__, activeTabKey); nestedState = [self saveNestedStateInContext:_ctx]; [_ctx appendElementIDComponent:@"b"]; [_ctx appendElementIDComponent:activeTabKey]; @@ -289,132 +291,53 @@ static NSNumber *YesNumber; isActive:(BOOL)_isActive isLeft:(BOOL)_isLeft doScript:(BOOL)_doScript keys:(NSArray *)_keys { - BOOL doBgIcon; - BOOL doImages; NSString *headUri = nil; - NSString *imgUri = nil; NSString *label = nil; - NSString *bgcolor = nil; - NSString *w = nil; - NSString *h = nil; NSString *scriptHref = nil; NSString *styleName = nil; + WEClientCapabilities *ccaps; WOComponent *comp; - doImages = ![[[_ctx request] clientCapabilities] isTextModeBrowser]; + ccaps = [[_ctx request] clientCapabilities]; comp = [_ctx component]; headUri = _info->uri; - if (_info->asBackground == 0) - doBgIcon = [self->asBackground boolValueInComponent:comp]; - else - doBgIcon = (_info->asBackground == 1) ? YES : NO; - if ((label = _info->label) == nil) label = _info->key; - if (doImages) { - /* lookup image */ - NSString *imgName = nil; - - if (_isActive) { - imgName = _info->selIcon; // selectedTabIcon - if (imgName == nil) - imgName = [self->selectedTabIcon stringValueInComponent:comp]; - } - else if (_isLeft) { - imgName = _info->leftIcon; // leftTabIcon - if (imgName == nil) - imgName = [self->leftTabIcon stringValueInComponent:comp]; - } - else { - imgName = _info->tabIcon; // tabIcon - if (imgName == nil) - imgName = [self->tabIcon stringValueInComponent:comp]; - } - - if (imgName == nil) { - imgName = _info->icon; - } - - imgUri = WEUriOfResource(imgName, _ctx); - - if ([imgUri length] < 1) - doImages = NO; - } - if (_isActive) { - bgcolor = (_info->activeBg) - ? _info->activeBg - : [self->activeBgColor stringValueInComponent:comp]; styleName = (_info->selectedTabStyle) ? _info->selectedTabStyle : [self->selectedTabStyle stringValueInComponent:comp]; } else { - bgcolor = (_info->inactiveBg) - ? _info->inactiveBg - : [self->inactiveBgColor stringValueInComponent:comp]; styleName = (_info->tabStyle) ? _info->tabStyle : [self->tabStyle stringValueInComponent:comp]; } - w = (_info->width) - ? _info->width - : [self->width stringValueInComponent:comp]; - h = (_info->height) - ? _info->height - : [self->height stringValueInComponent:comp]; - [_response appendContentString:@"']; - - if (!doImages) [_response appendContentString:@"["]; - - [_response appendContentString:@"isScript || _isActive)) { + [_response appendContentString:@"isScript || _isActive)) { scriptHref = [self scriptHref:_info inContext:_ctx isLeft:_isLeft keys:_keys]; [_response appendContentHTMLAttributeValue:scriptHref]; @@ -426,54 +349,25 @@ static NSNumber *YesNumber; [_response appendContentString:@"\" "]; [_response appendContentString: [NSString stringWithFormat:@"name='%@TabLink'", _info->key]]; + if (styleName) { + [_response appendContentString:@" class='"]; + [_response appendContentHTMLAttributeValue:styleName]; + [_response appendContentCharacter:'\'']; + } [_response appendContentString:@">"]; - if (!doImages && _isActive) - [_response appendContentString:@""]; - - if (doImages && !doBgIcon) { - [_response appendContentString:@""];
-    [_response appendContentHTMLAttributeValue:label];
-    [_response appendContentString:@""]; - } - else { - NSString *fc = [self->fontColor stringValueInComponent:comp]; - NSString *fs = [self->fontSize stringValueInComponent:comp]; - NSString *ff = [self->fontFace stringValueInComponent:comp]; - BOOL hasFont; - - hasFont = (fc || fs || ff) ? YES : NO; - - if ([label length] < 1) + if ([label length] < 1) label = _info->key; - [_response appendContentString:@""]; - if (hasFont) WEAppendFont(_response, fc, ff, fs); // - - if (_isActive) [_response appendContentString:@""]; - [_response appendContentHTMLString:label]; - if (_isActive) [_response appendContentString:@""]; - - if (hasFont) [_response appendContentString:@""]; // - [_response appendContentString:@""]; - } - - if (!doImages && _isActive) - [_response appendContentString:@""]; + [_response appendContentString:@""]; + [_response appendContentHTMLString:label]; + [_response appendContentString:@""]; [_response appendContentString:@""]; - if (!doImages) [_response appendContentString:@"]"]; - [_response appendContentString:@""]; - - if (_doScript && doImages && (_info->isScript || _isActive)) { + +#if 0 + if (_doScript && (_info->isScript || _isActive)) { NSString *k; // key NSString *s; // selected tab icon NSString *u; // unselected tab icon @@ -539,6 +433,7 @@ static NSNumber *YesNumber; #undef _appendStr_ #endif } +#endif } - (void)appendSubmitButton:(UIxTabItemInfo *)_info @@ -597,15 +492,26 @@ static NSNumber *YesNumber; keys:(NSArray *)keys activeKey:(NSString *)activeKey doScript:(BOOL)doScript { - unsigned i, count; - BOOL doForm; + unsigned i, count; + BOOL doForm; + NSString *styleName; doForm = NO; /* generate form controls ? */ [_response appendContentString:@""]; - [_response appendContentString: - @""]; + styleName = [self->headerStyle stringValueInComponent:[_ctx component]]; + if(styleName) { + [_response appendContentString: + @"
"]; + } + else { + [_response appendContentString: + @"
"]; + } + for (i = 0, count = [keys count]; i < count; i++) { UIxTabItemInfo *info; NSString *key; @@ -651,7 +557,15 @@ static NSNumber *YesNumber; doScript:(BOOL)doScript isLeftActive:(BOOL)isLeftActive { + NSString *styleName; [_response appendContentString:@" bodyStyle stringValueInComponent:[_ctx component]]; + if(styleName) { + [_response appendContentString:@" class='"]; + [_response appendContentHTMLAttributeValue:styleName]; + [_response appendContentCharacter:'\'']; + } if (bgcolor) { [_response appendContentString:@" bgcolor=\""]; [_response appendContentHTMLAttributeValue:bgcolor]; @@ -727,20 +641,27 @@ static NSNumber *YesNumber; { WEClientCapabilities *ccaps; BOOL indentContent; - + NSString *styleName; + + styleName = [self->bodyStyle stringValueInComponent:[_ctx component]]; ccaps = [[_ctx request] clientCapabilities]; - + /* put additional padding table into content ??? */ indentContent = [ccaps isFastTableBrowser] && ![ccaps isTextModeBrowser]; - [_response appendContentString:@"
"]; + [_response appendContentCharacter:'>']; if (indentContent) { /* start padding table */ diff --git a/ZideStore/UI-X/Common/zidestoreui.css b/ZideStore/UI-X/Common/zidestoreui.css index 170bc423..00804b54 100644 --- a/ZideStore/UI-X/Common/zidestoreui.css +++ b/ZideStore/UI-X/Common/zidestoreui.css @@ -33,6 +33,7 @@ a:hover { .linecolor { background-color: #06348B; } + font.defaultfont { text-decoration: none; font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; @@ -40,6 +41,48 @@ font.defaultfont { color: #000000; } +/* tabs */ + +.tab { + color: #000000; + background-color: #e8e8e0; + font-size: 10pt; + text-decoration: none; + width: 100px; + height: 22px; + border-top: 1px solid #06348b; + border-right: 1px solid #06348b; +} + +a.tab, a.tab:active, a.tab:link, a.tab:visited, a.tab:hover { + color: #000000; + border: none; + text-decoration: none; +} + +.tab_selected { + color: #000000; + background-color: #f5f5e9; + font-size: 10pt; + text-decoration: none; + font-weight: bold; + width: 100px; + height: 22px; + border-top: 1px solid #06348b; + border-right: 1px solid #06348b; +} + +a.tab_selected, a.tab_selected:active, a.tab_selected:link, a.tab_selected:visited, a.tab_selected:hover { + color: #000000; + border: none; + text-decoration: none; +} + +.tabview_body { + background-color: #f5f5e9; +} + + /* buttons */ .button_auto { diff --git a/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m b/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m index a8bc839e..e79e9f22 100644 --- a/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m +++ b/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m @@ -58,7 +58,7 @@ } - (NSString *)dayLabel { - return @"TODO: day"; + return [self->currentDate descriptionWithCalendarFormat:@"%d"]; } - (NSString *)weekLabel { diff --git a/ZideStore/UI-X/Scheduler/OGoCalSelectTab.wox b/ZideStore/UI-X/Scheduler/OGoCalSelectTab.wox index 4a02b557..d2e54223 100644 --- a/ZideStore/UI-X/Scheduler/OGoCalSelectTab.wox +++ b/ZideStore/UI-X/Scheduler/OGoCalSelectTab.wox @@ -5,9 +5,10 @@ xmlns:const="http://www.skyrix.com/od/constant" xmlns:rsrc="OGo:url" xmlns:uix="OGo:uix" - selection="selection" + var:selection="selection" const:tabStyle="tab" - const:selectedTabStyle="selectedTab" + const:selectedTabStyle="tab_selected" + const:bodyStyle="tabview_body" >