Skip to content

Commit 0e5434e

Browse files
committed
feat: AXLandmarkRegion
1 parent ccae3e5 commit 0e5434e

2 files changed

Lines changed: 7 additions & 17 deletions

File tree

src/ax_element.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,11 @@ fn traverse_elements(
10261026
)));
10271027
}
10281028
}
1029-
kAXGroupRole if element.subrole().is_ok_and(|r| r == "AXApplicationDialog") => {
1029+
kAXGroupRole
1030+
if element
1031+
.subrole()
1032+
.is_ok_and(|r| r == "AXApplicationDialog" || r == "AXLandmarkRegion") =>
1033+
{
10301034
if let Some(frame) = ele_fp.frame {
10311035
let _ = result_tx.send(ElementSignal::StartPopup(frame));
10321036
is_popup = true;

src/user_interface/animation.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use objc2_core_foundation::{CFRetained, CGPoint, CGRect, CGSize};
77
use objc2_core_graphics::{CGColor, CGMutablePath, CGPath};
88
use objc2_foundation::{NSArray, NSNumber, ns_string};
99
use objc2_quartz_core::{
10-
CAAnimation, CAAnimationGroup, CABasicAnimation, CAGradientLayer, CALayer, CAMediaTiming,
10+
CAAnimation, CAAnimationGroup, CABasicAnimation, CAGradientLayer, CAMediaTiming,
1111
CAMediaTimingFunction, CAShapeLayer, CATransaction, kCAMediaTimingFunctionEaseOut,
1212
};
1313

@@ -253,32 +253,18 @@ impl UIDrawer {
253253
impl HintBox {
254254
/// Fades the hint box out, then hides it.
255255
pub fn fade_out(&self) {
256-
let layers: Vec<Retained<CALayer>> = std::iter::once(self.box_layer.clone())
257-
.chain(self.frame_layer.iter().cloned())
258-
.collect();
259-
260-
for layer in layers {
256+
for layer in std::iter::once(&self.box_layer).chain(self.frame_layer.iter()) {
261257
// Set the model opacity to 0 before the animation so the layer
262258
// stays hidden after the animation is removed.
263259
layer.setOpacity(0.0);
264260

265261
CATransaction::begin();
266-
267-
let layer_clone = layer.clone();
268-
let completion = RcBlock::new(move || {
269-
layer_clone.setHidden(true);
270-
// Restore opacity so the layer can be shown again later.
271-
layer_clone.setOpacity(1.0);
272-
});
273262
unsafe {
274-
CATransaction::setCompletionBlock(Some(&completion));
275-
276263
let anim = CABasicAnimation::animationWithKeyPath(Some(ns_string!("opacity")));
277264
anim.setFromValue(Some(&NSNumber::new_f64(1.0)));
278265
anim.setToValue(Some(&NSNumber::new_f64(0.0)));
279266
anim.setDuration(HINT_FADE_OUT_DURATION);
280267
anim.setRemovedOnCompletion(true);
281-
282268
layer.addAnimation_forKey(&anim, Some(ns_string!("fade_out")));
283269
}
284270
CATransaction::commit();

0 commit comments

Comments
 (0)