mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-02 22:44:13 +00:00
integrate source view feature
This commit is contained in:
parent
88457b3fa0
commit
96f2edddfb
@ -219,7 +219,7 @@ impl Tab {
|
||||
pub fn save_as(&self, page_position: Option<i32>) {
|
||||
if let Some(item) = self.item(page_position) {
|
||||
item.page.navigation.request.to_download();
|
||||
todo!()
|
||||
self.window_action.reload.activate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ impl Tab {
|
||||
pub fn source(&self, page_position: Option<i32>) {
|
||||
if let Some(item) = self.item(page_position) {
|
||||
item.page.navigation.request.to_source();
|
||||
todo!()
|
||||
self.window_action.reload.activate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,13 @@ impl Gemini {
|
||||
|
||||
// Actions
|
||||
|
||||
pub fn handle(&self, uri: Uri, feature: Feature, cancellable: Cancellable, is_history: bool) {
|
||||
pub fn handle(
|
||||
&self,
|
||||
uri: Uri,
|
||||
feature: Feature,
|
||||
cancellable: Cancellable,
|
||||
is_snap_history: bool,
|
||||
) {
|
||||
// Move focus out from navigation entry
|
||||
self.page
|
||||
.browser_action
|
||||
@ -101,7 +107,7 @@ impl Gemini {
|
||||
|
||||
self.tab_page.set_loading(true);
|
||||
|
||||
if is_history {
|
||||
if is_snap_history {
|
||||
snap_history(&self.page, None);
|
||||
}
|
||||
|
||||
@ -232,16 +238,11 @@ impl Gemini {
|
||||
cancellable.clone(),
|
||||
move |result| match result {
|
||||
Ok(text) => {
|
||||
/* @TODO refactor features
|
||||
let widget = if is_source_request {
|
||||
page.content.to_text_source(&data)
|
||||
let widget = if matches!(feature, Feature::Source) {
|
||||
page.content.to_text_source(&text.to_string())
|
||||
} else {
|
||||
page.content.to_text_gemini(&uri, &data)
|
||||
};*/
|
||||
|
||||
let widget = page
|
||||
.content
|
||||
.to_text_gemini(&uri, &text.to_string());
|
||||
page.content.to_text_gemini(&uri, &text.to_string())
|
||||
};
|
||||
|
||||
// Connect `TextView` widget, update `search` model
|
||||
page.search.set(Some(widget.text_view));
|
||||
@ -371,7 +372,7 @@ impl Gemini {
|
||||
.set_text(&uri.to_string());
|
||||
}
|
||||
redirects.replace(total);
|
||||
page.tab_action.load.activate(Some(&target.to_string()), is_history);
|
||||
page.tab_action.load.activate(Some(&target.to_string()), is_snap_history);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user