From ca641d6530231a6344d44d035553340d65935b38 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 13 Oct 2021 15:55:07 +0200 Subject: [PATCH] Contacts: add contact button --- src/ContactsWidget.cpp | 5 +++++ src/ContactsWidget.h | 2 ++ src/ContactsWidget.ui | 24 +++++++++++++++++------- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/ContactsWidget.cpp b/src/ContactsWidget.cpp index c43a4b6..0442661 100644 --- a/src/ContactsWidget.cpp +++ b/src/ContactsWidget.cpp @@ -18,6 +18,11 @@ ContactsWidget::ContactsWidget(QSharedPointer ctx, QWidget *parent) { ui->setupUi(this); + m_btn_addContact = new QPushButton(this); + m_btn_addContact->setIcon(icons()->icon("localMonero_register.svg")); + ui->searchLayout->addWidget(m_btn_addContact, 0, Qt::AlignRight); + connect(m_btn_addContact, &QPushButton::clicked, [this]{this->newContact();}); + m_model = m_ctx->wallet->addressBookModel(); m_proxyModel = new AddressBookProxyModel; m_proxyModel->setSourceModel(m_model); diff --git a/src/ContactsWidget.h b/src/ContactsWidget.h index e800a0e..9a71fa9 100644 --- a/src/ContactsWidget.h +++ b/src/ContactsWidget.h @@ -4,6 +4,7 @@ #ifndef FEATHER_CONTACTSWIDGET_H #define FEATHER_CONTACTSWIDGET_H +#include #include #include @@ -51,6 +52,7 @@ private: QMenu *m_headerMenu; AddressBookModel * m_model; AddressBookProxyModel * m_proxyModel; + QPushButton *m_btn_addContact; }; #endif // FEATHER_CONTACTSWIDGET_H diff --git a/src/ContactsWidget.ui b/src/ContactsWidget.ui index 69151e6..8281279 100644 --- a/src/ContactsWidget.ui +++ b/src/ContactsWidget.ui @@ -6,8 +6,8 @@ 0 0 - 589 - 416 + 914 + 763 @@ -30,14 +30,24 @@ 0 - - - Search contacts... - - + + + + + Search contacts... + + + + + + + 0 + 0 + + false