/* * Copyright (C) 2020-2022 The opuntiaOS Project Authors. * + Contributed by Nikita Melekhin * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include #include #include #include #include namespace UI { void PopupMenu::show(LG::Point point, const Menu& menu) { m_menu = menu; auto& connection = App::the().connection(); std::vector tmp; for (auto& item : m_menu.items()) { tmp.push_back(item.title()); } auto resp_message = connection.send_sync_message(PopupShowMenuMessage(connection.key(), m_host_window_id, point, LIPC::VectorEncoder(std::move(tmp)))); } void PopupMenu::show(LG::Point point, Menu&& menu) { m_menu = std::move(menu); auto& connection = App::the().connection(); std::vector tmp; for (auto& item : m_menu.items()) { tmp.push_back(item.title()); } auto resp_message = connection.send_sync_message(PopupShowMenuMessage(connection.key(), m_host_window_id, point, LIPC::VectorEncoder(std::move(tmp)))); } } // namespace UI