Made DIP and QFP package widgets look nicer with the new panels
This commit is contained in:
@@ -99,8 +99,14 @@ QuadFlatPackageWidget::QuadFlatPackageWidget(
|
||||
const auto verticalLayoutWidth = ((verticalPinWidgetWidth + PinWidget::WIDTH_SPACING) * pinCountPerLayout
|
||||
+ PinWidget::PIN_WIDGET_LAYOUT_PADDING - PinWidget::WIDTH_SPACING);
|
||||
|
||||
const auto width = verticalLayoutWidth + (horizontalPinWidgetWidth * 2);
|
||||
/*
|
||||
* + 16 for the spacing between the package body and the pins (8 pixels on each side)
|
||||
*
|
||||
* Also, the width is a little smaller than the height because of the layout of the horizontal pin labels, but
|
||||
* we just use the same value as the height here (to contain and center the widget), as it looks nicer.
|
||||
*/
|
||||
const auto height = horizontalLayoutHeight + (verticalPinWidgetHeight * 2);
|
||||
const auto width = height;
|
||||
|
||||
this->topPinLayout->insertSpacing(0, horizontalPinWidgetWidth);
|
||||
this->topPinLayout->addSpacing(horizontalPinWidgetWidth);
|
||||
@@ -154,6 +160,8 @@ QuadFlatPackageWidget::QuadFlatPackageWidget(
|
||||
pinWidgetLayoutMargin
|
||||
);
|
||||
|
||||
this->setFixedSize(width, height);
|
||||
|
||||
// Set the fixed size and center the widget
|
||||
this->setGeometry(
|
||||
(parent->width() / 2) - (width / 2),
|
||||
|
||||
Reference in New Issue
Block a user