From 32ad5d2f8a90fc73082f3cd8bbe6b5e3299af93a Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Sat, 27 Dec 2025 14:41:23 +0800 Subject: [PATCH] highlight border when moving on-screen widgets in layout tool --- VoidLink/Input/OnScreenWidgetView.swift | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/VoidLink/Input/OnScreenWidgetView.swift b/VoidLink/Input/OnScreenWidgetView.swift index 87952c6f..38161179 100644 --- a/VoidLink/Input/OnScreenWidgetView.swift +++ b/VoidLink/Input/OnScreenWidgetView.swift @@ -1707,7 +1707,10 @@ import SVGKit let touch = touches.first // get touchBeganLocation - if OnScreenWidgetView.editMode {self.touchBeganLocation = touch!.location(in: superview)} + if OnScreenWidgetView.editMode { + self.touchBeganLocation = touch!.location(in: superview) + self.highlightBorder(highlighted: true) + } else { if widgetType == WidgetTypeEnum.button, self.buttonMode == ButtonMode.movable.rawValue {self.touchBeganLocation = touch!.location(in: superview)} else {self.touchBeganLocation = touch!.location(in: self)} @@ -2465,6 +2468,8 @@ import SVGKit // Trigger layout update superview.layoutIfNeeded() + self.highlightBorder(highlighted: false) + setupView(); //re-setup widgetView style if self.widgetType == WidgetTypeEnum.touchPad{ @@ -2551,6 +2556,17 @@ import SVGKit } } + private func highlightBorder(highlighted:Bool) { + if highlighted { + self.layer.borderWidth = 2 + self.layer.borderColor = voidlinkPurple + } + else { + self.layer.borderWidth = self.borderWidth + self.layer.borderColor = self.defaultBorderColor + } + } + override func didMoveToSuperview() { super.didMoveToSuperview() if superview == nil {