Skip to content

Commit

Permalink
issue addressed and minor UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Noy-Zini committed Oct 6, 2024
1 parent 48807d1 commit 37d72fe
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
8 changes: 4 additions & 4 deletions common/device-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2419,20 +2419,20 @@ namespace rs2
{
bool stop_recording = false;

ImGui::SetCursorPos({ windows_width - 42, pos.y + 3 });
ImGui::SetCursorPos({ windows_width - 60, pos.y });
ImGui_ScopePushFont(window.get_font());

ImGui_ScopePushStyleColor(ImGuiCol_Button, sensor_bg);
ImGui_ScopePushStyleColor(ImGuiCol_ButtonHovered, sensor_bg);
ImGui_ScopePushStyleColor(ImGuiCol_ButtonActive, sensor_bg);

int font_size = window.get_font_size();
ImVec2 button_size = { font_size * 1.9f, font_size * 1.9f };
ImVec2 button_size = { font_size * 3.0f, font_size * 1.0f };

if (!sub->streaming)
{
std::string label = rsutils::string::from()
<< " " << textual_icons::toggle_off << "\noff ##" << id << ","
<<textual_icons::toggle_off<<" off "<< id << ", "
<< sub->s->get_info( RS2_CAMERA_INFO_NAME );

ImGui_ScopePushStyleColor(ImGuiCol_Text, redish);
Expand Down Expand Up @@ -2514,7 +2514,7 @@ namespace rs2
else
{
std::string label = rsutils::string::from()
<< " " << textual_icons::toggle_on << "\n on##" << id << ","
<< textual_icons::toggle_on << " on " << id << ","
<< sub->s->get_info( RS2_CAMERA_INFO_NAME );
ImGui_ScopePushStyleColor(ImGuiCol_Text, light_blue);
ImGui_ScopePushStyleColor(ImGuiCol_TextSelectedBg, light_blue + 0.1f);
Expand Down
5 changes: 1 addition & 4 deletions common/ux-alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "ux-alignment.h"
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl3.h>
#include <vector>
#include <memory>

Expand Down Expand Up @@ -47,12 +46,10 @@ bool is_gui_aligned(GLFWwindow *win)
ImGui::PopStyleVar();

ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());

glfwSwapBuffers(win);

//ImGui_ImplOpenGL3_NewFrame();
//ImGui_ImplGlfw_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();

SetFocus(hwn);
Expand Down
6 changes: 2 additions & 4 deletions common/ux-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ namespace rs2
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;
io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange; // added in order to prevents cursor chang when interacting with other element (when nedded remove the flag accordingly)

if (_win)
{
Expand Down Expand Up @@ -632,15 +632,13 @@ namespace rs2
}

// reset graphic pipe
begin_frame();

begin_frame();
if (_link_hovered)
glfwSetCursor(_win, _hand_cursor);
else if (_cross_hovered)
glfwSetCursor(_win, _cross_cursor);
else
glfwSetCursor(_win, nullptr);

_cross_hovered = false;
_link_hovered = false;
_hovers_any_input_window = false;
Expand Down
2 changes: 1 addition & 1 deletion examples/align-advanced/rs-align-advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void render_slider(rect location, float& clipping_dist)

//Render the vertical slider
ImGui::Begin("slider", nullptr, flags);
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.3f, 0.7f, 1.0f));
ImGui::PushStyleColor(ImGuiCol_FrameBg, { 0.2f / 255, 0.3f / 255, 0.7f / 255 ,1});
ImGui::PushStyleColor(ImGuiCol_SliderGrab, { 215.f / 255, 215.0f / 255, 215.0f / 255,1 });
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, { 215.f / 255, 215.0f / 255, 215.0f / 255,1 });
auto slider_size = ImVec2(slider_window_width / 2, location.h - (pixels_to_buttom_of_stream_text * 2) - 20);
Expand Down
4 changes: 4 additions & 0 deletions third-party/imgui/realsense_imgui.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* License: Apache 2.0. See LICENSE file in root directory. */
/* Copyright(c) 2024 Intel Corporation. All Rights Reserved. */

//Overloading imgui functions to accommodate realsense GUI
#include <realsense_imgui.h>


Expand Down
4 changes: 4 additions & 0 deletions third-party/imgui/realsense_imgui.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* License: Apache 2.0. See LICENSE file in root directory. */
/* Copyright(c) 2024 Intel Corporation. All Rights Reserved. */
#pragma once

#include<imgui.h>
#include<imgui_internal.h>

Expand Down

0 comments on commit 37d72fe

Please sign in to comment.