mainsail-crew / mainsail

Mainsail is the popular web interface for managing and controlling 3D printers with Klipper.
https://docs.mainsail.xyz
GNU General Public License v3.0
1.68k stars 349 forks source link

Prompt Buttons Spacing Incorrect When Not Grouped #1960

Open spooknik opened 1 month ago

spooknik commented 1 month ago

Mainsail Version:

v2.12.0

Browser:

Firefox

Device:

Desktop PC

Operating System:

Windows

What happened?

When writing macros with prompts, I discovered if you do not group more than 4 buttons, they get smushed together. If you group them it looks okay.

grouped not-grouped

What did you expect to happen instead?

Buttons should have correct spacing when not grouped.

How to reproduce this bug?

Run this prompt and the buttons will be smushed together.

[gcode_macro LOAD_PROMPT_SMUSHED]
gcode:
    RESPOND TYPE=command MSG="action:prompt_begin You loaded filament"
    RESPOND TYPE=command MSG="action:prompt_text Which material are you loading?"
    RESPOND TYPE=command MSG="action:prompt_button_group_start"
    RESPOND TYPE=command MSG="action:prompt_button ABS|ASB_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button ASA|ASA_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PETG|PETG_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PLA|PLA_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button Flex|FLEX_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PC|PC_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PA (Nylon)|PA_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button_group_end"
    RESPOND TYPE=command MSG="action:prompt_show"

However, grouping the buttons, looks correct.

[gcode_macro LOAD_PROMPT]
gcode:
    RESPOND TYPE=command MSG="action:prompt_begin You loaded filament"
    RESPOND TYPE=command MSG="action:prompt_text Which material are you loading?"
    RESPOND TYPE=command MSG="action:prompt_button_group_start"
    RESPOND TYPE=command MSG="action:prompt_button ABS|ASB_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button ASA|ASA_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PETG|PETG_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PLA|PLA_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button_group_end"
    RESPOND TYPE=command MSG="action:prompt_button_group_start"
    RESPOND TYPE=command MSG="action:prompt_button Flex|FLEX_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PC|PC_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button PA (Nylon)|PA_LOAD"
    RESPOND TYPE=command MSG="action:prompt_button_group_end"
    RESPOND TYPE=command MSG="action:prompt_show"

Additional information:

No response