call: add dialpad access
This commit adds the ability to dial dtmf tones during a call.
It is necessary for interacting with automated services.
RTP dtmf are not working in the daemon, so during SIP account creation
we switch to SIP dtmf.
Tuleap: #154
Change-Id: I9d6758af4bc0b44605dc4b17c08b9b4ceaee84bd
diff --git a/src/views/IconButton.mm b/src/views/IconButton.mm
index 5ce29ef..55a83ee 100644
--- a/src/views/IconButton.mm
+++ b/src/views/IconButton.mm
@@ -96,7 +96,7 @@
NSBezierPath* path = [NSBezierPath bezierPathWithRect:dirtyRect];
[path addClip];
- [self setImagePosition:NSImageOnly];
+ [self setImagePosition:NSImageOverlaps];
auto rect = NSInsetRect(dirtyRect, self.imageInsets, self.imageInsets);
[[NSColor image:self.image tintedWithColor:tintColor] drawInRect:rect
@@ -107,6 +107,23 @@
hints:nil];
[NSGraphicsContext restoreGraphicsState];
+
+ NSRect rect2;
+ NSDictionary *att = nil;
+
+ NSMutableParagraphStyle *style =
+ [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+ [style setLineBreakMode:NSLineBreakByWordWrapping];
+ [style setAlignment:NSCenterTextAlignment];
+ att = [[NSDictionary alloc] initWithObjectsAndKeys:
+ style, NSParagraphStyleAttributeName,
+ [NSColor whiteColor],
+ NSForegroundColorAttributeName, nil];
+
+ rect.size = [[self title] sizeWithAttributes:att];
+ rect.origin.x = floor( NSMidX([self bounds]) - rect.size.width / 2 );
+ rect.origin.y = floor( NSMidY([self bounds]) - rect.size.height / 2 );
+ [[self title] drawInRect:rect withAttributes:att];
}
}