- textRect = NSMakeRect( (SW_PAD + imageWidth + SW_SPACE),
- (SW_PAD + ((contentHeight - textHeight) / 2)),
- textWidth,
- textHeight);
- textField = [[[ITTextField alloc] initWithFrame:textRect] autorelease];
- [textField setEditable:NO];
- [textField setSelectable:NO];
- [textField setBordered:NO];
- [textField setDrawsBackground:NO];
- [textField setFont:[NSFont fontWithName:@"Lucida Grande Bold" size:18]];
- [textField setTextColor:[NSColor whiteColor]];
- [textField setCastsShadow:YES];
- [textField setStringValue:text];
- [[self contentView] addSubview:textField];
+ textField = [[[ITTextField alloc] initWithFrame:dataRect] autorelease];
+ [textField setEditable:NO];
+ [textField setSelectable:NO];
+ [textField setBordered:NO];
+ [textField setDrawsBackground:NO];
+ [textField setFont:[NSFont fontWithName:@"Lucida Grande Bold" size:18]];
+ [textField setTextColor:[NSColor whiteColor]];
+ [textField setCastsShadow:YES];
+ [textField setStringValue:text];
+ [[self contentView] addSubview:textField];
+
+ } else if ( windowMode == StatusWindowVolumeMode ) {
+
+ NSEnumerator *cellEnum;
+ id aCell;
+ int lights = ( ceil(volumeLevel * 100) / 10 );
+ int lightCount = 0;
+
+ volMatrix = [[[NSMatrix alloc] initWithFrame:dataRect
+ mode:NSHighlightModeMatrix
+ cellClass:NSClassFromString(@"ITTextFieldCell")
+ numberOfRows:1
+ numberOfColumns:10] autorelease];
+
+ [volMatrix setCellSize:NSMakeSize(20, 24)];
+ [volMatrix setIntercellSpacing:NSMakeSize(0, 0)];
+
+ cellEnum = [[volMatrix cells] objectEnumerator];
+
+ while ( (aCell = [cellEnum nextObject]) ) {
+ [aCell setEditable:NO];
+ [aCell setSelectable:NO];
+ [aCell setBordered:NO];
+ [aCell setDrawsBackground:NO];
+ [aCell setFont:[NSFont fontWithName:@"Lucida Grande Bold" size:18]];
+ [aCell setStringValue:[NSString stringWithUTF8String:"▊"]];
+
+ lightCount ++;
+
+ NSLog(@"%f, %i, %i", volumeLevel, lights, lightCount);
+
+ if ( lights >= lightCount ) {
+ [aCell setCastsShadow:YES];
+ [aCell setTextColor:[NSColor whiteColor]];
+ } else {
+ [aCell setCastsShadow:NO];
+ [aCell setTextColor:[NSColor darkGrayColor]];
+ }
+
+ }
+
+ [[self contentView] addSubview:volMatrix];
+ }