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

Method apply_state

src/python/lfs/py_ui.cpp:1321–1340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1319 }
1320
1321 void PySubLayout::apply_state() {
1322 const auto eff = effective_state();
1323 if (!eff.enabled) {
1324 ImGui::BeginDisabled(true);
1325 disabled_pushed_ = true;
1326 }
1327 if (eff.alert) {
1328 const auto theme = get_current_theme();
1329 const auto err = tuple_to_imvec4(theme.palette.error);
1330 ImGui::PushStyleColor(ImGuiCol_Text, err);
1331 ImGui::PushStyleColor(ImGuiCol_FrameBg,
1332 ImVec4(err.x, err.y, err.z, ALERT_BG_ALPHA));
1333 color_push_count_ += 2;
1334 }
1335 const float scale = std::max(eff.scale_x, eff.scale_y);
1336 if (scale != 1.0f) {
1337 ImGui::SetWindowFontScale(scale);
1338 font_scale_pushed_ = true;
1339 }
1340 }
1341
1342 void PySubLayout::pop_per_item_state() {
1343 if (font_scale_pushed_) {

Callers 1

register_uiFunction · 0.80

Calls 3

get_current_themeFunction · 0.85
tuple_to_imvec4Function · 0.85
maxFunction · 0.50

Tested by

no test coverage detected