-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theming should be able to define 'accept button' style #227
Comments
As said in bug: I've seen that I can change the text color this way: if ([cell isKindOfClass:[NSButtonCell class]]) {
NSButtonCell *buttonCell = (NSButtonCell *) cell;
NSString *keyEquivalent = [buttonCell keyEquivalent];
if ([keyEquivalent isEqualToString:@"\r"]) {
NSDictionary *attributes = @{NSForegroundColorAttributeName: [NSColor whiteColor]};
NSAttributedString *coloredTitle = [[NSAttributedString alloc] initWithString:[cell title] attributes:attributes];
[buttonCell setAttributedTitle:coloredTitle];
backgroundColor = GVThemeColorRGB(0, 122, 255, 1.0);
}
}
[backgroundColor set];
[bezelPath fill];
[bezelColor setStroke];
[bezelPath setLineWidth:1.0];
[bezelPath stroke]; If this is the way of changing background and text color from a button cell, theming needs a way remove the 'return arrow' for 'accept buttons'. The image on the left is from GNUStep and the image on the right is the expected theme configuration ![]() |
I can see at least two ways of doing this, depending on exactly what it is you want. To change the image everywhere, you just provide a replacement for the default image in your theme; in this case a transparent image may do what you want. To change behavior in a specific place (eg for just one control rather than throughput the gui) would require implementing -drawButton:in:view:style:state: so that it would set a nil image if it was called to draw that specific control, and would then call the superclass implementation to do all the normal drawing. |
NSImage *originalImage = AUTORELEASE(RETAIN([cell image])); |
Looks like [cell setImage: nil]; removes the 'new line' image. |
Theming should be able to define 'accept button' style
Like in the picture, theming should be able to define the text color, prevent drawing the line jump symbol and prevent the text movement when clicked (#219)
Image on the left is GNUStep (background color is not an issue), Right image is the desired themable look and feel (white text, without the line jump, without the text movement)
The text was updated successfully, but these errors were encountered: