]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Send: focus amount field on fill
authortobtoht <thotbot@protonmail.com>
Fri, 2 Jul 2021 16:01:11 +0000 (18:01 +0200)
committertobtoht <thotbot@protonmail.com>
Fri, 2 Jul 2021 16:01:11 +0000 (18:01 +0200)
src/MainWindow.cpp
src/SendWidget.cpp
src/SendWidget.h

index 703443cedff97e79ab15729a6adbcf9a3bf3f4c0..920a318e600217d93a582867c2b635ea235d84e9 100644 (file)
@@ -885,8 +885,8 @@ void MainWindow::payToMany() {
                                                   "A maximum of 16 addresses may be specified.");
 }
 
-void MainWindow::showSendScreen(const CCSEntry &entry) {
-    m_sendWidget->fill(entry);
+void MainWindow::showSendScreen(const CCSEntry &entry) { // TODO: rename this function
+    m_sendWidget->fill(entry.address, QString("CCS: %1").arg(entry.title));
     ui->tabWidget->setCurrentIndex(Tabs::SEND);
 }
 
index 32dbda01a4d3157fe6e2b961ddbd07e8adbb8c2f..1d24138b65c624e4a2ea5608fdefd13581ad727a 100644 (file)
@@ -87,22 +87,20 @@ void SendWidget::amountEdited(const QString &text) {
     this->updateConversionLabel();
 }
 
-void SendWidget::fill(const CCSEntry &entry) {
-    this->fill(entry.address, QString("CCS: %1").arg(entry.title), 0.0);
-}
-
 void SendWidget::fill(double amount) {
     ui->lineAmount->setText(QString::number(amount));
 }
 
 void SendWidget::fill(const QString &address, const QString &description, double amount) {
-    ui->lineDescription->setText(description);
     ui->lineAddress->setText(address);
-
     ui->lineAddress->moveCursor(QTextCursor::Start);
 
+    ui->lineDescription->setText(description);
+
     if (amount > 0)
         ui->lineAmount->setText(QString::number(amount));
+    ui->lineAmount->setFocus();
+
     this->updateConversionLabel();
 }
 
index 3f340fce7ef05047daa42cb373638a210ea67514..7826318146c4791285f5888c440b6c661ef04176 100644 (file)
@@ -19,8 +19,7 @@ Q_OBJECT
 
 public:
     explicit SendWidget(QSharedPointer<AppContext> ctx, QWidget *parent = nullptr);
-    void fill(const CCSEntry &entry);
-    void fill(const QString &address, const QString& description, double amount = 0);
+    void fill(const QString &address, const QString &description, double amount = 0);
     void fill(double amount);
     void clearFields();
     void payToMany();