Files
Duy Tran Khanh 414a787f38 Tweak: live custom controls editor
Removed Dynamic Position settings as it's automated by snapping.
2022-11-20 10:49:14 +07:00

25 lines
789 B
Objective-C

#import "ControlSubButton.h"
#import "CustomControlsUtils.h"
#import "../LauncherPreferences.h"
#define INSERT_VALUE(KEY, VALUE) \
string = [string stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"${%@}", @(KEY)] withString:VALUE];
@implementation ControlSubButton
// filterProperties
- (void)preProcessProperties {
if (self.parentDrawer && ![self.parentDrawer.drawerData[@"orientation"] isEqualToString:@"FREE"]) {
self.properties[@"width"] = self.parentDrawer.properties[@"width"];
self.properties[@"height"] = self.parentDrawer.properties[@"height"];
}
}
- (void)setParentDrawer:(ControlDrawer *)drawer {
_parentDrawer = drawer;
[self preProcessProperties];
//NSLog(@"DEBUG: SubButton properties %@", self.properties);
}
@end