From 2de965769f02d91dfd56d75b6576da71eff80154 Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Mon, 30 Jan 2023 11:15:32 +0100
Subject: [PATCH] Fix port width

---
 b_asic/GUI/_preferences.py | 2 +-
 b_asic/GUI/drag_button.py  | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/b_asic/GUI/_preferences.py b/b_asic/GUI/_preferences.py
index 8ec13464..d899e771 100644
--- a/b_asic/GUI/_preferences.py
+++ b/b_asic/GUI/_preferences.py
@@ -5,7 +5,7 @@ from b_asic._preferences import SIGNAL_COLOR
 # Buttons/operations/ports
 MINBUTTONSIZE = 57
 PORTHEIGHT = 19
-PORTWIDTH = 15
+PORTWIDTH = 19
 GAP = MINBUTTONSIZE - 2 * PORTHEIGHT
 
 # Window
diff --git a/b_asic/GUI/drag_button.py b/b_asic/GUI/drag_button.py
index 09184d17..a07f0e79 100644
--- a/b_asic/GUI/drag_button.py
+++ b/b_asic/GUI/drag_button.py
@@ -249,12 +249,14 @@ class DragButton(QPushButton):
         input_ports_dist = _determine_port_distance(height, op.input_count)
         for i, dist in enumerate(input_ports_dist):
             port = PortButton(">", self, op.input(i), self._window)
-            self.ports.append(port)
+            port.setFixedSize(PORTWIDTH, PORTHEIGHT)
             port.move(0, dist)
             port.show()
+            self.ports.append(port)
 
         for i, dist in enumerate(output_ports_dist):
             port = PortButton(">", self, op.output(i), self._window)
-            self.ports.append(port)
+            port.setFixedSize(PORTWIDTH, PORTHEIGHT)
             port.move(MINBUTTONSIZE - PORTWIDTH, dist)
             port.show()
+            self.ports.append(port)
-- 
GitLab