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

testt

parent 70a924ee
Loading
Loading
Loading
Loading
+40 −11
Changes for editor/widgets/textbox/textbox.cpp: 40 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cstring>
#include <map>
#include <string>
#include <vector>

#include <tinyxml2.h>
#include <htmlpp/html.h>
@@ -454,7 +455,11 @@ extern "C" {
                if (val) underlineColor = val;

                val = xml_data->Attribute("icon");
                if (val) icon = val;
                if (val) {
                    icon = val;
                    // Legacy alias
                    if (icon == "check") icon = "checkmark";
                }

                val = xml_data->Attribute("icon_color");
                if (val) iconColor = val;
@@ -470,6 +475,30 @@ extern "C" {
                val = xml_data->Attribute("padding_right");  if (val) paddingRight  = val;
                val = xml_data->Attribute("padding_bottom"); if (val) paddingBottom = val;
                val = xml_data->Attribute("padding_left");   if (val) paddingLeft   = val;

                // Legacy padding shorthand: "top right bottom left" (only if individual fields not set)
                val = xml_data->Attribute("padding");
                if (val && paddingTop.empty() && paddingRight.empty() && paddingBottom.empty() && paddingLeft.empty()) {
                    std::istringstream iss(val);
                    std::vector<std::string> parts;
                    std::string p;
                    while (iss >> p) parts.push_back(p);
                    if (parts.size() == 1) {
                        paddingTop = paddingRight = paddingBottom = paddingLeft = parts[0];
                    } else if (parts.size() == 2) {
                        paddingTop = paddingBottom = parts[0];
                        paddingRight = paddingLeft = parts[1];
                    } else if (parts.size() == 3) {
                        paddingTop    = parts[0];
                        paddingRight  = paddingLeft = parts[1];
                        paddingBottom = parts[2];
                    } else if (parts.size() >= 4) {
                        paddingTop    = parts[0];
                        paddingRight  = parts[1];
                        paddingBottom = parts[2];
                        paddingLeft   = parts[3];
                    }
                }
                val = xml_data->Attribute("line_height");    if (val) lineHeight    = val;
                val = xml_data->Attribute("letter_spacing"); if (val) letterSpacing = val;
                val = xml_data->Attribute("word_spacing");   if (val) wordSpacing   = val;
@@ -870,18 +899,18 @@ extern "C" {
                            + sel + " ul>li::before," + sel + " ol>li::before{"
                            "content:none;}";
                    } else {
                        // Custom symbol via ::before
                        // Custom symbol via ::before — literal UTF-8 chars avoid CSS-escape issues
                        static const std::map<std::string,std::string> symbolMap = {
                            {"checkmark",  "\\2713\\00a0"},   // ✓
                            {"check_green","\\2713\\00a0"},   // ✓ (color set separately)
                            {"arrow",      "\\2192\\00a0"},   // →
                            {"arrow_small","\\25B6\\00a0"},   // ▶
                            {"star",       "\\2605\\00a0"},   // ★
                            {"dash",       "\\2013\\00a0"},   // –
                            {"diamond",    "\\25C6\\00a0"},   // ◆
                            {"cross",      "\\2715\\00a0"},   // ✕
                            {"checkmark",   u8"✓ "},
                            {"check_green", u8"✓ "},
                            {"arrow",       u8"→ "},
                            {"arrow_small", u8"▶ "},
                            {"star",        u8"★ "},
                            {"dash",        u8"– "},
                            {"diamond",     u8"◆ "},
                            {"cross",       u8"✕ "},
                        };
                        std::string sym = "\\2022\\00a0"; // • fallback
                        std::string sym = u8"• "; // fallback
                        auto it = symbolMap.find(listBullet);
                        if (it != symbolMap.end()) sym = it->second;