mirror of
https://github.com/feather-wallet/feather.git
synced 2025-04-24 05:08:12 +00:00
menu: make view tabs checkable
This commit is contained in:
parent
19b78b9c70
commit
d68e327178
2 changed files with 17 additions and 6 deletions
|
@ -356,7 +356,7 @@ void MainWindow::initMenu() {
|
|||
continue;
|
||||
}
|
||||
|
||||
auto* pluginAction = new QAction(QString("Show %1").arg(plugin->displayName()), this);
|
||||
auto* pluginAction = new QAction(plugin->displayName(), this);
|
||||
ui->menuView->insertAction(plugin->insertFirst() ? ui->actionPlaceholderBegin : ui->actionPlaceholderEnd, pluginAction);
|
||||
connect(pluginAction, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
|
||||
m_tabShowHideMapper[plugin->displayName()] = new ToggleTab(plugin->tab(), plugin->displayName(), plugin->displayName(), pluginAction, this);
|
||||
|
@ -370,7 +370,9 @@ void MainWindow::initMenu() {
|
|||
const auto toggleTab = m_tabShowHideMapper.value(key);
|
||||
bool show = enabledTabs.contains(key);
|
||||
|
||||
toggleTab->menuAction->setText((show ? QString("Hide ") : QString("Show ")) + toggleTab->name);
|
||||
toggleTab->menuAction->setText(toggleTab->name);
|
||||
toggleTab->menuAction->setCheckable(true);
|
||||
toggleTab->menuAction->setChecked(show);
|
||||
ui->tabWidget->setTabVisible(ui->tabWidget->indexOf(toggleTab->tab), show);
|
||||
}
|
||||
connect(m_tabShowHideSignalMapper, &QSignalMapper::mappedString, this, &MainWindow::menuToggleTabVisible);
|
||||
|
@ -539,7 +541,7 @@ void MainWindow::menuToggleTabVisible(const QString &key){
|
|||
|
||||
conf()->set(Config::enabledTabs, enabledTabs);
|
||||
ui->tabWidget->setTabVisible(ui->tabWidget->indexOf(toggleTab->tab), show);
|
||||
toggleTab->menuAction->setText((show ? QString("Hide ") : QString("Show ")) + toggleTab->name);
|
||||
toggleTab->menuAction->setText(toggleTab->name);
|
||||
}
|
||||
|
||||
void MainWindow::menuClearHistoryClicked() {
|
||||
|
|
|
@ -690,8 +690,11 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionShow_Coins">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show Coins</string>
|
||||
<string>Coins</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionShow_xmr_to">
|
||||
|
@ -985,13 +988,19 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionShow_Contacts">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show Contacts</string>
|
||||
<string>Contacts</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionShow_Notes">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show Notes</string>
|
||||
<string>Notes</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
|
Loading…
Reference in a new issue