Correct code style.

This commit is contained in:
Haojian Wu 2014-09-18 16:17:49 +08:00
parent c5e0b65cc7
commit d8f57a0ecc
2 changed files with 14 additions and 12 deletions

View file

@ -203,21 +203,21 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
return; return;
// Draw edges of rounded rect. // Draw edges of rounded rect.
NSRect rect = NSInsetRect([self bounds], 1.0, 1.0); NSRect rect = NSInsetRect([self bounds], 1.0, 1.0);
CGFloat radius = rect.size.height / 2; CGFloat radius = rect.size.height / 2;
NSBezierPath* bezier_path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius]; NSBezierPath* bezier_path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius];
[bezier_path setLineWidth:2.0]; [bezier_path setLineWidth:2.0];
[[NSColor grayColor] set]; [[NSColor grayColor] set];
[bezier_path stroke]; [bezier_path stroke];
// Fill the rounded rect. // Fill the rounded rect.
rect = NSInsetRect(rect, 2.0, 2.0); rect = NSInsetRect(rect, 2.0, 2.0);
radius = rect.size.height / 2; radius = rect.size.height / 2;
bezier_path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius]; bezier_path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius];
[bezier_path setLineWidth:1.0]; [bezier_path setLineWidth:1.0];
[bezier_path addClip]; [bezier_path addClip];
// Calculate the progress width. // Calculate the progress width.
rect.size.width = floor(rect.size.width * ([self doubleValue] / [self maxValue])); rect.size.width = floor(rect.size.width * ([self doubleValue] / [self maxValue]));
// Fill the progress bar with color blue. // Fill the progress bar with color blue.
[[NSColor colorWithSRGBRed:0.2 green:0.6 blue:1 alpha:1] set]; [[NSColor colorWithSRGBRed:0.2 green:0.6 blue:1 alpha:1] set];

View file

@ -497,7 +497,9 @@ void NativeWindowViews::SetProgressBar(double progress) {
} else if (progress < 0) { } else if (progress < 0) {
taskbar->SetProgressState(frame, TBPF_NOPROGRESS); taskbar->SetProgressState(frame, TBPF_NOPROGRESS);
} else if (progress >= 0) { } else if (progress >= 0) {
taskbar->SetProgressValue(frame, static_cast<int>(progress*100), progress); taskbar->SetProgressValue(frame,
static_cast<int>(progress * 100),
progress);
} }
#endif #endif
} }