mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 11:00:48 +00:00
NSBox: (re-)implement isOpaque (#254)
This (re-)implements logic where a box is marked as opaque if it is a custom box which is not transparent, but moves the logic to `GSTheme`, allowing themes to override this loggic. This fixes the rendering of custom boxes with a custom fill color; the current implementation would mark them as non-opaque and hence the fill color would not be rendered. - The original implementation (from 1999) always returned `YES` (53bcb50240
) - A more complete implementation was backported from the Testplant branch in 2012 (e85b16bc05
, by @fredkiefer, upstream commit36e77b95f7
) - More recently, the a return value of `NO` was hardcoded (02bc49e2d5
, by @ericwa)
This commit is contained in:
parent
95f302442c
commit
892ed4877e
3 changed files with 15 additions and 12 deletions
|
@ -3475,6 +3475,18 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL) isBoxOpaque: (NSBox *)box
|
||||
{
|
||||
if ([box boxType] == NSBoxCustom)
|
||||
{
|
||||
return ![box isTransparent];
|
||||
}
|
||||
else
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) drawBoxInClipRect: (NSRect)clipRect
|
||||
boxType: (NSBoxType)boxType
|
||||
borderType: (NSBorderType)borderType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue