Make the about dialogs more similar.
[dhcpcd-ui] / src / dhcpcd-qt / dhcpcd-about.cpp
index a25d4c34a36c4eb4964039ee9268f2655753f4f3..d900102e931445a8e96c11b2a894029153bd916a 100644 (file)
  */
 
 #include <QDialog>
+#include <QHBoxLayout>
 #include <QIcon>
 #include <QLabel>
 #include <QPixmap>
 #include <QPushButton>
+#include <QSpacerItem>
 #include <QVBoxLayout>
 
 #include "config.h"
 DhcpcdAbout::DhcpcdAbout(DhcpcdQt *parent)
     : QDialog(parent)
 {
-       QVBoxLayout *layout;
-
        this->parent = parent;
+       QVBoxLayout *layout;
        resize(300, 200);
        setWindowIcon(DhcpcdQt::getIcon("status", "network-transmit-receive"));
        setWindowTitle(tr("About Network Configurator"));
+       QPoint p = QCursor::pos();
+       move(p.x(), p.y());
+
        layout = new QVBoxLayout(this);
 
        QIcon icon = DhcpcdQt::getIcon("status", "network-transmit-receive");
-       QPixmap picon = icon.pixmap(48, 48);
+       QPixmap picon = icon.pixmap(32, 32);
        iconLabel = new QLabel(this);
        iconLabel->setAlignment(Qt::AlignCenter);
        iconLabel->setPixmap(picon);
@@ -71,9 +75,12 @@ DhcpcdAbout::DhcpcdAbout(DhcpcdQt *parent)
        urlLabel->setOpenExternalLinks(true);
        layout->addWidget(urlLabel);
 
-       closeButton = new QPushButton(tr("Close"), this);
+       QHBoxLayout *hbox = new QHBoxLayout();
+       layout->addLayout(hbox);
+       hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding));
+       closeButton = new QPushButton(tr("Close"));
        closeButton->setIcon(QIcon::fromTheme("window-close"));
-       layout->addWidget(closeButton);
+       hbox->addWidget(closeButton);
        connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
 }