mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Make it possible to add a title to context menu
This commit is contained in:
parent
687156ac90
commit
0b489a0135
9 changed files with 33 additions and 18 deletions
|
@ -105,7 +105,7 @@ pub trait HostTrait {
|
|||
/// Ask for string
|
||||
fn prompt_input(&self, msg: String, default: String, trusted: bool) -> Option<String>;
|
||||
/// Show context menu
|
||||
fn show_context_menu(&self, items: Vec<String>);
|
||||
fn show_context_menu(&self, title: Option<String>, items: Vec<String>);
|
||||
/// Page starts loading.
|
||||
/// "Reload button" should be disabled.
|
||||
/// "Stop button" should be enabled.
|
||||
|
@ -579,7 +579,7 @@ impl ServoGlue {
|
|||
EmbedderMsg::AllowUnload(sender) => {
|
||||
let _ = sender.send(true);
|
||||
},
|
||||
EmbedderMsg::ShowContextMenu(sender, items) => {
|
||||
EmbedderMsg::ShowContextMenu(sender, title, items) => {
|
||||
if self.context_menu_sender.is_some() {
|
||||
warn!(
|
||||
"Trying to show a context menu when a context menu is already active"
|
||||
|
@ -587,7 +587,9 @@ impl ServoGlue {
|
|||
let _ = sender.send(ContextMenuResult::Ignored);
|
||||
} else {
|
||||
self.context_menu_sender = Some(sender);
|
||||
self.callbacks.host_callbacks.show_context_menu(items);
|
||||
self.callbacks
|
||||
.host_callbacks
|
||||
.show_context_menu(title, items);
|
||||
}
|
||||
},
|
||||
EmbedderMsg::Prompt(definition, origin) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue