fixed: unpredictable on screen widget size after orientation change in layout tool. now widget size stays consistent.

This commit is contained in:
TrueZhuanjia
2025-09-13 17:13:11 +08:00
parent 424fe2c2f0
commit 92f1fbf33b
10 changed files with 115 additions and 35 deletions
@@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) BOOL isHidden;
@property (nonatomic, assign) uint8_t slideMode;
@property (nonatomic, assign) uint8_t buttonType;
@property (nonatomic, assign) uint8_t sizeReference;
@property (nonatomic, assign) CGFloat widthFactor; // for OnScreenWidgetView
@property (nonatomic, assign) CGFloat heightFactor; // for OnScreenWidgetView
@property (nonatomic, assign) CGFloat borderWidth; // for OnScreenWidgetView
@@ -46,11 +47,17 @@ NS_ASSUME_NONNULL_BEGIN
// @property (nonatomic, assign) BOOL hasValidPosition;
typedef NS_ENUM(NSInteger, OnScreenButtonType) {
LegacyOscButton,
typedef NS_ENUM(NSInteger, OnScreenWidgetType) {
LegacyOnScreenControls,
CustomOnScreenWidget
};
typedef NS_ENUM(NSInteger, WidgetSizeReference) {
longSide,
shortSide
};
typedef NS_ENUM(NSInteger, MouseButtonAction) {
hovering,
leftButtonDown,
@@ -65,8 +72,6 @@ typedef NS_ENUM(NSInteger, ButtonSlideMode) {
disabled
};
- (id) initWithButtonName:(NSString*)name buttonType:(uint8_t)buttonType andPosition:(CGPoint)position;
+ (BOOL) supportsSecureCoding;