| 2294 | } |
| 2295 | |
| 2296 | nb::object RmlImModeLayout::operator_(const std::string& operator_id, const std::string& text, |
| 2297 | const std::string& /*icon*/) { |
| 2298 | const auto* desc = vis::op::operators().getDescriptor(operator_id); |
| 2299 | std::string label_str = text.empty() ? (desc ? desc->label : operator_id) : text; |
| 2300 | std::string btn_text = LOC(label_str.c_str()); |
| 2301 | |
| 2302 | const bool can_execute = vis::op::operators().poll(operator_id); |
| 2303 | |
| 2304 | if (!can_execute) |
| 2305 | begin_disabled(); |
| 2306 | |
| 2307 | bool clicked = button(btn_text); |
| 2308 | |
| 2309 | if (!can_execute) |
| 2310 | end_disabled(); |
| 2311 | |
| 2312 | if (clicked) |
| 2313 | vis::op::operators().invoke(operator_id); |
| 2314 | |
| 2315 | return nb::cast(PyOperatorProperties(operator_id)); |
| 2316 | } |
| 2317 | |
| 2318 | std::tuple<bool, int> RmlImModeLayout::prop_search(nb::object /*data*/, const std::string& prop_id, |
| 2319 | nb::object search_data, const std::string& search_prop, |
nothing calls this directly
no test coverage detected