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
impl UiConfig
pub fn new() -> Self
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
No built-in window: drive your own UI from the state event and commands.
Sourcepub fn product_name(self, name: impl Into<String>) -> Self
pub fn product_name(self, name: impl Into<String>) -> Self
Shown throughout the UI. Defaults to the app’s product name.
Sourcepub fn manufacturer_name(self, name: impl Into<String>) -> Self
pub fn manufacturer_name(self, name: impl Into<String>) -> Self
Shown under the product name, and as the account the customer signs in to.
Sourcepub fn accent(self, color: impl Into<String>) -> Self
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.
Sourcepub fn logo_svg(self, svg: impl Into<String>) -> Self
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.
Sourcepub fn logo_png(self, png: impl Into<Vec<u8>>) -> Self
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.
Sourcepub fn trial_feature(self, label: impl Into<String>, included: bool) -> Self
pub fn trial_feature(self, label: impl Into<String>, included: bool) -> Self
Add a line to the trial screen’s feature list.
Sourcepub fn trial_length_days(self, days: u32) -> Self
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.
Sourcepub fn show_moonbase_badge(self, show: bool) -> Self
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.
pub fn strings(self, strings: UiStrings) -> Self
Sourcepub fn show_addons(self, show: bool) -> Self
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.
Sourcepub fn auto_present_on_lock(self, present: bool) -> Self
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.
Sourcepub fn auto_present_update(self, present: bool) -> Self
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.
Sourcepub fn reduce_motion(self, reduce: bool) -> Self
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.
Sourcepub fn window_title(self, title: impl Into<String>) -> Self
pub fn window_title(self, title: impl Into<String>) -> Self
The window title. Defaults to the product name.
Sourcepub fn presentation(self, presentation: Presentation) -> Self
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());