Loading editor/widgets/slider/slider.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ extern "C" { std::string backgroundColor = ""; std::string borderRadius = "0"; std::string transition = "fade"; // fade, slide, carousel std::string itemsPerView = "1"; // slide mode only: slides visible side-by-side std::string m_itemsPerView = ""; // mobile override; empty = same as itemsPerView std::string interval = "5000"; // ms between slides bool autoplay = true; bool showArrows = true; Loading Loading @@ -182,6 +184,8 @@ extern "C" { addField("background_gradient_custom", "Gradient Custom", "text", "e.g. linear-gradient(135deg, #ff0000, #0000ff)", "desktop"); addField("border_radius", "Border Radius", "text", "e.g. 8px"); addField("transition", "Transition", "select", nullptr, "all", mkOpts({"fade","slide","carousel"})); addField("items_per_view", "Items Per View (Slide mode only)", "select", nullptr, "desktop", mkOpts({"1","2","3","4","5","6"}), "simple"); addField("interval", "Interval (ms)", "text", "e.g. 5000"); addField("autoplay", "Autoplay", "checkbox", nullptr, "all", nullptr, "simple"); addField("show_arrows", "Show Arrows", "checkbox", nullptr, "all", nullptr, "simple"); Loading @@ -194,6 +198,8 @@ extern "C" { addField("m_background_gradient_custom", "Mobile Gradient Custom", "text", "e.g. linear-gradient(135deg, #ff0000, #0000ff)", "mobile"); addField("m_width", "Mobile Width", "text", "e.g. 100%", "mobile"); addField("m_height", "Mobile Height", "text", "e.g. 400px", "mobile"); addField("m_items_per_view", "Items Per View (Mobile, Slide mode only)", "select", nullptr, "mobile", mkOpts({"1","2","3"}), "simple"); addField("hidden", "Hidden", "checkbox", nullptr, "desktop", nullptr, "simple"); { json_object *hf = json_object_array_get_idx(arr, json_object_array_length(arr) - 1); Loading Loading @@ -234,6 +240,8 @@ extern "C" { element->SetAttribute("background_color", backgroundColor.c_str()); element->SetAttribute("border_radius", borderRadius.c_str()); element->SetAttribute("transition", transition.c_str()); element->SetAttribute("items_per_view", itemsPerView.c_str()); element->SetAttribute("m_items_per_view", m_itemsPerView.c_str()); element->SetAttribute("interval", interval.c_str()); element->SetAttribute("autoplay", autoplay ? "true" : "false"); element->SetAttribute("show_arrows", showArrows ? "true" : "false"); Loading Loading @@ -290,6 +298,10 @@ extern "C" { if (val) borderRadius = val; val = xml_data->Attribute("transition"); if (val) transition = val; val = xml_data->Attribute("items_per_view"); if (val) itemsPerView = val; val = xml_data->Attribute("m_items_per_view"); if (val) m_itemsPerView = val; val = xml_data->Attribute("interval"); if (val) interval = val; Loading Loading @@ -355,6 +367,8 @@ extern "C" { json_object_object_add(obj, "background_color", json_object_new_string(backgroundColor.c_str())); json_object_object_add(obj, "border_radius", json_object_new_string(borderRadius.c_str())); json_object_object_add(obj, "transition", json_object_new_string(transition.c_str())); json_object_object_add(obj, "items_per_view", json_object_new_string(itemsPerView.c_str())); json_object_object_add(obj, "m_items_per_view", json_object_new_string(m_itemsPerView.c_str())); json_object_object_add(obj, "interval", json_object_new_string(interval.c_str())); json_object_object_add(obj, "autoplay", json_object_new_boolean(autoplay)); json_object_object_add(obj, "show_arrows", json_object_new_boolean(showArrows)); Loading Loading @@ -409,6 +423,14 @@ extern "C" { val = json_object_get_string(val_obj); if (val) transition = val; } if (json_object_object_get_ex(obj, "items_per_view", &val_obj)) { val = json_object_get_string(val_obj); if (val) itemsPerView = val; } if (json_object_object_get_ex(obj, "m_items_per_view", &val_obj)) { val = json_object_get_string(val_obj); if (val) m_itemsPerView = val; } if (json_object_object_get_ex(obj, "interval", &val_obj)) { val = json_object_get_string(val_obj); if (val) interval = val; Loading Loading
editor/widgets/slider/slider.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ extern "C" { std::string backgroundColor = ""; std::string borderRadius = "0"; std::string transition = "fade"; // fade, slide, carousel std::string itemsPerView = "1"; // slide mode only: slides visible side-by-side std::string m_itemsPerView = ""; // mobile override; empty = same as itemsPerView std::string interval = "5000"; // ms between slides bool autoplay = true; bool showArrows = true; Loading Loading @@ -182,6 +184,8 @@ extern "C" { addField("background_gradient_custom", "Gradient Custom", "text", "e.g. linear-gradient(135deg, #ff0000, #0000ff)", "desktop"); addField("border_radius", "Border Radius", "text", "e.g. 8px"); addField("transition", "Transition", "select", nullptr, "all", mkOpts({"fade","slide","carousel"})); addField("items_per_view", "Items Per View (Slide mode only)", "select", nullptr, "desktop", mkOpts({"1","2","3","4","5","6"}), "simple"); addField("interval", "Interval (ms)", "text", "e.g. 5000"); addField("autoplay", "Autoplay", "checkbox", nullptr, "all", nullptr, "simple"); addField("show_arrows", "Show Arrows", "checkbox", nullptr, "all", nullptr, "simple"); Loading @@ -194,6 +198,8 @@ extern "C" { addField("m_background_gradient_custom", "Mobile Gradient Custom", "text", "e.g. linear-gradient(135deg, #ff0000, #0000ff)", "mobile"); addField("m_width", "Mobile Width", "text", "e.g. 100%", "mobile"); addField("m_height", "Mobile Height", "text", "e.g. 400px", "mobile"); addField("m_items_per_view", "Items Per View (Mobile, Slide mode only)", "select", nullptr, "mobile", mkOpts({"1","2","3"}), "simple"); addField("hidden", "Hidden", "checkbox", nullptr, "desktop", nullptr, "simple"); { json_object *hf = json_object_array_get_idx(arr, json_object_array_length(arr) - 1); Loading Loading @@ -234,6 +240,8 @@ extern "C" { element->SetAttribute("background_color", backgroundColor.c_str()); element->SetAttribute("border_radius", borderRadius.c_str()); element->SetAttribute("transition", transition.c_str()); element->SetAttribute("items_per_view", itemsPerView.c_str()); element->SetAttribute("m_items_per_view", m_itemsPerView.c_str()); element->SetAttribute("interval", interval.c_str()); element->SetAttribute("autoplay", autoplay ? "true" : "false"); element->SetAttribute("show_arrows", showArrows ? "true" : "false"); Loading Loading @@ -290,6 +298,10 @@ extern "C" { if (val) borderRadius = val; val = xml_data->Attribute("transition"); if (val) transition = val; val = xml_data->Attribute("items_per_view"); if (val) itemsPerView = val; val = xml_data->Attribute("m_items_per_view"); if (val) m_itemsPerView = val; val = xml_data->Attribute("interval"); if (val) interval = val; Loading Loading @@ -355,6 +367,8 @@ extern "C" { json_object_object_add(obj, "background_color", json_object_new_string(backgroundColor.c_str())); json_object_object_add(obj, "border_radius", json_object_new_string(borderRadius.c_str())); json_object_object_add(obj, "transition", json_object_new_string(transition.c_str())); json_object_object_add(obj, "items_per_view", json_object_new_string(itemsPerView.c_str())); json_object_object_add(obj, "m_items_per_view", json_object_new_string(m_itemsPerView.c_str())); json_object_object_add(obj, "interval", json_object_new_string(interval.c_str())); json_object_object_add(obj, "autoplay", json_object_new_boolean(autoplay)); json_object_object_add(obj, "show_arrows", json_object_new_boolean(showArrows)); Loading Loading @@ -409,6 +423,14 @@ extern "C" { val = json_object_get_string(val_obj); if (val) transition = val; } if (json_object_object_get_ex(obj, "items_per_view", &val_obj)) { val = json_object_get_string(val_obj); if (val) itemsPerView = val; } if (json_object_object_get_ex(obj, "m_items_per_view", &val_obj)) { val = json_object_get_string(val_obj); if (val) m_itemsPerView = val; } if (json_object_object_get_ex(obj, "interval", &val_obj)) { val = json_object_get_string(val_obj); if (val) interval = val; Loading