1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-16 03:44:56 +02:00

gui/GenerateWindow.cpp: Fix horizontal centering of widget's using QGridLayout::setColumnStretch()

This commit is contained in:
Henrik Hautakoski 2020-04-16 13:58:49 +02:00
parent d3e8cc2814
commit 460e8149fd

View file

@ -58,24 +58,27 @@ m_btn_copy_both ("Copy keys")
layout = new QGridLayout();
layout->setAlignment(Qt::AlignCenter);
// Public key row
// Stretch first and last column to make the widgets horizontally centered.
layout->setColumnStretch(0, 1);
layout->setColumnStretch(4, 1);
layout->addWidget(new QLabel("Public:"), 0, 0, Qt::AlignRight);
layout->addWidget(&m_pub, 0, 1);
layout->addWidget(&m_btn_copy_pub, 0, 2);
// Public key row
layout->addWidget(new QLabel("Public:"), 0, 1, Qt::AlignRight);
layout->addWidget(&m_pub, 0, 2);
layout->addWidget(&m_btn_copy_pub, 0, 3);
// Private key row
layout->addWidget(new QLabel("Private:"), 1, 0, Qt::AlignRight);
layout->addWidget(&m_priv, 1, 1);
layout->addWidget(&m_btn_copy_priv, 1, 2);
layout->addWidget(new QLabel("Private:"), 1, 1, Qt::AlignRight);
layout->addWidget(&m_priv, 1, 2);
layout->addWidget(&m_btn_copy_priv, 1, 3);
// Bottom row
m_btn_copy_both.setFixedWidth(80);
layout->addWidget(&m_btn_gen, 2, 1);
layout->addWidget(&m_btn_copy_both, 2, 2);
layout->addWidget(&m_btn_gen, 2, 2);
layout->addWidget(&m_btn_copy_both, 2, 3);
setLayout(layout);