MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / PushPage

Method PushPage

engine/Poseidon/UI/Options/OptionsShell.cpp:117–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 t->SetText(RString(text));
116}
117
118void OptionsShell::PushPage(std::unique_ptr<OptionsPage> page)
119{
120 if (!page)
121 return;
122 // Hide the underlying page's controls regardless of modal-ness.
123 // For non-modal transitions, this is the obvious "the new page
124 // takes the screen" behaviour. For modals it also matters: modal
125 // buttons share the notebook surface with the underlying page's
126 // transparent click overlays (slot Hover / chevron / bar zones),
127 // and overlapping rows otherwise win the hit-test in declaration
128 // order — which is why clicking a modal button sometimes only
129 // hovers/highlights it but doesn't activate (the click resolved
130 // to the underlying slot's overlay, never reached the modal IDC).
131 // Hiding makes click dispatch unambiguous and matches the semantic
132 // that a modal owns input. The visible modal panel is opaque so
133 // the user still sees a frame and label; the laptop chrome and
134 // scene around it stay visible because they're not part of the
135 // page's mounted controls.
136 if (auto* prev = TopPage())
137 ShowPageControls(prev, false);
138
139 OptionsPage* p = page.get();
140 m_stack.push_back(std::move(page));
141 p->Mount(*this);
142 ApplyNotebookTheme(p);
143 int focusIdc = p->DefaultFocusIdc();
144 if (focusIdc >= 0)
145 FocusNotebookCtrl(focusIdc);
146 p->OnReshown(*this);
147 RefreshTitle();
148}
149

Callers 15

OnButtonClickedMethod · 0.80
OnRowActionMethod · 0.80
OnBindingClickedMethod · 0.80
OnRowActionMethod · 0.80
OnNavMethod · 0.80
OnRowActionMethod · 0.80
OnNavMethod · 0.80
OnNavMethod · 0.80

Calls 4

getMethod · 0.45
MountMethod · 0.45
DefaultFocusIdcMethod · 0.45
OnReshownMethod · 0.45

Tested by 1

OnNavMethod · 0.64