Skip to content

Commit

Permalink
Small UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Atraxus committed Aug 16, 2024
1 parent f49bb63 commit cecb961
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Intern/rayx-core/src/Tracer/Tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Tracer::Tracer(const DeviceConfig& deviceConfig) {

for (const auto& device : deviceConfig.devices) {
if (device.enable) {
RAYX_LOG << "Creating tracer with device: " << device.name;
RAYX_VERB << "Creating tracer with device: " << device.name;
m_deviceTracer = createDeviceTracer(device.type, device.index);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Intern/rayx-ui/src/RayProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void displayFilterSlider(size_t& amountOfRays, size_t maxAmountOfRays, bool& dis
// Display the actual number of rays next to the slider
ImGui::SameLine();
ImGui::Text("%zu", amountOfRays);
ImGui::Checkbox("Render all rays", &renderAllRays);
ImGui::Checkbox("Show all rays", &renderAllRays);
if (!displayRays) {
ImGui::EndDisabled(); // End grey out
}
Expand Down
41 changes: 18 additions & 23 deletions Intern/rayx-ui/src/UserInterface/UIHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ void UIHandler::setupUI(UIParameters& uiParams) {
showUISettingsWindow(uiParams);
showMissingFilePopupWindow(uiParams);
showSimulationSettingsPopupWindow(uiParams);
showSettingsWindow();
m_BeamlineOutliner.showBeamlineOutlineWindow(uiParams);
showHotkeysWindow();
ImGui::End();
Expand Down Expand Up @@ -372,10 +371,20 @@ void UIHandler::showUISettingsWindow(UIParameters& uiParams) {
ImGui::ColorEdit3("Color", (float*)&m_ClearColor);

ImGui::SliderFloat("Scale", &m_scale, 0.1f, 4.0f, "%.1f", ImGuiSliderFlags_AlwaysClamp);
if (ImGui::Button("Toggle Theme")) {
m_isDarkTheme = !m_isDarkTheme; // Toggle theme
if (m_isDarkTheme) {
applyDarkTheme();
} else {
applyLightTheme();
}
}

// checkbox
ImGui::Checkbox("Load h5 with RML", &m_loadh5withRML);

ImGui::Separator();
uiParams.camController.displaySettings();
ImGui::Separator();

if (!uiParams.rmlPath.empty() && uiParams.rayInfo.raysLoaded) {
size_t currentAmountOfRays = uiParams.rayInfo.amountOfRays;
bool currentRenderAllRays = uiParams.rayInfo.renderAllRays;
Expand All @@ -390,7 +399,12 @@ void UIHandler::showUISettingsWindow(UIParameters& uiParams) {
uiParams.rayInfo.cacheChanged = true;
}
}
ImGui::Text("Application average %.6f ms/frame", uiParams.frameTime * 1000.0f);

ImGui::Separator();

uiParams.camController.displaySettings();

ImGui::Text("Application averages %.2f ms/frame", uiParams.frameTime * 1000.0f);

ImGui::End();
}
Expand Down Expand Up @@ -507,25 +521,6 @@ void UIHandler::applyLightTheme() {
style->Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 1.00f, 0.35f); // Light blue for text selection
}

void UIHandler::showSettingsWindow() {
ImGui::Begin("Settings");

ImGui::SliderFloat("Scale", &m_scale, 0.1f, 4.0f, "%.1f", ImGuiSliderFlags_AlwaysClamp);
if (ImGui::Button("Toggle Theme")) {
m_isDarkTheme = !m_isDarkTheme; // Toggle theme
if (m_isDarkTheme) {
applyDarkTheme();
} else {
applyLightTheme();
}
}

// checkbox
ImGui::Checkbox("Load h5 with RML", &m_loadh5withRML);

ImGui::End();
}

void UIHandler::showHotkeysWindow() {
ImGui::Begin("Hotkeys");

Expand Down
1 change: 0 additions & 1 deletion Intern/rayx-ui/src/UserInterface/UIHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class UIHandler {

void showSceneEditorWindow(UIParameters& uiParams);
void showUISettingsWindow(UIParameters& uiParams);
void showSettingsWindow();
void showHotkeysWindow();
void showMissingFilePopupWindow(UIParameters& uiParams);
void showSimulationSettingsPopupWindow(UIParameters& uiParams);
Expand Down

0 comments on commit cecb961

Please sign in to comment.