Commit d80b1f5d authored by Jan Köster's avatar Jan Köster
Browse files

test

parent 11c6a68e
Loading
Loading
Loading
Loading
+18 −0
Changes for editor/widgets/accordion/accordion.cpp: 18 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -665,6 +665,24 @@ extern "C" {
                    mediaCSS += " }";
                }

                // Mobile Light mode overrides
                std::string mobileLightHdrCSS;
                if (validCss(ml_headerBgColor))   mobileLightHdrCSS += " background-color: " + ml_headerBgColor + " !important;";
                if (validCss(ml_headerTextColor)) mobileLightHdrCSS += " color: " + ml_headerTextColor + " !important;";

                std::string mobileLightBodyCSS;
                if (validCss(ml_contentBgColor))   mobileLightBodyCSS += " background: " + ml_contentBgColor + " !important;";
                if (validCss(ml_contentTextColor)) mobileLightBodyCSS += " color: " + ml_contentTextColor + " !important;";

                if (!mobileLightHdrCSS.empty() || !mobileLightBodyCSS.empty()) {
                    mediaCSS += "@media (max-width: 768px) and (prefers-color-scheme: light) {";
                    if (!mobileLightHdrCSS.empty())
                        mediaCSS += " ." + rc + "-hdr {" + mobileLightHdrCSS + " }";
                    if (!mobileLightBodyCSS.empty())
                        mediaCSS += " ." + rc + "-body {" + mobileLightBodyCSS + " }";
                    mediaCSS += " }";
                }

                if (!mediaCSS.empty()) {
                    libhtmlpp::HtmlElement styleTag("style");
                    styleTag.appendChild(libhtmlpp::TextElement(mediaCSS.c_str()));
+12 −0
Changes for editor/widgets/popup/popup.cpp: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -461,6 +461,18 @@ extern "C" {
                if (json_object_object_get_ex(obj, "m_popup_width", &val_obj)) {
                    val = json_object_get_string(val_obj); if (val) m_popupWidth = val;
                }
                if (json_object_object_get_ex(obj, "ml_button_bg_color", &val_obj)) {
                    val = json_object_get_string(val_obj); if (val) ml_buttonBgColor = val;
                }
                if (json_object_object_get_ex(obj, "ml_button_text_color", &val_obj)) {
                    val = json_object_get_string(val_obj); if (val) ml_buttonTextColor = val;
                }
                if (json_object_object_get_ex(obj, "ml_popup_bg_color", &val_obj)) {
                    val = json_object_get_string(val_obj); if (val) ml_popupBgColor = val;
                }
                if (json_object_object_get_ex(obj, "ml_popup_text_color", &val_obj)) {
                    val = json_object_get_string(val_obj); if (val) ml_popupTextColor = val;
                }
                if (json_object_object_get_ex(obj, "hidden", &val_obj)) {
                    if (json_object_is_type(val_obj, json_type_string)) {
                        const char *s = json_object_get_string(val_obj);
+14 −0
Changes for editor/widgets/slider/slider.cpp: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -352,6 +352,10 @@ extern "C" {
                    val = json_object_get_string(val_obj);
                    if (val) l_backgroundColor = val;
                }
                if (json_object_object_get_ex(obj, "ml_background_color", &val_obj)) {
                    val = json_object_get_string(val_obj);
                    if (val) ml_backgroundColor = val;
                }
                if (json_object_object_get_ex(obj, "m_width", &val_obj)) {
                    val = json_object_get_string(val_obj);
                    if (val) m_width = val;
@@ -601,6 +605,16 @@ extern "C" {
                    el.appendChild(lightStyle);
                }

                // Mobile light mode overrides
                std::string mobileLightCSS;
                if (!ml_backgroundColor.empty()) mobileLightCSS += " background-color: " + ml_backgroundColor + " !important;";
                if (!mobileLightCSS.empty()) {
                    libhtmlpp::HtmlElement mobileLightStyle("style");
                    std::string mobileLightRule = "@media (max-width: 768px) and (prefers-color-scheme: light) { ." + cls + " {" + mobileLightCSS + " } }";
                    mobileLightStyle.appendChild(libhtmlpp::TextElement(mobileLightRule.c_str()));
                    el.appendChild(mobileLightStyle);
                }

                if (!customCss.empty()) {
                    libhtmlpp::HtmlElement cssStyle("style");
                    cssStyle.appendChild(libhtmlpp::TextElement(customCss.c_str()));