minor fixes

This commit is contained in:
TrueZhuangjia authored and TrueZhuanjia committed 2025-04-02 16:59:35 +08:00
1 parent 03046988c7
commit 928284990b
2 files changed
+19 -11

No files matched your search

@@ -191,7 +191,7 @@
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
/* Reset variables related to on screen controller button drag and drop routine. These variables should be reset in 'touchesCancelled' or 'touchesEnded' but these may not be called in unaccounted-for edge cases such as when the user opens various OS-level control center related views by dragging down from the top of the screen, or dragging up from the bottom of the screen. Since Apple likes to add new control centers and new ways of opening them (i.e. Dynamic Island on iPhone 14 Pro) it's best to reset these variables here when the user is beginning a new on screen controller button drag routine */
[[NSNotificationCenter defaultCenter] postNotificationName:@"LegacyOscCALayerSelectedNotification" object:self];
// [[NSNotificationCenter defaultCenter] postNotificationName:@"LegacyOscCALayerSelectedNotification" object:self];
layerBeingDragged = nil;
horizontalGuideline.backgroundColor = [UIColor blueColor];
verticalGuideline.backgroundColor = [UIColor blueColor];
@@ -237,7 +237,7 @@
layerBeingDragged = layer;
}
[[NSNotificationCenter defaultCenter] postNotificationName:@"ControllerCALayerSelected" object:layerBeingDragged]; // inform that a CALayer of onScreen controller has being selected
[[NSNotificationCenter defaultCenter] postNotificationName:@"LegacyOscCALayerSelectedNotification" object:layerBeingDragged]; // inform that a CALayer of onScreen controller has being selected
/* save the name, position, and visibility of button being touched in array in case user wants to undo the change later */
OnScreenButtonState *onScreenButtonState = [[OnScreenButtonState alloc] initWithButtonName:layerBeingDragged.name buttonType:LegacyOscButton andPosition:layerBeingDragged.position];
@@ -168,7 +168,7 @@
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(clearSelectedWidgetView)
selector:@selector(setControllerCALayerSliderValues:)
name:@"LegacyOscCALayerSelectedNotification"
object:nil];
@@ -188,10 +188,7 @@
name:@"OnScreenWidgetViewSelected"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(setControllerCALayerSliderValues:)
name:@"ControllerCALayerSelected"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OSCLayoutChanged) name:@"OSCLayoutChanged" object:nil]; // used to notifiy this view controller that the user made a change to the OSC layout so that the VC can either fade in or out its 'Undo button' which will signify to the user whether there are any OSC layout changes to undo
@@ -489,13 +486,11 @@
}
}
- (void)clearSelectedWidgetView{
selectedWidgetView = nil;
}
- (void)widgetViewTapped: (NSNotification *)notification{
// receive the selected widgetView obj passed from the notification
OnScreenWidgetView* widgetView = (OnScreenWidgetView* )notification.object;
[self->selectedWidgetView.stickBallLayer removeFromSuperlayer];
[self->selectedWidgetView.crossMarkLayer removeFromSuperlayer];
self->widgetViewSelected = true;
self->controllerLayerSelected = false;
self->selectedWidgetView = widgetView;
@@ -532,7 +527,10 @@
- (void)setControllerCALayerSliderValues: (NSNotification *)notification{
// receive the selected widgetView obj passed from the notification
CALayer* controllerLayer = (CALayer* )notification.object;
[self->selectedWidgetView.stickBallLayer removeFromSuperlayer];
[self->selectedWidgetView.crossMarkLayer removeFromSuperlayer];
self->widgetViewSelected = false;
self->selectedWidgetView = nil;
self->stickIndicatorOffsetExplain.hidden = true;
self->stickIndicatorOffsetSliderLabel.hidden = true;
self.stickIndicatorOffsetSlider.hidden = true;
@@ -837,9 +835,19 @@
self.widgetSizeSlider.hidden = YES;
self.widgetHeightSlider.hidden = YES;
self.widgetAlphaSlider.hidden = YES;
self.widgetBorderWidthSlider.hidden = YES;
self.sensitivityFactorSlider.hidden = YES;
self.stickIndicatorOffsetSlider.hidden = YES;
widgetSizeSliderLabel.hidden = YES;
widgetHeightSliderLabel.hidden = YES;
widgetAlphaSliderLabel.hidden = YES;
widgetBorderWidthSliderLabel.hidden = YES;
sensitivitySliderLabel.hidden = YES;
stickIndicatorOffsetSliderLabel.hidden = YES;
stickIndicatorOffsetExplain.hidden = YES;
[self->selectedWidgetView.stickBallLayer removeFromSuperlayer];
[self->selectedWidgetView.crossMarkLayer removeFromSuperlayer];
_oscProfilesTableViewController.currentOSCButtonLayers = self.layoutOSC.OSCButtonLayers;
[self presentViewController:_oscProfilesTableViewController animated:YES completion:nil];
}