mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
Add command to show the brushes popup
This commit is contained in:
parent
264c59bbc1
commit
c7c049028b
@ -164,9 +164,10 @@ unlink = &Unlink
|
||||
link_cels = &Link Cels
|
||||
|
||||
[commands]
|
||||
ShowPaletteSortOptions = Show Palette Sort Options
|
||||
ShowPalettePresets = Show Palette Presets
|
||||
ShowBrushes = Show Brushes
|
||||
ShowPaletteOptions = Show Palette Options
|
||||
ShowPalettePresets = Show Palette Presets
|
||||
ShowPaletteSortOptions = Show Palette Sort Options
|
||||
|
||||
[document_tab_popup_menu]
|
||||
duplicate_view = Duplicate &View
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "app/app_menus.h"
|
||||
#include "app/color_utils.h"
|
||||
#include "app/commands/commands.h"
|
||||
#include "app/commands/quick_command.h"
|
||||
#include "app/document.h"
|
||||
#include "app/ini_file.h"
|
||||
#include "app/modules/gfx.h"
|
||||
@ -165,7 +166,12 @@ public:
|
||||
m_popupWindow.setupTooltips(tooltipManager);
|
||||
}
|
||||
|
||||
void showPopup() {
|
||||
openPopup();
|
||||
}
|
||||
|
||||
void showPopupAndHighlightSlot(int slot) {
|
||||
// TODO use slot?
|
||||
openPopup();
|
||||
}
|
||||
|
||||
@ -1468,6 +1474,7 @@ ContextBar::ContextBar()
|
||||
setActiveBrush(createBrushFromPreferences());
|
||||
|
||||
initTheme();
|
||||
registerCommands();
|
||||
}
|
||||
|
||||
ContextBar::~ContextBar()
|
||||
@ -2066,4 +2073,18 @@ void ContextBar::setupTooltips(TooltipManager* tooltipManager)
|
||||
m_symmetry->setupTooltips(tooltipManager);
|
||||
}
|
||||
|
||||
void ContextBar::registerCommands()
|
||||
{
|
||||
Commands::instance()
|
||||
->add(
|
||||
new QuickCommand(
|
||||
"ShowBrushes",
|
||||
[this]{ this->showBrushes(); }));
|
||||
}
|
||||
|
||||
void ContextBar::showBrushes()
|
||||
{
|
||||
m_brushType->showPopup();
|
||||
}
|
||||
|
||||
} // namespace app
|
||||
|
@ -104,6 +104,8 @@ namespace app {
|
||||
void onActiveToolChange(tools::Tool* tool) override;
|
||||
|
||||
void setupTooltips(ui::TooltipManager* tooltipManager);
|
||||
void registerCommands();
|
||||
void showBrushes();
|
||||
|
||||
class ZoomButtons;
|
||||
class BrushBackField;
|
||||
|
Loading…
Reference in New Issue
Block a user