diff options
author | Ash <101582426+ashuntu@users.noreply.github.com> | 2023-07-28 21:22:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 21:22:35 +0000 |
commit | d133b40b254630f988c57c1111e4659023324edc (patch) | |
tree | 96217214a39945ef04e0d191d960481825ac65da /launcher/ui/widgets/WideBar.cpp | |
parent | 51d7a6289e1cf2df463ae8d7c0b08b4a61faea3c (diff) | |
parent | bdec11c501a6438706f62465d89f2344f7856342 (diff) | |
download | PrismLauncher-d133b40b254630f988c57c1111e4659023324edc.tar.gz PrismLauncher-d133b40b254630f988c57c1111e4659023324edc.tar.bz2 PrismLauncher-d133b40b254630f988c57c1111e4659023324edc.zip |
Merge branch 'PrismLauncher:develop' into develop
Diffstat (limited to 'launcher/ui/widgets/WideBar.cpp')
-rw-r--r-- | launcher/ui/widgets/WideBar.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/launcher/ui/widgets/WideBar.cpp b/launcher/ui/widgets/WideBar.cpp index ac34e3aa..a77c45fe 100644 --- a/launcher/ui/widgets/WideBar.cpp +++ b/launcher/ui/widgets/WideBar.cpp @@ -116,12 +116,21 @@ void WideBar::insertActionAfter(QAction* after, QAction* action) if (iter == m_entries.end()) return; + iter++; + // the action to insert after is present + // however, the element after it isn't valid + if (iter == m_entries.end()) { + // append the action instead of inserting it + addAction(action); + return; + } + BarEntry entry; - entry.bar_action = insertWidget((iter + 1)->bar_action, new ActionButton(action, this, m_use_default_action)); + entry.bar_action = insertWidget(iter->bar_action, new ActionButton(action, this, m_use_default_action)); entry.menu_action = action; entry.type = BarEntry::Type::Action; - m_entries.insert(iter + 1, entry); + m_entries.insert(iter, entry); m_menu_state = MenuState::Dirty; } |