summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/debugimgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/debugger/debugimgui.cpp')
-rw-r--r--src/osd/modules/debugger/debugimgui.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp
index 504899f560a..81f13926376 100644
--- a/src/osd/modules/debugger/debugimgui.cpp
+++ b/src/osd/modules/debugger/debugimgui.cpp
@@ -540,12 +540,12 @@ void debug_imgui::draw_view(debug_area* view_ptr, bool exp_change)
{
char str[2];
map_attr_to_fg_bg(viewdata->attrib,&fg,&bg);
- ImU32 fg_col = ImGui::ColorConvertFloat4ToU32(ImVec4(fg.r()/255.0f,fg.g()/255.0f,fg.b()/255.0f,fg.a()/255.0f));
+ ImU32 fg_col = IM_COL32(fg.r(),fg.g(),fg.b(),fg.a());
str[0] = v = viewdata->byte;
str[1] = '\0';
if(bg != base)
{
- ImU32 bg_col = ImGui::ColorConvertFloat4ToU32(ImVec4(bg.r()/255.0f,bg.g()/255.0f,bg.b()/255.0f,bg.a()/255.0f));
+ ImU32 bg_col = IM_COL32(bg.r(),bg.g(),bg.b(),bg.a());
xy1.x++; xy2.x++;
drawlist->AddRectFilled(xy1,xy2,bg_col);
xy1.x--; xy2.x--;
@@ -560,6 +560,15 @@ void debug_imgui::draw_view(debug_area* view_ptr, bool exp_change)
xy1.y += fsize.y;
xy2.y += fsize.y;
}
+
+ // draw a rect around a view if it has focus
+ if(view_ptr->has_focus)
+ {
+ ImU32 col = IM_COL32(127,127,127,76);
+ drawlist->AddRect(ImVec2(view_ptr->ofs_x,view_ptr->ofs_y + ImGui::GetScrollY()),
+ ImVec2(view_ptr->ofs_x + view_ptr->view_width,view_ptr->ofs_y + ImGui::GetScrollY() + view_ptr->view_height),col);
+ }
+
ImGui::PopStyleVar(2);
}
@@ -938,12 +947,15 @@ void debug_imgui::draw_console()
draw_view(view_main_console,false);
ImGui::EndChild();
ImGui::Separator();
+
ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue;
if(m_running)
flags |= ImGuiInputTextFlags_ReadOnly;
ImGui::PushItemWidth(-1.0f);
if(ImGui::InputText("##console_input",view_main_console->console_input,512,flags))
view_main_console->exec_cmd = true;
+ if ((ImGui::IsRootWindowOrAnyChildFocused() && !ImGui::IsAnyItemActive() && !ImGui::IsMouseClicked(0)))
+ ImGui::SetKeyboardFocusHere(-1); // Auto focus previous widget
ImGui::PopItemWidth();
ImGui::EndChild();
ImGui::End();