summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/osx/salnativewidgets.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 46d13e7473c6..8a7e81fd5d86 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -194,6 +194,7 @@ bool AquaSalGraphics::isNativeControlSupported(ControlType nType, ControlPart nP
|| nPart == ControlPart::MenuItemRadioMark)
return true;
break;
+ case ControlType::LevelBar:
case ControlType::Progress:
case ControlType::IntroProgress:
if (nPart == ControlPart::Entire)
@@ -611,6 +612,35 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType,
bOK = true;
}
break;
+ case ControlType::LevelBar:
+ {
+ NSRect rect = { NSZeroPoint, NSMakeSize(rc.size.width, rc.size.height) };
+ NSLevelIndicator* pBox = [[NSLevelIndicator alloc] initWithFrame:rect];
+ [pBox setLevelIndicatorStyle: NSLevelIndicatorStyleContinuousCapacity];
+ [pBox setMinValue: 0];
+ [pBox setMaxValue: rc.size.width];
+ [pBox setCriticalValue: rc.size.width * 35.0 / 100.0];
+ [pBox setWarningValue: rc.size.width * 70.0 / 100.0];
+ [pBox setDoubleValue: aValue.getNumericVal()];
+
+ CGContextSaveGState(context);
+ CGContextTranslateCTM(context, rc.origin.x, rc.origin.y);
+
+ NSGraphicsContext* savedContext = [NSGraphicsContext currentContext];
+ NSGraphicsContext* graphicsContext = [NSGraphicsContext graphicsContextWithCGContext:context flipped:NO];
+ [NSGraphicsContext setCurrentContext: graphicsContext];
+
+ [pBox drawRect: rect];
+
+ [NSGraphicsContext setCurrentContext: savedContext];
+
+ CGContextRestoreGState(context);
+
+ [pBox release];
+
+ bOK = true;
+ }
+ break;
case ControlType::Progress:
case ControlType::IntroProgress:
{
@@ -1104,6 +1134,7 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType nType,
toReturn = true;
}
break;
+ case ControlType::LevelBar:
case ControlType::Progress:
{
tools::Rectangle aRect(aCtrlBoundRect);