24 lines
581 B
Rust
24 lines
581 B
Rust
mod editor;
|
|
|
|
use druid::widget::{Flex, Padding};
|
|
use druid::{AppLauncher, Data, PlatformError, Widget, WindowDesc};
|
|
|
|
fn build_ui() -> impl Widget<editor::EditorData> {
|
|
Padding::new(
|
|
10.0,
|
|
Flex::column()
|
|
.with_flex_child(Padding::new(10.0, editor::AbacusEditor), 2.0)
|
|
.with_flex_child(editor::AbacusEditor, 1.0),
|
|
)
|
|
}
|
|
|
|
fn main() -> Result<(), PlatformError> {
|
|
AppLauncher::with_window(WindowDesc::new(build_ui())).launch(editor::EditorData::default())?;
|
|
Ok(())
|
|
}
|
|
|
|
#[derive(Clone, Data)]
|
|
struct CodeEditor {
|
|
code: String,
|
|
}
|