use anyhow::{Context as _, Result};
pub fn run(text: String) -> Result<()> {
iced::application("LR2 OxyTabler", App::update, App::view)
.theme(App::theme)
.run_with(move || (App { text }, iced::Task::none()))
.context("iced error")
}
struct App {
text: String,
}
impl App {
#[expect(clippy::unused_self)]
const fn update(&mut self, _msg: ()) {}
fn view(&self) -> iced::Element<'_, ()> {
iced::widget::text(self.text.clone()).into()
}
#[expect(clippy::unused_self)]
const fn theme(&self) -> iced::Theme {
iced::Theme::Dark
}
}