Remove unused code in qwasmcssstyle

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 <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Mikolaj Boc 2023-02-02 09:08:33 +01:00
parent b62ac40987
commit 43a77d4b64

View File

@ -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<emscripten::val>("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;
}