JubeatPlus 3.9.11
Loading...
Searching...
No Matches
StoreButton Class Reference

A button that fills itself with a solid colour and rounds its own corners. More...

#include <StoreButton.h>

Inheritance diagram for StoreButton:
Collaboration diagram for StoreButton:

Instance Methods

(instancetype) - initWithFrame:
 Builds the button.
(nullable UIColor *) - highlightColor:factor:
 Lightens a colour towards white.
(void) - setHighlighted:
 Redraws when the highlight actually changes.
(void) - setSelected:
 Redraws when the selection actually changes.
(void) - drawRect:
 Fills the button and draws its inner shadow.

Properties

UIColor * buttonColor
 The fill used while the button is enabled.
UIColor * disabledColor
 The fill used while the button is disabled.
double cornerRadius
 The corner radius the button rounds itself to.

Detailed Description

A button that fills itself with a solid colour and rounds its own corners.

Method Documentation

◆ drawRect:

- (void) drawRect: (CGRect) rect

Fills the button and draws its inner shadow.

A flat fill when disabled, otherwise a four-stop vertical gradient derived from buttonColor . The inner shadow that follows is drawn by throwing the shadow one button-width sideways and translating the mask back the same distance, so only the cast shadow lands inside the clip.

Parameters
rectThe area to redraw.
Ghidra address:
0x170f34
Ghidra address:
0x170f34

◆ highlightColor:factor:

- (UIColor *) highlightColor: (double *) components
factor: (double) factor 

Lightens a colour towards white.

Each component becomes c*(1-factor) + factor . The alpha is blended too, so a partly transparent colour also becomes more opaque as the factor rises.

Parameters
componentsFour components — red, green, blue, alpha — as raw doubles.
factorHow far towards white, from 0 to 1.
Returns
The lightened colour.
Ghidra address:
0x170dd4
Ghidra address:
0x170dd4

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect) frame

Builds the button.

Sets the title colour and shadow for the normal, highlighted, and disabled states, and centres the content both ways. The shadow offset depends on the screen scale so that it is one device pixel on either kind of display.

Parameters
frameThe button's frame.
Returns
The initialised button.
Ghidra address:
0x170998
Ghidra address:
0x170998

◆ setHighlighted:

- (void) setHighlighted: (BOOL) highlighted

Redraws when the highlight actually changes.

Parameters
highlightedThe new state.
Ghidra address:
0x170e1c
Ghidra address:
0x170e1c

◆ setSelected:

- (void) setSelected: (BOOL) selected

Redraws when the selection actually changes.

Parameters
selectedThe new state.
Ghidra address:
0x170ea8
Ghidra address:
0x170ea8

Property Documentation

◆ buttonColor

- (UIColor *) buttonColor
readwritenonatomicstrong

The fill used while the button is enabled.

Defaults to UIColor.blueColor , built on first read rather than in the initialiser.

Ghidra address:
0x170c4c (getter)
Ghidra address:
0x170c4c

◆ cornerRadius

- (double) cornerRadius
readwritenonatomicassign

The corner radius the button rounds itself to.

Ghidra address:
0x170dac (getter)

◆ disabledColor

- (UIColor *) disabledColor
readwritenonatomicstrong

The fill used while the button is disabled.

Defaults to UIColor.grayColor , likewise built lazily.

Ghidra address:
0x170cfc (getter)
Ghidra address:
0x170cfc

The documentation for this class was generated from the following files: