Skip to content

Commit

Permalink
wizard: add space when autocompleting words
Browse files Browse the repository at this point in the history
  • Loading branch information
tobtoht committed Oct 14, 2024
1 parent 2707a26 commit 5acbd9a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/components.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#ifndef FEATHER_COMPONENTS_H
#define FEATHER_COMPONENTS_H

#include <QCompleter>
#include <QPushButton>
#include <QHBoxLayout>
#include <QDialog>
Expand Down Expand Up @@ -117,4 +118,13 @@ class U32Validator : public QValidator {
}
};

class SpaceCompleter : public QCompleter {
protected:
QString pathFromIndex(const QModelIndex &index) const override
{
QString completion = QCompleter::pathFromIndex(index);
return completion + ' ';
}
};

#endif //FEATHER_COMPONENTS_H
2 changes: 1 addition & 1 deletion src/wizard/PageWalletRestoreSeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ void PageWalletRestoreSeed::onOptionsClicked() {
m_fields->showSetRestoreHeightPage = check_overrideCreationDate.isChecked();
m_fields->showSetSeedPassphrasePage = check_setSeedPasshprase.isChecked();
m_fields->showSetSubaddressLookaheadPage = check_subaddressLookahead.isChecked();
}
}
4 changes: 3 additions & 1 deletion src/wizard/PageWalletRestoreSeed.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <QCompleter>
#include <QStringListModel>

#include "components.h"

namespace Ui {
class PageWalletRestoreSeed;
}
Expand Down Expand Up @@ -41,7 +43,7 @@ class PageWalletRestoreSeed : public QWizardPage
int length;
QStringList words;
QStringListModel completerModel;
QCompleter completer;
SpaceCompleter completer;
Seed::Type type;
};

Expand Down

0 comments on commit 5acbd9a

Please sign in to comment.