Skip to content

Commit

Permalink
PointFileChooser layout and behaviour tweaks
Browse files Browse the repository at this point in the history
Fit() the dialog to avoid wasted space. Return without showing the point trace
if the Cancel button is clicked.
  • Loading branch information
Matthew Mott committed May 25, 2021
1 parent 01cd735 commit 5fbe4ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions radiant/ui/PointFileChooser.cpp
Expand Up @@ -28,7 +28,9 @@ PointFileChooser::PointFileChooser(const wxArrayString& files)

// Add dialog buttons
auto btnSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL);
GetSizer()->Add(btnSizer, 0, wxALIGN_RIGHT | wxALIGN_BOTTOM, 0);
GetSizer()->Add(btnSizer, 0, wxALIGN_RIGHT | wxALIGN_BOTTOM | wxBOTTOM, 12);

Fit();
}

void PointFileChooser::chooseAndToggle()
Expand All @@ -50,7 +52,11 @@ void PointFileChooser::chooseAndToggle()

// Show dialog with list of pointfiles
PointFileChooser chooser(filenames);
chooser.ShowModal();
if (chooser.ShowModal() != wxID_OK)
{
// Dialog cancelled, don't proceed to showing point trace
return;
}
}

// Hand over to the actual pointfile renderer to toggle visibility
Expand Down

0 comments on commit 5fbe4ee

Please sign in to comment.