Merge pull request #1048 from YohananDiamond/dialog-nitpicks

New song dialog: auto focus on pop up + reset search box
This commit is contained in:
tildearrow 2023-04-12 02:09:17 -05:00 committed by GitHub
commit ea172ea6ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -4948,6 +4948,8 @@ bool FurnaceGUI::loop() {
}
if (displayNew) {
newSongQuery="";
newSongFirstFrame=true;
displayNew=false;
ImGui::OpenPopup("New Song");
}

View file

@ -1565,6 +1565,7 @@ class FurnaceGUI {
double exportFadeOut;
bool newSongFirstFrame;
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
bool mixerOpen, debugOpen, inspectorOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen;

View file

@ -34,6 +34,8 @@ void FurnaceGUI::drawNewSong() {
avail.y-=ImGui::GetFrameHeightWithSpacing();
if (ImGui::BeginChild("sysPickerC",avail,false,ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoScrollbar)) {
if (newSongFirstFrame)
ImGui::SetKeyboardFocusHere();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (ImGui::InputTextWithHint("##SysSearch","Search...",&newSongQuery)) {
String lowerCase=newSongQuery;
@ -159,4 +161,6 @@ void FurnaceGUI::drawNewSong() {
updateWindowTitle();
ImGui::CloseCurrentPopup();
}
newSongFirstFrame=false;
}