Small code cleanup

This commit is contained in:
Emil Ernerfeldt 2021-10-23 05:58:57 +02:00
parent a3ba85dbb3
commit 39c6c7e5c9
6 changed files with 10 additions and 10 deletions

View file

@ -752,6 +752,7 @@ impl<'t> TextEdit<'t> {
if multiline {
let mut ccursor = delete_selected(text, &cursorp);
insert_text(&mut ccursor, text, "\n");
// TODO: if code editor, auto-indent by same leading tabs, + one if the lines end on an opening bracket
Some(CCursorPair::one(ccursor))
} else {
ui.memory().surrender_focus(id); // End input with enter

View file

@ -37,13 +37,6 @@ impl Resource {
}
}
#[derive(Debug, PartialEq, Copy, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
enum Method {
Get,
Post,
}
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct HttpApp {
url: String,

View file

@ -35,6 +35,13 @@ impl epi::App for EasyMarkEditor {
}
fn update(&mut self, ctx: &egui::CtxRef, _frame: &mut epi::Frame<'_>) {
egui::TopBottomPanel::bottom("easy_mark_bottom").show(ctx, |ui| {
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {
ui.add(crate::__egui_github_link_file!())
})
});
egui::CentralPanel::default().show(ctx, |ui| {
self.ui(ui);
});
@ -49,7 +56,6 @@ impl EasyMarkEditor {
ui.end_row();
ui.checkbox(&mut self.show_rendered, "Show rendered");
ui.add(crate::__egui_github_link_file!());
});
ui.separator();

View file

@ -270,7 +270,6 @@ impl CodeTheme {
});
ui.add_space(16.0);
// ui.separator(); // TODO: fix forever-expand
ui.memory().data.insert(selected_tt);

View file

@ -47,6 +47,7 @@ cargo build \
--release \
--lib \
--target wasm32-unknown-unknown \
--no-default-features \
--features ${FEATURES}
echo "Generating JS bindings for wasm…"

View file

@ -3,4 +3,4 @@ set -eu
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path"
./build_demo_web.sh && ls -l ../docs/*.wasm
./build_demo_web.sh && ls -lh ../docs/*.wasm