command palette: (breaking) attempt to center the window

This commit is contained in:
YohananDiamond 2023-07-03 16:01:46 -03:00
parent e454433199
commit 60de8b0e90
2 changed files with 7 additions and 2 deletions

View file

@ -51,7 +51,9 @@ void FurnaceGUI::drawPalette() {
if (paletteFirstFrame)
ImGui::SetKeyboardFocusHere();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
int width=ImGui::GetContentRegionAvail().x;
ImGui::SetNextItemWidth(width);
if (ImGui::InputTextWithHint("##CommandPaletteSearch","Search...",&paletteQuery) || paletteFirstFrame) {
paletteSearchResults.clear();
@ -81,7 +83,7 @@ void FurnaceGUI::drawPalette() {
};
}
if (ImGui::BeginChild("CommandPaletteList",ImVec2(312,216),false,0)) {
if (ImGui::BeginChild("CommandPaletteList",ImVec2(width,canvasH*0.3),false,0)) {
bool navigated=false;
if (ImGui::IsKeyPressed(ImGuiKey_UpArrow) && curPaletteChoice>0) {
curPaletteChoice-=1;