Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.codename1.ui.CN;
import com.codename1.ui.Component;
import com.codename1.ui.Container;
import com.codename1.ui.Dialog;
import com.codename1.ui.Display;
import com.codename1.ui.FontImage;
import com.codename1.ui.Form;
Expand Down Expand Up @@ -120,6 +121,14 @@ private static void safeAddCenter(Container parent, Component child) {
@Override
public void runApp() {
CN.setProperty("platformHint.javascript.beforeUnloadMessage", null);
// Force every Dialog into InteractionDialog mode. A regular modal Dialog
// replaces the current Form, which in the playground means the editor
// chrome itself gets swapped out when user code calls Dialog.show(...).
// InteractionDialog renders into the layered pane so the editor stays
// intact. Pinning the static flag here also locks out the
// `defaultInteractionDialogModeBool` theme constant from later flipping
// the default back when the iOS / Android native theme overlays load.
Dialog.setDefaultInteractionDialogMode(true);
theme = Resources.getGlobalResources();
currentScript = resolveInitialScript();
currentCss = resolveInitialCss();
Expand Down Expand Up @@ -977,6 +986,14 @@ private void restoreThemeDefaults() {
// means "don't render a bezel", not "don't theme the content".
layerIosTheme();
}
// Re-pin InteractionDialog mode after every theme reload. The static
// flag is sticky once `setDefaultInteractionDialogMode` has been
// called, but the native iOS / Android overlays we just layered carry
// their own `defaultInteractionDialogModeBool` theme constants and a
// future CN1 framework revision could legitimately re-read them on
// theme reload. A modal Dialog in the preview would replace the
// editor chrome itself, so we keep the default explicitly true.
Dialog.setDefaultInteractionDialogMode(true);
}

private void applyDeviceTheme(String device) {
Expand Down
Loading