Skip to content

Commit

Permalink
refactor: rename components to webview and move WebView into it
Browse files Browse the repository at this point in the history
  • Loading branch information
pewsheen committed Dec 4, 2024
1 parent 3eddf79 commit fe62206
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ pub use errors::{Error, Result};
pub use verso::Verso;
/// Re-exporting Winit for the sake of convenience.
pub use winit;
/// Context
pub mod components;
File renamed without changes.
3 changes: 3 additions & 0 deletions src/components/mod.rs → src/webview/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
mod webview;
/// WebView
pub use webview::{Panel, WebView};
/// Context Menu
pub mod context_menu;
/// Prompt Dialog
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/webview.rs → src/webview/webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ use url::Url;
use webrender_api::units::DeviceIntRect;

use crate::{
components::prompt::{PromptDialog, PromptInputResult, PromptSender},
compositor::IOCompositor,
verso::send_to_constellation,
webview::prompt::{PromptDialog, PromptInputResult, PromptSender},
window::Window,
};

#[cfg(linux)]
use crate::components::context_menu::ContextMenuResult;
use crate::webview::context_menu::ContextMenuResult;

/// A web view is an area to display web browsing context. It's what user will treat as a "web page".
#[derive(Debug, Clone)]
Expand Down
14 changes: 7 additions & 7 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ use winit::{
};

use crate::{
components::{
context_menu::{ContextMenu, Menu},
prompt::{PromptDialog, PromptSender},
},
compositor::{IOCompositor, MouseWindowEvent},
keyboard::keyboard_event_from_winit,
rendering::{gl_config_picker, RenderingContext},
verso::send_to_constellation,
webview::{Panel, WebView},
webview::{
context_menu::{ContextMenu, Menu},
prompt::{PromptDialog, PromptSender},
Panel, WebView,
},
};

use arboard::Clipboard;
Expand Down Expand Up @@ -668,7 +668,7 @@ impl Window {

#[cfg(linux)]
pub(crate) fn show_context_menu(&mut self, sender: &Sender<ConstellationMsg>) -> ContextMenu {
use crate::components::context_menu::MenuItem;
use crate::webview::context_menu::MenuItem;

let history_len = self.history.len();

Expand Down Expand Up @@ -739,7 +739,7 @@ impl Window {
pub(crate) fn handle_context_menu_event(
&mut self,
sender: &Sender<ConstellationMsg>,
event: crate::components::context_menu::ContextMenuResult,
event: crate::webview::context_menu::ContextMenuResult,
) {
self.close_context_menu(sender);
match event.id.as_str() {
Expand Down

0 comments on commit fe62206

Please sign in to comment.