MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / operator_

Method operator_

src/python/lfs/rml_im_mode_layout.cpp:2296–2316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 7

buttonFunction · 0.85
getDescriptorMethod · 0.80
c_strMethod · 0.80
emptyMethod · 0.45
pollMethod · 0.45
invokeMethod · 0.45

Tested by

no test coverage detected