From 43a77d4b64608edee3782ddbe15da2364b24567e Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Thu, 2 Feb 2023 09:08:33 +0100 Subject: [PATCH] Remove unused code in qwasmcssstyle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 32666691c21cc91a3d7c7585dad711dc9743fdce, icons have been set manually on img elements. The css code assigning the icons to elements is now unused - remove it. Change-Id: I394f08371c80f0e374a5cc7e39d17bb6091d18dc Reviewed-by: Aleksandr Reviakin Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmcssstyle.cpp | 27 +------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/plugins/platforms/wasm/qwasmcssstyle.cpp b/src/plugins/platforms/wasm/qwasmcssstyle.cpp index efbe4ddcc40..6222e9c88a4 100644 --- a/src/plugins/platforms/wasm/qwasmcssstyle.cpp +++ b/src/plugins/platforms/wasm/qwasmcssstyle.cpp @@ -169,21 +169,6 @@ const char *Style = R"css( background-size: 10px 10px; } -.title-bar .image-button img[qt-builtin-image-type=x] { - background-image: url("data:image/svg+xml;base64,$close_icon"); -} - -.title-bar .image-button img[qt-builtin-image-type=qt-logo] { - background-image: url("qtlogo.svg"); -} - -.title-bar .image-button img[qt-builtin-image-type=restore] { - background-image: url("data:image/svg+xml;base64,$restore_icon"); -} - -.title-bar .image-button img[qt-builtin-image-type=maximize] { - background-image: url("data:image/svg+xml;base64,$maximize_icon"); -} .title-bar .action-button { pointer-events: all; } @@ -206,24 +191,14 @@ const char *Style = R"css( )css"; -void replace(std::string &str, const std::string &from, const std::string_view &to) -{ - str.replace(str.find(from), from.length(), to); -} } // namespace emscripten::val QWasmCSSStyle::createStyleElement(emscripten::val parent) { auto document = parent["ownerDocument"]; auto screenStyle = document.call("createElement", emscripten::val("style")); - auto text = std::string(Style); - using IconType = Base64IconStore::IconType; - replace(text, "$close_icon", Base64IconStore::get()->getIcon(IconType::X)); - replace(text, "$restore_icon", Base64IconStore::get()->getIcon(IconType::Restore)); - replace(text, "$maximize_icon", Base64IconStore::get()->getIcon(IconType::Maximize)); - - screenStyle.set("textContent", text); + screenStyle.set("textContent", std::string(Style)); return screenStyle; }