Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions qml/pages/node/CommandConsole.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Page {
property string commandDraft: ""
property string searchDraft: ""

// True while this view's tab is the selected one. As a persistent StackLayout
// child, the console is never destroyed on tab changes, and its autocomplete
// Popup renders in the window overlay layer, so it is not hidden along with
// the view. The embedder binds this to its tab's checked state; when the tab
// is left, dismiss the popup so it cannot linger over the newly selected tab.
property bool tabActive: true
onTabActiveChanged: if (!tabActive) autocompletePopup.close()

function _pushPalette() {
rpcConsoleModel.requestColor = consoleRequestColor
rpcConsoleModel.replyColor = consoleReplyColor
Expand Down
1 change: 1 addition & 0 deletions qml/pages/wallet/DesktopWallets.qml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ Page {
}
CommandConsole {
showHeader: false
tabActive: consoleTabButton.checked
walletName: walletController.isWalletLoaded && walletController.selectedWallet
? walletController.selectedWallet.name
: ""
Expand Down
20 changes: 20 additions & 0 deletions test/qml/tst_desktopwallets.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ TestCase {
compare(tabs[3].iconSize, 30)
}

function test_console_autocomplete_closes_when_switching_tabs() {
const page = createDesktopWallets()
const consoleTab = findChild(page, "consoleTabButton")
const activityTab = findChild(page, "activityTabButton")
const popup = findChild(page, "consoleAutocompletePopup")

verify(consoleTab !== null)
verify(activityTab !== null)
verify(popup !== null)

consoleTab.checked = true
tryCompare(consoleTab, "checked", true)
popup.open()
tryCompare(popup, "visible", true)

activityTab.checked = true
tryCompare(activityTab, "checked", true)
tryCompare(popup, "visible", false)
}

function test_receive_options_view_address_history_opens_settings_address_stack() {
const page = createDesktopWallets()
const receiveTab = findChild(page, "receiveTabButton")
Expand Down
Loading