mirror of https://github.com/LIJI32/SameBoy.git
Fix button colors in some themes
This commit is contained in:
parent
ebfc877c1c
commit
ee3f37b39c
|
@ -497,7 +497,7 @@ static GB_key_mask_t angleToKeyMask(double angle)
|
||||||
|
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
self.overrideUserInterfaceStyle = layout.theme.isDark? UIUserInterfaceStyleDark : UIUserInterfaceStyleLight;
|
self.overrideUserInterfaceStyle = layout.theme.isDark? UIUserInterfaceStyleDark : UIUserInterfaceStyleLight;
|
||||||
self.tintColor = layout.theme.brandColor;
|
self.tintColor = layout.theme.buttonColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
_screenLabel.frame = screenFrame;
|
_screenLabel.frame = screenFrame;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
@interface GBTheme : NSObject
|
@interface GBTheme : NSObject
|
||||||
@property (readonly, direct) UIColor *brandColor;
|
@property (readonly, direct) UIColor *brandColor;
|
||||||
|
@property (readonly, direct) UIColor *buttonColor;
|
||||||
@property (readonly, direct) UIColor *backgroundGradientTop;
|
@property (readonly, direct) UIColor *backgroundGradientTop;
|
||||||
@property (readonly, direct) UIColor *backgroundGradientBottom;
|
@property (readonly, direct) UIColor *backgroundGradientBottom;
|
||||||
@property (readonly, direct) UIColor *bezelsGradientTop;
|
@property (readonly, direct) UIColor *bezelsGradientTop;
|
||||||
|
|
|
@ -155,6 +155,16 @@ __attribute__((objc_direct_members))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (UIColor *)buttonColor
|
||||||
|
{
|
||||||
|
double r, g, b;
|
||||||
|
[_brandColor getRed:&r green:&g blue:&b alpha:NULL];
|
||||||
|
if (r == 1.0 && g == 1.0 && b == 1.0) {
|
||||||
|
return _backgroundGradientTop;
|
||||||
|
}
|
||||||
|
return [UIColor colorWithRed:r green:g blue:b alpha:1.0];
|
||||||
|
}
|
||||||
|
|
||||||
- (bool)isDark
|
- (bool)isDark
|
||||||
{
|
{
|
||||||
double r, g, b;
|
double r, g, b;
|
||||||
|
|
|
@ -229,7 +229,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
|
||||||
[[GBHorizontalLayout alloc] initWithTheme:theme cutoutOnRight:true] :
|
[[GBHorizontalLayout alloc] initWithTheme:theme cutoutOnRight:true] :
|
||||||
_horizontalLayoutLeft;
|
_horizontalLayoutLeft;
|
||||||
_verticalLayout = [[GBVerticalLayout alloc] initWithTheme:theme];
|
_verticalLayout = [[GBVerticalLayout alloc] initWithTheme:theme];
|
||||||
_printerSpinner.color = theme.brandColor;
|
_printerSpinner.color = theme.buttonColor;
|
||||||
|
|
||||||
[self willRotateToInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation
|
[self willRotateToInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation
|
||||||
duration:0];
|
duration:0];
|
||||||
|
@ -376,7 +376,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
|
||||||
_printerButton = [[UIButton alloc] init];
|
_printerButton = [[UIButton alloc] init];
|
||||||
_printerSpinner = [[UIActivityIndicatorView alloc] init];
|
_printerSpinner = [[UIActivityIndicatorView alloc] init];
|
||||||
_printerSpinner.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite;
|
_printerSpinner.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite;
|
||||||
_printerSpinner.color = _verticalLayout.theme.brandColor;
|
_printerSpinner.color = _verticalLayout.theme.buttonColor;
|
||||||
[self didRotateFromInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];
|
[self didRotateFromInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];
|
||||||
|
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
|
|
Loading…
Reference in New Issue