- Revision
- 11362
- Author
- jeffrey
- Date
- 2006-08-09 13:25:21 -0700 (Wed, 09 Aug 2006)
Log Message
- Additionality config options for bug 6233, allow Mimi to tweak
individual colors, since there isn't a general algorithm for the vast array of
colors we're using. Also added Aqua and Yellow colors as options.
individual colors, since there isn't a general algorithm for the vast array of
colors we're using. Also added Aqua and Yellow colors as options.
Modified Paths
- trunk/chandler/application/styles.conf
- trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py
- trunk/chandler/parcels/osaf/usercollections.py
Added Paths
Diff
Modified: trunk/chandler/application/styles.conf (11361 => 11362)
--- trunk/chandler/application/styles.conf 2006-08-09 18:43:32 UTC (rev 11361) +++ trunk/chandler/application/styles.conf 2006-08-09 20:25:21 UTC (rev 11362) @@ -14,15 +14,25 @@ SectionSample_triageStatus_later = #ffcc00 SectionSample_triageStatus_done = #555555 -[color] -BlueHue = 210 -GreenHue = 120 -RoseHue = 0 -SalmonHue = 30 -PurpleHue = 270 -VioletHue = 240 -FuschiaHue = 330 +[colororder] +# listed colors are case sensitive and must all be on one line +order = Blue, Green, Rose, Aqua, Salmon, Purple, Yellow, Violet, Fuschia +[colors] +# Names of colors and their hue. To be used, a color must appear in colors +# and colororder. Also, checked and unchecked icons for the color should +# be added to resources/images, these images are used on Windows for menu +# icons +Rose = 0 +Salmon = 30 +Yellow = 50 +Green = 120 +Aqua = 170 +Blue = 210 +Violet = 270 +Purple = 300 +Fuschia = 330 + [calendarcanvas] ######### Selected Lozenges ################ @@ -104,3 +114,15 @@ OverlayFYITextSaturation = 1.0 OverlayFYITextValue = 0.8 + +######## Color-specific lozenge colors ########## +# To override gradients/text/outline colors for a particular color, +# add an entry whose key is Color + Type where type matches one of the +# default keys above. + +GreenSelectedGradientLeftValue = 0.45 +GreenSelectedGradientRightValue = 0.70 + +GreenUnSelectedGradientLeftValue = 0.66 +GreenUnSelectedGradientRightValue = 0.80 +GreenUnSelectedGradientRightSaturation = 1.0
Modified: trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py (11361 => 11362)
--- trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py 2006-08-09 18:43:32 UTC (rev 11361) +++ trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py 2006-08-09 20:25:21 UTC (rev 11362) @@ -127,6 +127,9 @@ else: return columnList[-1] +# hue -> colorName mapping +hueMap = dict((int(v), k) for k, v in confstyles.cfg.items('colors')) + class ColorInfo(object): def __init__(self, collection): # sometimes this happens when getContainingCollection fails to find a collection @@ -144,13 +147,20 @@ suffixes = 'GradientLeft', 'GradientRight', 'Outline', 'Text' names = [prefix + suffix for suffix in suffixes] - def saturationAndValue(name): - return (float(confstyles.cfg.get('calendarcanvas', name + 'Saturation')), - float(confstyles.cfg.get('calendarcanvas', name + 'Value'))) - + def valWithDefault(hue, name): + hueName = hueMap.get(int(hue*360)) + if hueName is not None: + val = confstyles.cfg.get('calendarcanvas', hueName + name) + if val is not None: + return float(val) + return confstyles.cfg.getfloat('calendarcanvas', name) + def getSaturatedColors(self): + satsAndValues = ((valWithDefault(self.hue, name + 'Saturation'), + valWithDefault(self.hue, name + 'Value')) + for name in names) return [rgb2color(*hsv_to_rgb(self.hue, saturation, value)) for - saturation, value in map(saturationAndValue, names)] + saturation, value in satsAndValues] return property(getSaturatedColors)
Modified: trunk/chandler/parcels/osaf/usercollections.py (11361 => 11362)
--- trunk/chandler/parcels/osaf/usercollections.py 2006-08-09 18:43:32 UTC (rev 11361) +++ trunk/chandler/parcels/osaf/usercollections.py 2006-08-09 20:25:21 UTC (rev 11362) @@ -13,8 +13,6 @@ # limitations under the License. -from osaf.pim.structs import ColorType - from application import schema from osaf.pim.structs import ColorType from osaf.pim import ContentCollection @@ -83,17 +81,11 @@ # Collection colors # in the form 'Color', _('LocalizableColorString'), 360-degree based hue +order = [s.strip() for s in styles.cfg.get('colororder', 'order').split(',')] +collectionHues = [(k, _(unicode(k)), styles.cfg.getint('colors', k)) + for k in order] -collectionHues = \ - [('Blue', _(u'Blue'), float(styles.cfg.get('color', 'BlueHue'))), - ('Green', _(u'Green'), float(styles.cfg.get('color', 'GreenHue'))), - ('Rose', _(u'Rose'), float(styles.cfg.get('color', 'RoseHue'))), - ('Salmon', _(u'Salmon'), float(styles.cfg.get('color', 'SalmonHue'))), - ('Purple', _(u'Purple'), float(styles.cfg.get('color', 'PurpleHue'))), - ('Violet', _(u'Violet'), float(styles.cfg.get('color', 'VioletHue'))), - ('Fuschia', _(u'Fuschia'), float(styles.cfg.get('color', 'FuschiaHue')))] - def installParcel(parcel, oldVersion=None): collectionColors = CollectionColors.update(parcel, 'collectionColors',
Added: trunk/chandler/resources/images/AquaMenuIcon.png
(Binary files differ)
Added: trunk/chandler/resources/images/AquaMenuIconChecked.png
(Binary files differ)
Added: trunk/chandler/resources/images/YellowMenuIcon.png
(Binary files differ)
Added: trunk/chandler/resources/images/YellowMenuIconChecked.png
(Binary files differ)
_______________________________________________ Commits mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/commits
