command palette: now a modal + proper sizing&centering

This commit is contained in:
YohananDiamond 2023-07-03 16:38:08 -03:00
parent 60de8b0e90
commit b19f7cfdd8
2 changed files with 7 additions and 5 deletions

View file

@ -52,7 +52,6 @@ void FurnaceGUI::drawPalette() {
ImGui::SetKeyboardFocusHere();
int width=ImGui::GetContentRegionAvail().x;
ImGui::SetNextItemWidth(width);
if (ImGui::InputTextWithHint("##CommandPaletteSearch","Search...",&paletteQuery) || paletteFirstFrame) {
@ -83,7 +82,10 @@ void FurnaceGUI::drawPalette() {
};
}
if (ImGui::BeginChild("CommandPaletteList",ImVec2(width,canvasH*0.3),false,0)) {
ImVec2 avail=ImGui::GetContentRegionAvail();
avail.y-=ImGui::GetFrameHeightWithSpacing();
if (ImGui::BeginChild("CommandPaletteList",avail,false,0)) {
bool navigated=false;
if (ImGui::IsKeyPressed(ImGuiKey_UpArrow) && curPaletteChoice>0) {
curPaletteChoice-=1;