|
10 | 10 | #endif
|
11 | 11 |
|
12 | 12 | #include "app/app.h"
|
| 13 | +#include "app/app_menus.h" |
13 | 14 | #include "app/commands/commands.h"
|
14 | 15 | #include "app/commands/params.h"
|
15 | 16 | #include "app/context_access.h"
|
@@ -694,13 +695,19 @@ StatusBar::StatusBar(TooltipManager* tooltipManager)
|
694 | 695 |
|
695 | 696 | // Construct the commands box
|
696 | 697 | {
|
| 698 | + auto theme = SkinTheme::get(this); |
697 | 699 | Box* box1 = new Box(HORIZONTAL);
|
698 | 700 | Box* box4 = new Box(HORIZONTAL);
|
699 | 701 |
|
700 | 702 | m_frameLabel = new Label(Strings::statusbar_tips_frame());
|
701 | 703 | m_currentFrame = new GotoFrameEntry();
|
702 |
| - m_newFrame = new Button("+"); |
703 |
| - m_newFrame->Click.connect([this]{ newFrame(); }); |
| 704 | + m_newFrame = new Button(""); |
| 705 | + if (!theme->parts.iconAdd()) |
| 706 | + m_newFrame->setText("+"); // Fallback for themes without the icon. |
| 707 | + |
| 708 | + m_newFrame->Click.connect(&StatusBar::newFrame, this); |
| 709 | + m_newFrame->RightClick.connect(&StatusBar::showNewFramePopupMenu, this); |
| 710 | + |
704 | 711 | m_zoomEntry = new ZoomEntry;
|
705 | 712 | m_zoomEntry->ZoomChange.connect(&StatusBar::onChangeZoom, this);
|
706 | 713 |
|
@@ -922,7 +929,7 @@ void StatusBar::onInitTheme(ui::InitThemeEvent& ev)
|
922 | 929 | textHeight()+8*guiscale()));
|
923 | 930 |
|
924 | 931 | m_newFrame->setStyle(theme->styles.newFrameButton());
|
925 |
| - m_commandsBox->setBorder(gfx::Border(2, 1, 2, 2)*guiscale()); |
| 932 | + m_commandsBox->setBorder(gfx::Border(2, 2, 2, 2)*guiscale()); |
926 | 933 |
|
927 | 934 | if (m_snapToGridWindow) {
|
928 | 935 | m_snapToGridWindow->initTheme();
|
@@ -996,6 +1003,11 @@ void StatusBar::newFrame()
|
996 | 1003 | UIContext::instance()->executeCommandFromMenuOrShortcut(cmd);
|
997 | 1004 | }
|
998 | 1005 |
|
| 1006 | +void StatusBar::showNewFramePopupMenu() |
| 1007 | +{ |
| 1008 | + AppMenus::instance()->getNewFrameMenu()->showPopup(mousePosInDisplay(), display()); |
| 1009 | +} |
| 1010 | + |
999 | 1011 | void StatusBar::onChangeZoom(const render::Zoom& zoom)
|
1000 | 1012 | {
|
1001 | 1013 | if (auto editor = Editor::activeEditor())
|
|
0 commit comments