pub struct Tweak<W> { /* private fields */ }Expand description
Raw platform settings for a built-in widget W: the escape hatch past
its semantic props, for what only one platform has. Each backend makes
them with its tweak (or tweak_with), which gets the native control
itself; pick one per platform with platform!:
ⓘ
use mitsuami::{appkit, gtk};
Button::new("Share").native(platform! {
macos => appkit::tweak(|b: &appkit::objc2_app_kit::NSButton| {
b.setControlSize(appkit::objc2_app_kit::NSControlSize::Large)
}),
gtk => gtk::tweak(|b: >k::gtk::Button| b.add_css_class("circular")),
_ => Tweak::none(),
})A tweak runs after the widget’s other props, and again whenever they change, so what it sets wins; keep it idempotent. Headless tests don’t run it.
Implementations§
Auto Trait Implementations§
impl<W> !RefUnwindSafe for Tweak<W>
impl<W> !Send for Tweak<W>
impl<W> !Sync for Tweak<W>
impl<W> !UnwindSafe for Tweak<W>
impl<W> Forget for Tweak<W>
impl<W> Freeze for Tweak<W>
impl<W> Move for Tweak<W>
impl<W> Unpin for Tweak<W>
impl<W> UnsafeUnpin for Tweak<W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more