Skip to content

Commit

Permalink
Buttons of Choice-TaskDialog don't take up available space (eugener#67)
Browse files Browse the repository at this point in the history
Back when I did the PRs eugener#53 and eugener#54 , I only thought I had fixed the horizontal growing issue, but since the instruction of the dialog was as long as one of the buttontexts during testing, I probably didn't notice that the actual container that contains the buttons doesn't grow horizontally. This PR will now fix this, I have tested it with miglayout versions 5.0 and 5.2.

And I have fixed the weird indentation of my previous PRs.
  • Loading branch information
Bios-Marcel authored and eugener committed Aug 9, 2019
1 parent c71d807 commit 453123d
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,16 @@ public int choice( final int defaultChoice, List<CommandLink> choices ) {
final List<CommandLinkButton> buttons = new ArrayList<CommandLinkButton>();

CommandLinkButton btn;
final JPanel p = new JPanel(new MigLayout(new LC().flowY().noGrid()));
p.setOpaque(false);
for (final CommandLink link : choices)
{
btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter());
models.add(btn.getModel());
buttons.add(btn);
bGroup.add(btn);
p.add(btn, new CC().growX().gapBottom("8"));
}
final JPanel p = new JPanel(new MigLayout(new LC().flowY().noGrid().fillX()));
p.setOpaque(false);
for (final CommandLink link : choices)
{
btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter());
models.add(btn.getModel());
buttons.add(btn);
bGroup.add(btn);
p.add(btn, new CC().growX().gapBottom("8"));
}

if ( defaultChoice >= 0 && defaultChoice < choices.size()) {
bGroup.setSelected(models.get(defaultChoice), true);
Expand Down

0 comments on commit 453123d

Please sign in to comment.