current widget name displayed on current profile label

This commit is contained in:
TrueZhuanjia
2025-07-02 10:55:35 +08:00
parent 97d17f505b
commit 6be5aa6507
3 changed files with 42 additions and 2 deletions
@@ -650,13 +650,19 @@
OnScreenWidgetView* widgetView = (OnScreenWidgetView* )notification.object;
[self->selectedWidgetView.stickBallLayer removeFromSuperlayer];
[self->selectedWidgetView.crossMarkLayer removeFromSuperlayer];
self->widgetViewSelected = true;
self->controllerLayerSelected = false;
self->selectedWidgetView = widgetView;
[self autoFitLabel:self.currentProfileLabel];
self.currentProfileLabel.textAlignment = NSTextAlignmentLeft;
[self.currentProfileLabel setText:
[LocalizationHelper localizedStringForKey:@" Profile: %@ Widget: %@",
[profilesManager getSelectedProfile].name,
selectedWidgetView.buttonLabel]];
self.undoButton.alpha = selectedWidgetView.layoutChanges.count>1 ? 1.0 : 0.3;
[self.layoutOSC updateGuidelinesForOnScreenWidget:self->selectedWidgetView]; // shows guideline immediately when widget is tapped
@@ -739,6 +745,14 @@
self->selectedControllerLayer = controllerLayer;
self->controllerLoadedBounds = controllerLayer.bounds;
[self autoFitLabel:self.currentProfileLabel];
self.currentProfileLabel.textAlignment = NSTextAlignmentLeft;
[self.currentProfileLabel setText:
[LocalizationHelper localizedStringForKey:@" Profile: %@ Widget: %@",
[profilesManager getSelectedProfile].name,
selectedControllerLayer.name]];
// setup slider values
CGFloat sizeFactor = [OnScreenControls getControllerLayerSizeFactor:controllerLayer]; // calculated sizeFactor from loaded layer bounds.
[self.widgetSizeSlider setValue:sizeFactor];
@@ -906,7 +920,8 @@
[self.currentProfileLabel setText:[LocalizationHelper localizedStringForKey:@"Profile: %@",[profilesManager getSelectedProfile].name]];
self.currentProfileLabel.layer.cornerRadius = [self isIPhone] ? 9 : 12;
self.currentProfileLabel.clipsToBounds = YES;
self.currentProfileLabel.textAlignment = NSTextAlignmentCenter;
self.widgetSizeStack.userInteractionEnabled = YES;
for(UIView* view in _widgetPanelStack.subviews){
view.userInteractionEnabled = YES;