diff --git a/src/widgets/atcoreinstancewidget.cpp b/src/widgets/atcoreinstancewidget.cpp --- a/src/widgets/atcoreinstancewidget.cpp +++ b/src/widgets/atcoreinstancewidget.cpp @@ -18,7 +18,9 @@ #include "atcoreinstancewidget.h" #include "ui_atcoreinstancewidget.h" +#include #include +#include #include #include #include @@ -53,25 +55,34 @@ { m_toolBar = new QToolBar(); - auto lb = new QAction; - lb->setIcon(QIcon::fromTheme("go-home", style()->standardIcon(QStyle::SP_DirHomeIcon))); - lb->setDisabled(true); - m_toolBar->addAction(lb); - - auto homeAll = new QAction("All"); + auto homeAll = new QAction(QIcon::fromTheme("go-home", style()->standardIcon(QStyle::SP_DirHomeIcon)),i18n("All")); + homeAll->setToolTip(i18n("Home All")); connect(homeAll, &QAction::triggered, [this]{ m_core.home(); }); - m_toolBar->addAction(homeAll); - for(auto homes : std::map{{"X", AtCore::X}, {"Y", AtCore::Y}, {"Z", AtCore::Z}}) { + auto homeMenu = new QMenu(); + + for(auto homes : std::map{{i18n("Home: X"), AtCore::X}, {i18n("Home: Y"), AtCore::Y}, {i18n("Home: Z"), AtCore::Z}}) { auto home = new QAction(homes.first); + home->setIcon(QIcon::fromTheme("go-home", style()->standardIcon(QStyle::SP_DirHomeIcon))); connect(home, &QAction::triggered, [this, homes] { m_core.home(homes.second); }); - m_toolBar->addAction(home); + homeMenu->addAction(home); } + auto homeBtn = new QToolButton(); + homeBtn->setIcon(QIcon::fromTheme("go-home", style()->standardIcon(QStyle::SP_DirHomeIcon))); + homeBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + homeBtn->setText(i18n("All")); + homeBtn->setMenu(homeMenu); + connect(homeBtn, &QToolButton::clicked, [this]{ + m_core.home(); + }); + + m_toolBar->addWidget(homeBtn); + m_toolBar->addSeparator(); auto *axis = new QAction("Axis");