fix(widebar): fix insertSeparator

WideBar::insertSeparator was adding the separator to the end of the toolbar

Signed-off-by: leo78913 <leo3758@riseup.net>
This commit is contained in:
leo78913 2023-01-09 00:51:46 -03:00
parent b2de01b076
commit ada595663d
2 changed files with 5 additions and 1 deletions

View File

@ -166,6 +166,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
connect(renameButton, &QToolButton::clicked, this, &MainWindow::on_actionRenameInstance_triggered); connect(renameButton, &QToolButton::clicked, this, &MainWindow::on_actionRenameInstance_triggered);
ui->instanceToolBar->insertWidgetBefore(ui->actionLaunchInstance, renameButton); ui->instanceToolBar->insertWidgetBefore(ui->actionLaunchInstance, renameButton);
ui->instanceToolBar->insertSeparator(ui->actionLaunchInstance);
// restore the instance toolbar settings // restore the instance toolbar settings
auto const setting_name = QString("WideBarVisibility_%1").arg(ui->instanceToolBar->objectName()); auto const setting_name = QString("WideBarVisibility_%1").arg(ui->instanceToolBar->objectName());
if (!APPLICATION->settings()->contains(setting_name)) if (!APPLICATION->settings()->contains(setting_name))

View File

@ -158,7 +158,9 @@ void WideBar::insertSeparator(QAction* before)
return; return;
BarEntry entry; BarEntry entry;
entry.bar_action = QToolBar::insertSeparator(before); entry.bar_action = new QAction("", this);
entry.bar_action->setSeparator(true);
insertAction(iter->bar_action, entry.bar_action);
entry.type = BarEntry::Type::Separator; entry.type = BarEntry::Type::Separator;
m_entries.insert(iter, entry); m_entries.insert(iter, entry);