fix: horizontal toolbar layout + fix component button placement

Redesign toolbar sections to use horizontal button rows instead of
vertical stacking. Fix component placement by attaching click handlers
directly to dynamically created buttons and passing correct gate object
shape to getComponentWidth/Height.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jose Luis
2026-03-20 03:06:23 +01:00
parent 268013d053
commit 53d600fcb0
4 changed files with 61 additions and 39 deletions

View File

@@ -13,9 +13,11 @@
<!-- I/O Section -->
<div class="toolbar-section">
<div class="section-label">I/O</div>
<button class="gate-btn input-btn" data-gate="INPUT">INPUT</button>
<button class="gate-btn clock-btn" data-gate="CLOCK">CLOCK</button>
<button class="gate-btn output-btn" data-gate="OUTPUT">OUTPUT</button>
<div class="section-buttons">
<button class="gate-btn input-btn" data-gate="INPUT">INPUT</button>
<button class="gate-btn clock-btn" data-gate="CLOCK">CLOCK</button>
<button class="gate-btn output-btn" data-gate="OUTPUT">OUTPUT</button>
</div>
</div>
<div class="separator"></div>
@@ -23,12 +25,14 @@
<!-- Gates Section -->
<div class="toolbar-section">
<div class="section-label">Gates</div>
<button class="gate-btn" data-gate="AND">AND</button>
<button class="gate-btn" data-gate="OR">OR</button>
<button class="gate-btn" data-gate="NOT">NOT</button>
<button class="gate-btn" data-gate="NAND">NAND</button>
<button class="gate-btn" data-gate="NOR">NOR</button>
<button class="gate-btn" data-gate="XOR">XOR</button>
<div class="section-buttons">
<button class="gate-btn" data-gate="AND">AND</button>
<button class="gate-btn" data-gate="OR">OR</button>
<button class="gate-btn" data-gate="NOT">NOT</button>
<button class="gate-btn" data-gate="NAND">NAND</button>
<button class="gate-btn" data-gate="NOR">NOR</button>
<button class="gate-btn" data-gate="XOR">XOR</button>
</div>
</div>
<div class="separator"></div>
@@ -36,8 +40,10 @@
<!-- Components Section -->
<div class="toolbar-section" id="components-section">
<div class="section-label">Components</div>
<button class="gate-btn create-component-btn" id="create-component-btn" title="Create custom component">✚ Create</button>
<div id="saved-components"></div>
<div class="section-buttons">
<button class="create-component-btn" id="create-component-btn" title="Create custom component">✚ Create</button>
<div id="saved-components"></div>
</div>
</div>
<div class="separator"></div>