LWTUIM4B3G2LKUE4YLV72YERLELQZU2XA5I5BMHT7KLTNTPB2PZQC
let body =
if let Some(mime_type) = gemini.header.mime_type() {
if mime_type.split(';').next().unwrap() == "text/gemini" {
if let Some(body) = gemini.body_text() {
Some(gemini::parse::parse_gemtext(body).map_err(|err| {
io::Error::new(io::ErrorKind::Other, err)
})?)
} else {
None
}
let body = if let Some(mime_type) = gemini.header.mime_type() {
if mime_type.split(';').next().unwrap() == "text/gemini" {
if let Some(body) = gemini.body_text() {
Some(gemini::parse::parse_gemtext(body).map_err(
|err| io::Error::new(io::ErrorKind::Other, err),
)?)
ctx.request_repaint();
});
ctx.request_repaint();
});
}
"internal" => {
sender.send(Ok(RequestType::Internal(new_url.path().to_string())));
ctx.request_repaint();
}
_ => {
// TODO: Mime launch
self.url_bar = self.url_history.pop().unwrap();
self.reload = true;
return;
}
}
if response.lost_focus() && ui.input().key_pressed(egui::Key::Enter) {
self.url_history.push(self.url_bar.to_owned());
self.reload = true;
}
button.clone().on_hover_text("Settings");
if button.clicked() {
self.url_history.push("internal:settings".to_string());
self.reload = true;
}
// Save page
let button = ui.button("💾");
})
//});
// URL entry
let response = ui.add(
egui::TextEdit::singleline(&mut self.url_bar)
.desired_width(ui.available_size().x)
.hint_text("Enter URL..."),
);
if response.lost_focus() && ui.input().key_pressed(egui::Key::Enter) {
self.url_history.push(self.url_bar.to_owned());
self.reload = true;
}
});
Some(Ok((gemini, body))) => match gemini.status().category() {
Some(Ok(RequestType::Internal(internal))) => {
if let Some(handler) = self.internal_handlers.get(internal) {
handler(self, ui);
}
}
Some(Ok(RequestType::Gemini(gemini, body))) => match gemini.status().category() {