mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +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
|
@ -67,12 +67,17 @@ void prompt_alert(const char *message, bool trusted) {
|
|||
sServo->Delegate().OnServoPromptAlert(char2hstring(message), trusted);
|
||||
}
|
||||
|
||||
void show_context_menu(const char *const *items_list, uint32_t items_size) {
|
||||
void show_context_menu(const char *title, const char *const *items_list,
|
||||
uint32_t items_size) {
|
||||
std::optional<hstring> opt_title = {};
|
||||
if (title != nullptr) {
|
||||
opt_title = char2hstring(title);
|
||||
}
|
||||
std::vector<winrt::hstring> items;
|
||||
for (uint32_t i = 0; i < items_size; i++) {
|
||||
items.push_back(char2hstring(items_list[i]));
|
||||
}
|
||||
sServo->Delegate().OnServoShowContextMenu(items);
|
||||
sServo->Delegate().OnServoShowContextMenu(opt_title, items);
|
||||
}
|
||||
|
||||
void on_devtools_started(Servo::DevtoolsServerState result,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue