]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
history: add options button
authortobtoht <tob@featherwallet.org>
Wed, 26 Mar 2025 04:51:46 +0000 (05:51 +0100)
committertobtoht <tob@featherwallet.org>
Wed, 26 Mar 2025 04:51:46 +0000 (05:51 +0100)
src/HistoryWidget.cpp
src/HistoryWidget.ui
src/model/HistoryView.cpp
src/model/HistoryView.h

index 499122935cde9e07dc7e6d74576f6c837f381b72..6f2433b77a9b20d5077d28956b02400178c2b049 100644 (file)
@@ -61,10 +61,12 @@ HistoryWidget::HistoryWidget(Wallet *wallet, QWidget *parent)
     if (!historyViewState.isEmpty()) {
         ui->history->setViewState(historyViewState);
     }
+
+    ui->btn_options->setMenu(ui->history->getMenu());
 }
 
 void HistoryWidget::setSearchbarVisible(bool visible) {
-    ui->search->setVisible(visible);
+    ui->frame_search->setVisible(visible);
 }
 
 void HistoryWidget::focusSearchbar() {
index 27ea48d356b6553a8afe7327c1410b11468ed5ba..5c7b642f89b07da54f79c0ceb013622ad4b09c64 100644 (file)
     <number>0</number>
    </property>
    <item>
-    <widget class="QLineEdit" name="search">
-     <property name="placeholderText">
-      <string>Search txid, description..</string>
+    <widget class="QFrame" name="frame_search">
+     <property name="frameShape">
+      <enum>QFrame::Shape::NoFrame</enum>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Shadow::Plain</enum>
      </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <property name="leftMargin">
+       <number>0</number>
+      </property>
+      <property name="topMargin">
+       <number>0</number>
+      </property>
+      <property name="rightMargin">
+       <number>0</number>
+      </property>
+      <property name="bottomMargin">
+       <number>0</number>
+      </property>
+      <item>
+       <widget class="QLineEdit" name="search">
+        <property name="placeholderText">
+         <string>Search txid, description..</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="btn_options">
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="assets.qrc">
+          <normaloff>:/assets/images/preferences.svg</normaloff>:/assets/images/preferences.svg</iconset>
+        </property>
+        <property name="popupMode">
+         <enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
    <item>
     <widget class="QFrame" name="syncNotice">
      <property name="frameShape">
-      <enum>QFrame::StyledPanel</enum>
+      <enum>QFrame::Shape::StyledPanel</enum>
      </property>
      <property name="frameShadow">
-      <enum>QFrame::Raised</enum>
+      <enum>QFrame::Shadow::Raised</enum>
      </property>
      <layout class="QHBoxLayout" name="horizontalLayout">
       <property name="topMargin">
@@ -58,7 +96,7 @@
       <item>
        <spacer name="horizontalSpacer">
         <property name="orientation">
-         <enum>Qt::Horizontal</enum>
+         <enum>Qt::Orientation::Horizontal</enum>
         </property>
         <property name="sizeHint" stdset="0">
          <size>
    <header>model/HistoryView.h</header>
   </customwidget>
  </customwidgets>
- <resources/>
+ <resources>
+  <include location="assets.qrc"/>
+ </resources>
  <connections/>
 </ui>
index 53bf21b6cf4911446e959cd5b0441f224a2ea6fd..c9820971f8e5bceba19be9bab4d9c57e2840f118 100644 (file)
@@ -75,6 +75,11 @@ TransactionHistoryModel* HistoryView::sourceModel()
     return dynamic_cast<TransactionHistoryModel *>(m_model->sourceModel());
 }
 
+QMenu* HistoryView::getMenu()
+{
+    return m_headerMenu;
+}
+
 void HistoryView::setSearchMode(bool mode) {
     if (!m_inSearchMode) {
         m_showTxidColumn = !header()->isSectionHidden(TransactionHistoryModel::TxID);
index 7775d34d39901f65434f17682c6fbd5fc88045b7..9183726db6d8e3308c3debd207e5f573c0e86fc1 100644 (file)
@@ -25,6 +25,8 @@ public:
     QModelIndex getCurrentIndex();
     TransactionHistoryModel* sourceModel();
 
+    QMenu* getMenu();
+
 private slots:
     void showHeaderMenu(const QPoint& position);
     void toggleColumnVisibility(QAction* action);