Rename legacy shell demo toggle away from ImGui
This commit is contained in:
@@ -13,7 +13,7 @@ constexpr std::size_t ToIndex(XCUIShellPanelId panelId) {
|
||||
constexpr std::string_view kViewMenuLabel = "View";
|
||||
constexpr std::string_view kXCUIDemoShortcut = "Ctrl+1";
|
||||
constexpr std::string_view kXCUILayoutLabShortcut = "Ctrl+2";
|
||||
constexpr std::string_view kImGuiDemoShortcut = "Ctrl+3";
|
||||
constexpr std::string_view kLegacyHostDemoShortcut = "Ctrl+3";
|
||||
constexpr std::string_view kNativeBackdropShortcut = "Ctrl+Shift+B";
|
||||
constexpr std::string_view kPulseAccentShortcut = "Ctrl+Shift+P";
|
||||
constexpr std::string_view kNativeXCUIOverlayShortcut = "Ctrl+Shift+O";
|
||||
@@ -164,8 +164,8 @@ bool XCUIShellChromeState::ToggleHostedPreviewMode(XCUIShellPanelId panelId) {
|
||||
|
||||
bool XCUIShellChromeState::GetViewToggle(XCUIShellViewToggleId toggleId) const {
|
||||
switch (toggleId) {
|
||||
case XCUIShellViewToggleId::ImGuiDemoWindow:
|
||||
return m_viewToggles.imguiDemoWindowVisible;
|
||||
case XCUIShellViewToggleId::LegacyHostDemoWindow:
|
||||
return m_viewToggles.legacyHostDemoWindowVisible;
|
||||
case XCUIShellViewToggleId::NativeBackdrop:
|
||||
return m_viewToggles.nativeBackdropVisible;
|
||||
case XCUIShellViewToggleId::PulseAccent:
|
||||
@@ -183,8 +183,8 @@ bool XCUIShellChromeState::GetViewToggle(XCUIShellViewToggleId toggleId) const {
|
||||
bool XCUIShellChromeState::SetViewToggle(XCUIShellViewToggleId toggleId, bool enabled) {
|
||||
bool* target = nullptr;
|
||||
switch (toggleId) {
|
||||
case XCUIShellViewToggleId::ImGuiDemoWindow:
|
||||
target = &m_viewToggles.imguiDemoWindowVisible;
|
||||
case XCUIShellViewToggleId::LegacyHostDemoWindow:
|
||||
target = &m_viewToggles.legacyHostDemoWindowVisible;
|
||||
break;
|
||||
case XCUIShellViewToggleId::NativeBackdrop:
|
||||
target = &m_viewToggles.nativeBackdropVisible;
|
||||
@@ -227,8 +227,8 @@ bool XCUIShellChromeState::InvokeCommand(std::string_view commandId) {
|
||||
if (commandId == XCUIShellChromeCommandIds::ToggleXCUILayoutLabPanel) {
|
||||
return TogglePanelVisible(XCUIShellPanelId::XCUILayoutLab);
|
||||
}
|
||||
if (commandId == XCUIShellChromeCommandIds::ToggleImGuiDemoWindow) {
|
||||
return ToggleViewToggle(XCUIShellViewToggleId::ImGuiDemoWindow);
|
||||
if (commandId == XCUIShellChromeCommandIds::ToggleLegacyHostDemoWindow) {
|
||||
return ToggleViewToggle(XCUIShellViewToggleId::LegacyHostDemoWindow);
|
||||
}
|
||||
if (commandId == XCUIShellChromeCommandIds::ToggleNativeBackdrop) {
|
||||
return ToggleViewToggle(XCUIShellViewToggleId::NativeBackdrop);
|
||||
@@ -288,12 +288,12 @@ bool XCUIShellChromeState::TryGetCommandDescriptor(
|
||||
return true;
|
||||
}
|
||||
|
||||
if (commandId == GetViewToggleCommandId(XCUIShellViewToggleId::ImGuiDemoWindow)) {
|
||||
outDescriptor.label = "ImGui Demo";
|
||||
outDescriptor.shortcut = kImGuiDemoShortcut;
|
||||
if (commandId == GetViewToggleCommandId(XCUIShellViewToggleId::LegacyHostDemoWindow)) {
|
||||
outDescriptor.label = "Legacy Host Demo";
|
||||
outDescriptor.shortcut = kLegacyHostDemoShortcut;
|
||||
outDescriptor.commandId = commandId;
|
||||
outDescriptor.checkable = true;
|
||||
outDescriptor.checked = GetViewToggle(XCUIShellViewToggleId::ImGuiDemoWindow);
|
||||
outDescriptor.checked = GetViewToggle(XCUIShellViewToggleId::LegacyHostDemoWindow);
|
||||
outDescriptor.enabled = true;
|
||||
return true;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ XCUIShellMenuDescriptor XCUIShellChromeState::BuildViewMenuDescriptor() const {
|
||||
|
||||
appendCommandItem(GetPanelVisibilityCommandId(XCUIShellPanelId::XCUIDemo));
|
||||
appendCommandItem(GetPanelVisibilityCommandId(XCUIShellPanelId::XCUILayoutLab));
|
||||
appendCommandItem(GetViewToggleCommandId(XCUIShellViewToggleId::ImGuiDemoWindow));
|
||||
appendCommandItem(GetViewToggleCommandId(XCUIShellViewToggleId::LegacyHostDemoWindow));
|
||||
|
||||
descriptor.items.push_back({ XCUIShellMenuItemKind::Separator, {} });
|
||||
|
||||
@@ -414,8 +414,8 @@ std::string_view XCUIShellChromeState::GetPanelPreviewModeCommandId(XCUIShellPan
|
||||
|
||||
std::string_view XCUIShellChromeState::GetViewToggleCommandId(XCUIShellViewToggleId toggleId) {
|
||||
switch (toggleId) {
|
||||
case XCUIShellViewToggleId::ImGuiDemoWindow:
|
||||
return XCUIShellChromeCommandIds::ToggleImGuiDemoWindow;
|
||||
case XCUIShellViewToggleId::LegacyHostDemoWindow:
|
||||
return XCUIShellChromeCommandIds::ToggleLegacyHostDemoWindow;
|
||||
case XCUIShellViewToggleId::NativeBackdrop:
|
||||
return XCUIShellChromeCommandIds::ToggleNativeBackdrop;
|
||||
case XCUIShellViewToggleId::PulseAccent:
|
||||
|
||||
@@ -16,7 +16,7 @@ enum class XCUIShellPanelId : std::uint8_t {
|
||||
};
|
||||
|
||||
enum class XCUIShellViewToggleId : std::uint8_t {
|
||||
ImGuiDemoWindow = 0,
|
||||
LegacyHostDemoWindow = 0,
|
||||
NativeBackdrop,
|
||||
PulseAccent,
|
||||
NativeXCUIOverlay,
|
||||
@@ -46,7 +46,7 @@ struct XCUIShellPanelChromeState {
|
||||
};
|
||||
|
||||
struct XCUIShellViewToggleState {
|
||||
bool imguiDemoWindowVisible = false;
|
||||
bool legacyHostDemoWindowVisible = false;
|
||||
bool nativeBackdropVisible = true;
|
||||
bool pulseAccentEnabled = true;
|
||||
bool nativeXCUIOverlayVisible = true;
|
||||
@@ -56,7 +56,7 @@ struct XCUIShellViewToggleState {
|
||||
struct XCUIShellChromeCommandIds {
|
||||
static constexpr const char* ToggleXCUIDemoPanel = "new_editor.view.xcui_demo";
|
||||
static constexpr const char* ToggleXCUILayoutLabPanel = "new_editor.view.xcui_layout_lab";
|
||||
static constexpr const char* ToggleImGuiDemoWindow = "new_editor.view.imgui_demo";
|
||||
static constexpr const char* ToggleLegacyHostDemoWindow = "new_editor.view.legacy_host_demo";
|
||||
static constexpr const char* ToggleNativeBackdrop = "new_editor.view.native_backdrop";
|
||||
static constexpr const char* TogglePulseAccent = "new_editor.view.pulse_accent";
|
||||
static constexpr const char* ToggleNativeXCUIOverlay = "new_editor.view.native_xcui_overlay";
|
||||
|
||||
Reference in New Issue
Block a user