summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmcssstyle.cpp
blob: 79b1964d223a65c50586c4cf7b174ac05814a2bb (plain)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
// Copyright (C) 2022 The Qt Company Ltd.// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only#include"qwasmcssstyle.h"#include"qwasmbase64iconstore.h"#include <QtCore/qstring.h>#include <QtCore/qfile.h> QT_BEGIN_NAMESPACE namespace{const char*Style = R"css(.qt-screen { --border-width: 4px; --resize-outline-width: 8px; --resize-outline-half-width: var(--resize-outline-width) / 2; position: relative; border: none; caret-color: transparent; cursor: default; width: 100%; height: 100%; overflow: hidden;}.qt-screen div { touch-action: none;}.qt-window { position: absolute; background-color: lightgray;}.qt-window.transparent-for-input { pointer-events: none;}.qt-window.has-shadow { box-shadow: rgb(0 0 0 / 20%) 0px 10px 16px 0px, rgb(0 0 0 / 19%) 0px 6px 20px 0px;}.qt-window.has-frame { border: var(--border-width) solid lightgray; caret-color: transparent;}.resize-outline { position: absolute; display: none;}.qt-window.has-frame:not(.maximized) .resize-outline { display: block;}.resize-outline.nw { left: calc(-1 * var(--resize-outline-half-width) - var(--border-width)); top: calc(-1 * var(--resize-outline-half-width) - var(--border-width)); width: var(--resize-outline-width); height: var(--resize-outline-width); cursor: nwse-resize;}.resize-outline.n { left: var(--resize-outline-half-width); top: calc(-1 * var(--resize-outline-half-width) - var(--border-width)); height: var(--resize-outline-width); width: calc(100% + 2 * var(--border-width) - var(--resize-outline-width)); cursor: ns-resize;}.resize-outline.ne { left: calc(100% + var(--border-width) - var(--resize-outline-half-width)); top: calc(-1 * var(--resize-outline-half-width) - var(--border-width)); width: var(--resize-outline-width); height: var(--resize-outline-width); cursor: nesw-resize;}.resize-outline.w { left: calc(-1 * var(--resize-outline-half-width) - var(--border-width)); top: 0; height: calc(100% + 2 * var(--border-width) - var(--resize-outline-width)); width: var(--resize-outline-width); cursor: ew-resize;}.resize-outline.e { left: calc(100% + var(--border-width) - var(--resize-outline-half-width)); top: 0; height: calc(100% + 2 * var(--border-width) - var(--resize-outline-width)); width: var(--resize-outline-width); cursor: ew-resize;}.resize-outline.sw { left: calc(-1 * var(--resize-outline-half-width) - var(--border-width)); top: calc(100% + var(--border-width) - var(--resize-outline-half-width)); width: var(--resize-outline-width); height: var(--resize-outline-width); cursor: nesw-resize;}.resize-outline.s { left: var(--resize-outline-half-width); top: calc(100% + var(--border-width) - var(--resize-outline-half-width)); height: var(--resize-outline-width); width: calc(100% + 2 * var(--border-width) - var(--resize-outline-width)); cursor: ns-resize;}.resize-outline.se { left: calc(100% + var(--border-width) - var(--resize-outline-half-width)); top: calc(100% + var(--border-width) - var(--resize-outline-half-width)); width: var(--resize-outline-width); height: var(--resize-outline-width); cursor: nwse-resize;}.title-bar { display: none; align-items: center; overflow: hidden; height: 18px; padding-bottom: 4px;}.qt-window.has-frame .title-bar { display: flex;}.title-bar .window-name { display: none; font-family: 'Lucida Grande'; white-space: nowrap; user-select: none; overflow: hidden;}.qt-window.has-title .title-bar .window-name { display: block;}.title-bar .spacer { flex-grow: 1}.qt-window.inactive .title-bar { opacity: 0.35;}.qt-window-canvas-container { display: flex; pointer-events: none;}.title-bar div { pointer-events: none;}.qt-window-a11y-container { position: absolute; z-index: -1;}.title-bar .image-button { width: 18px; height: 18px; display: flex; justify-content: center; user-select: none; align-items: center;}.title-bar .image-button img { width: 10px; height: 10px; user-select: none; pointer-events: none; -webkit-user-drag: none; background-size: 10px 10px;}.title-bar .action-button { pointer-events: all;}.qt-window.blocked div { pointer-events: none;}.title-bar .action-button img { transition: filter 0.08s ease-out;}.title-bar .action-button:hover img { filter: invert(0.45);}.title-bar .action-button:active img { filter: invert(0.6);})css";}// namespaceemscripten::val QWasmCSSStyle::createStyleElement(emscripten::val parent){auto document = parent["ownerDocument"];auto screenStyle = document.call<emscripten::val>("createElement",emscripten::val("style")); screenStyle.set("textContent",std::string(Style));return screenStyle;} QT_END_NAMESPACE 
close