Skip to main content

UiConfig

Struct UiConfig 

Source
pub struct UiConfig { /* private fields */ }
Expand description

Branding and behaviour for the built-in activation window.

use tauri_plugin_moonbase::UiConfig;

let ui = UiConfig::new()
    .product_name("Solstice")
    .manufacturer_name("Helio Audio")
    .accent("#186cdc")
    .trial_feature("Full DSP engine, unrestricted", true)
    .trial_feature("Use in commercial releases", false);

Implementations§

Source§

impl UiConfig

Source

pub fn new() -> Self

Source

pub fn disabled() -> Self

No built-in window: drive your own UI from the state event and commands.

Source

pub fn product_name(self, name: impl Into<String>) -> Self

Shown throughout the UI. Defaults to the app’s product name.

Source

pub fn manufacturer_name(self, name: impl Into<String>) -> Self

Shown under the product name, and as the account the customer signs in to.

Source

pub fn accent(self, color: impl Into<String>) -> Self

The one brand colour: buttons, progress, step numbers. Any CSS colour. Defaults to Moonbase blue, #186cdc.

Source

pub fn logo_svg(self, svg: impl Into<String>) -> Self

The product mark in the header, as SVG markup. Without one, a sun mark is drawn in the accent colour.

Source

pub fn logo_png(self, png: impl Into<Vec<u8>>) -> Self

The product mark in the header, as PNG bytes. Supply at least 76 px square.

Source

pub fn trial_feature(self, label: impl Into<String>, included: bool) -> Self

Add a line to the trial screen’s feature list.

Source

pub fn trial_length_days(self, days: u32) -> Self

The trial length shown when the license does not say (an endless trial shows no countdown). Default 14.

Source

pub fn show_moonbase_badge(self, show: bool) -> Self

The “Licensing secured by moonbase” footer, whose Moonbase mark links to moonbase.sh. On by default.

Source

pub fn strings(self, strings: UiStrings) -> Self

Source

pub fn show_addons(self, show: bool) -> Self

Add an “Add-ons” row to the license details, opening a screen that lists the product’s add-ons from Moonbase with what the customer can do with each: try it, buy it, or activate it on this computer. Off by default; turn it on when the product has add-ons. The add-ons a license includes unlock either way: check them with Moonbase::has_sub_product.

Source

pub fn auto_present_on_lock(self, present: bool) -> Self

Present the window whenever the app is locked: when it starts without a license, and whenever the license is lost while it runs. On by default.

Source

pub fn auto_present_update(self, present: bool) -> Self

Present the update screen when the app starts with a newer, unskipped release available. On by default.

Source

pub fn reduce_motion(self, reduce: bool) -> Self

Skip the screen transitions, the success pop and the glow. The system’s reduced-motion setting is honoured either way.

Source

pub fn window_title(self, title: impl Into<String>) -> Self

The window title. Defaults to the product name.

Source

pub fn presentation(self, presentation: Presentation) -> Self

Show the UI in its own window (the default), or as an overlay that locks one of the app’s windows until it is licensed:

let ui = UiConfig::new().presentation(Presentation::overlay());

Trait Implementations§

Source§

impl Clone for UiConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UiConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UiConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more