]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Contacts: add contact button
authortobtoht <thotbot@protonmail.com>
Wed, 13 Oct 2021 13:55:07 +0000 (15:55 +0200)
committertobtoht <thotbot@protonmail.com>
Wed, 13 Oct 2021 13:55:07 +0000 (15:55 +0200)
src/ContactsWidget.cpp
src/ContactsWidget.h
src/ContactsWidget.ui

index c43a4b620c2d15239764bf55863a02e1dd90d4ce..0442661591f260487389cd62b5da62b1c814098b 100644 (file)
@@ -18,6 +18,11 @@ ContactsWidget::ContactsWidget(QSharedPointer<AppContext> 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);
index e800a0ea73016452d17c8e00db0de63e5b312252..9a71fa92447a78f97774bcf7f66f9e9bf3e6f6cf 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef FEATHER_CONTACTSWIDGET_H
 #define FEATHER_CONTACTSWIDGET_H
 
+#include <QPushButton>
 #include <QWidget>
 #include <QMenu>
 
@@ -51,6 +52,7 @@ private:
     QMenu *m_headerMenu;
     AddressBookModel * m_model;
     AddressBookProxyModel * m_proxyModel;
+    QPushButton *m_btn_addContact;
 };
 
 #endif // FEATHER_CONTACTSWIDGET_H
index 69151e6470dae3f79a840b4e64acfdbb875dc500..8281279d9d3af4ee0e6b8a21f696c671c9a767ec 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>589</width>
-    <height>416</height>
+    <width>914</width>
+    <height>763</height>
    </rect>
   </property>
   <property name="windowTitle">
     <number>0</number>
    </property>
    <item>
-    <widget class="QLineEdit" name="search">
-     <property name="placeholderText">
-      <string>Search contacts...</string>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="searchLayout">
+     <item>
+      <widget class="QLineEdit" name="search">
+       <property name="placeholderText">
+        <string>Search contacts...</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item>
     <widget class="QTreeView" name="contacts">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="rootIsDecorated">
       <bool>false</bool>
      </property>