Skip to content

Commit

Permalink
fix(widebar): fix insertSeparator
Browse files Browse the repository at this point in the history
WideBar::insertSeparator was adding the separator to the end of the toolbar

Signed-off-by: leo78913 <leo3758@riseup.net>
  • Loading branch information
leia-uwu committed Jan 9, 2023
1 parent 57f4a4a commit b2d4803
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions launcher/ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
connect(renameButton, &QToolButton::clicked, this, &MainWindow::on_actionRenameInstance_triggered);
ui->instanceToolBar->insertWidgetBefore(ui->actionLaunchInstance, renameButton);

ui->instanceToolBar->insertSeparator(ui->actionLaunchInstance);

// restore the instance toolbar settings
auto const setting_name = QString("WideBarVisibility_%1").arg(ui->instanceToolBar->objectName());
if (!APPLICATION->settings()->contains(setting_name))
Expand Down
4 changes: 3 additions & 1 deletion launcher/ui/widgets/WideBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ void WideBar::insertSeparator(QAction* before)
return;

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;

m_entries.insert(iter, entry);
Expand Down

0 comments on commit b2d4803

Please sign in to comment.