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

test

parent 95a77966
Loading
Loading
Loading
Loading
+1 −0
Changes for editor/widgets/trustlinks/translations.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ namespace blogi { namespace webedit { namespace trustlinks_i18n {
            {"Icon Type", "Icon-Typ"},
            {"Icon (Emoji)", "Icon (Emoji)"},
            {"Custom Icon (from Library)", "Eigenes Icon (aus Bibliothek)"},
            {"Icon Color", "Icon-Farbe"},
            {"Title", "Titel"},
            {"Title Font Size", "Titel Schriftgröße"},
            {"Title Color (Dark)", "Titelfarbe (Dunkel)"},
+21 −2
Changes for editor/widgets/trustlinks/trustlinks.cpp: 21 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -72,6 +72,11 @@ extern "C" {
            std::string customIconId  = "";
            std::string customIconSvg = "";

            // Explicit fill override for custom icons (card icon + every
            // per-item link icon) — independent of linkTextColor. Falls back
            // to "currentColor" (inherits ambient text color) when empty.
            std::string iconColor = "";

            std::string title = "";

            // Card styling
@@ -222,6 +227,8 @@ extern "C" {
                    json_object_object_add(f, "svgTargetKey", json_object_new_string("custom_icon_svg"));
                }
                addField("custom_icon_svg", "", "hidden");
                addField("icon_color", "Icon Color", "color_var", nullptr, "all", nullptr, "simple",
                          mkVisible("icon_source", "custom"));
                addField("title", "Title", "text", "e.g. Sanierungslösungen", "all", nullptr, "simple");
                addField("title_font_size", "Title Font Size", "text", "24px", "desktop");
                addField("title_color",   "Title Color (Dark)",  "color_var", nullptr, "all", nullptr, "simple");
@@ -303,6 +310,7 @@ extern "C" {
                element->SetAttribute("icon_source", iconSource.c_str());
                element->SetAttribute("icon",  icon.c_str());
                element->SetAttribute("custom_icon_id", customIconId.c_str());
                element->SetAttribute("icon_color", iconColor.c_str());
                element->SetAttribute("title", title.c_str());
                element->SetAttribute("title_font_size", titleFontSize.c_str());
                element->SetAttribute("title_color",     titleColor.c_str());
@@ -366,6 +374,7 @@ extern "C" {
                val = xml_data->Attribute("icon_source"); if (val) iconSource = val;
                val = xml_data->Attribute("icon");  if (val) icon = val;
                val = xml_data->Attribute("custom_icon_id"); if (val) customIconId = val;
                val = xml_data->Attribute("icon_color"); if (val) iconColor = val;
                val = xml_data->Attribute("title"); if (val) title = val;
                val = xml_data->Attribute("title_font_size"); if (val) titleFontSize = val;
                val = xml_data->Attribute("title_color");     if (val) titleColor = val;
@@ -456,6 +465,7 @@ extern "C" {
                json_object_object_add(obj, "icon",  json_object_new_string(icon.c_str()));
                json_object_object_add(obj, "custom_icon_id", json_object_new_string(customIconId.c_str()));
                json_object_object_add(obj, "custom_icon_svg", json_object_new_string(customIconSvg.c_str()));
                json_object_object_add(obj, "icon_color", json_object_new_string(iconColor.c_str()));
                json_object_object_add(obj, "title", json_object_new_string(title.c_str()));
                json_object_object_add(obj, "title_font_size", json_object_new_string(titleFontSize.c_str()));
                json_object_object_add(obj, "title_color",     json_object_new_string(titleColor.c_str()));
@@ -536,6 +546,7 @@ extern "C" {
                strNonEmpty("icon",  icon);
                strNonEmpty("custom_icon_id", customIconId);
                str("custom_icon_svg", customIconSvg);
                strNonEmpty("icon_color", iconColor);
                str("title", title);
                strNonEmpty("title_font_size", titleFontSize);
                strNonEmpty("title_color",     titleColor);
@@ -661,8 +672,12 @@ extern "C" {
                        std::string viewBox, inner;
                        svgmarkup::parse(customIconSvg, viewBox, inner);
                        std::string vb = viewBox.empty() ? "0 0 24 24" : viewBox;
                        // fill="currentColor" so an icon whose paths don't hardcode
                        // their own color inherits the card's text color instead of
                        // rendering in whatever color happened to be authored (often
                        // black, which can look "wrong" or vanish on a dark card).
                        std::string iconSvgHtml = "<svg width=\"28\" height=\"28\" viewBox=\"" + vb +
                                                   "\" xmlns=\"http://www.w3.org/2000/svg\">" + inner + "</svg>";
                                                   "\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">" + inner + "</svg>";
                        try {
                            libhtmlpp::HtmlString htmlBuf(iconSvgHtml);
                            libhtmlpp::Element &parsed = htmlBuf.parse();
@@ -714,10 +729,14 @@ extern "C" {
                        std::string viewBox, inner;
                        svgmarkup::parse(item.customIconSvg, viewBox, inner);
                        std::string vb = viewBox.empty() ? "0 0 24 24" : viewBox;
                        // fill="currentColor": inherits the link's own text color
                        // (linkTextColor, set on the <a> below via CSS `color`) so
                        // the icon automatically matches/contrasts correctly instead
                        // of rendering in whatever color it happened to be authored.
                        std::string iconSvgHtml =
                            "<span style=\"display:inline-flex;width:1.1em;height:1.1em;vertical-align:middle;margin-right:6px;\">"
                            "<svg width=\"100%\" height=\"100%\" viewBox=\"" + vb +
                            "\" xmlns=\"http://www.w3.org/2000/svg\">" + inner + "</svg></span>";
                            "\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">" + inner + "</svg></span>";
                        try {
                            libhtmlpp::HtmlString htmlBuf(iconSvgHtml);
                            libhtmlpp::Element &parsed = htmlBuf.parse();