Small code cleanup
This commit is contained in:
parent
a3ba85dbb3
commit
39c6c7e5c9
6 changed files with 10 additions and 10 deletions
|
@ -752,6 +752,7 @@ impl<'t> TextEdit<'t> {
|
||||||
if multiline {
|
if multiline {
|
||||||
let mut ccursor = delete_selected(text, &cursorp);
|
let mut ccursor = delete_selected(text, &cursorp);
|
||||||
insert_text(&mut ccursor, text, "\n");
|
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))
|
Some(CCursorPair::one(ccursor))
|
||||||
} else {
|
} else {
|
||||||
ui.memory().surrender_focus(id); // End input with enter
|
ui.memory().surrender_focus(id); // End input with enter
|
||||||
|
|
|
@ -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))]
|
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||||
pub struct HttpApp {
|
pub struct HttpApp {
|
||||||
url: String,
|
url: String,
|
||||||
|
|
|
@ -35,6 +35,13 @@ impl epi::App for EasyMarkEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, ctx: &egui::CtxRef, _frame: &mut epi::Frame<'_>) {
|
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| {
|
egui::CentralPanel::default().show(ctx, |ui| {
|
||||||
self.ui(ui);
|
self.ui(ui);
|
||||||
});
|
});
|
||||||
|
@ -49,7 +56,6 @@ impl EasyMarkEditor {
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.checkbox(&mut self.show_rendered, "Show rendered");
|
ui.checkbox(&mut self.show_rendered, "Show rendered");
|
||||||
ui.add(crate::__egui_github_link_file!());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
|
@ -270,7 +270,6 @@ impl CodeTheme {
|
||||||
});
|
});
|
||||||
|
|
||||||
ui.add_space(16.0);
|
ui.add_space(16.0);
|
||||||
// ui.separator(); // TODO: fix forever-expand
|
|
||||||
|
|
||||||
ui.memory().data.insert(selected_tt);
|
ui.memory().data.insert(selected_tt);
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ cargo build \
|
||||||
--release \
|
--release \
|
||||||
--lib \
|
--lib \
|
||||||
--target wasm32-unknown-unknown \
|
--target wasm32-unknown-unknown \
|
||||||
|
--no-default-features \
|
||||||
--features ${FEATURES}
|
--features ${FEATURES}
|
||||||
|
|
||||||
echo "Generating JS bindings for wasm…"
|
echo "Generating JS bindings for wasm…"
|
||||||
|
|
|
@ -3,4 +3,4 @@ set -eu
|
||||||
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||||
cd "$script_path"
|
cd "$script_path"
|
||||||
|
|
||||||
./build_demo_web.sh && ls -l ../docs/*.wasm
|
./build_demo_web.sh && ls -lh ../docs/*.wasm
|
||||||
|
|
Loading…
Reference in a new issue