mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 06:50:07 +00:00
Fix duplicate shortcut key configuration items in Keyboard shortcuts Window (fix #4387)
This commit is contained in:
parent
5458dbf755
commit
68df0aaca4
@ -538,7 +538,7 @@
|
|||||||
</key>
|
</key>
|
||||||
<key command="ChangePixelFormat">
|
<key command="ChangePixelFormat">
|
||||||
<param name="format" value="indexed" />
|
<param name="format" value="indexed" />
|
||||||
<param name="dithering" value="old-ordered" />
|
<param name="dithering" value="old" />
|
||||||
</key>
|
</key>
|
||||||
<key command="ChangeBrush">
|
<key command="ChangeBrush">
|
||||||
<param name="change" value="increment-angle" />
|
<param name="change" value="increment-angle" />
|
||||||
|
@ -279,6 +279,8 @@ Flip_Canvas = Canvas
|
|||||||
Flip_Horizontally = Horizontally
|
Flip_Horizontally = Horizontally
|
||||||
Flip_Selection = Selection
|
Flip_Selection = Selection
|
||||||
Flip_Vertically = Vertically
|
Flip_Vertically = Vertically
|
||||||
|
FrameProperties_All = Frame Properties of all frames
|
||||||
|
FrameProperties_Current = Frame Properties of the current range
|
||||||
FrameProperties = Frame Properties
|
FrameProperties = Frame Properties
|
||||||
FrameTagProperties = Tag Properties
|
FrameTagProperties = Tag Properties
|
||||||
FullscreenMode = Toggle Fullscreen Mode
|
FullscreenMode = Toggle Fullscreen Mode
|
||||||
@ -312,6 +314,7 @@ LayerVisibility = Layer Visibility
|
|||||||
LinkCels = Links Cels
|
LinkCels = Links Cels
|
||||||
LoadMask = Load Selection
|
LoadMask = Load Selection
|
||||||
LoadPalette = Load Palette
|
LoadPalette = Load Palette
|
||||||
|
LoadDefaultPalette = Load Default Palette
|
||||||
MaskAll = Mask All
|
MaskAll = Mask All
|
||||||
MaskByColor = Mask By Color
|
MaskByColor = Mask By Color
|
||||||
MaskContent = Mask Content
|
MaskContent = Mask Content
|
||||||
@ -403,6 +406,8 @@ SaveFileAs = Save File As
|
|||||||
SaveFileCopyAs = Export
|
SaveFileCopyAs = Export
|
||||||
SaveMask = Save Selection
|
SaveMask = Save Selection
|
||||||
SavePalette = Save Palette
|
SavePalette = Save Palette
|
||||||
|
SavePaletteAsDefault = Save Palette as Default
|
||||||
|
SavePaletteAsPreset = Save Palette as Preset
|
||||||
Screenshot = Screenshot
|
Screenshot = Screenshot
|
||||||
Screenshot_Open = Take & Open Screenshot
|
Screenshot_Open = Take & Open Screenshot
|
||||||
Screenshot_Save = Take & Save Screenshot
|
Screenshot_Save = Take & Save Screenshot
|
||||||
|
@ -482,9 +482,6 @@ protected:
|
|||||||
bool onChecked(Context* context) override;
|
bool onChecked(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
|
||||||
return m_format == IMAGE_INDEXED && params.size() > 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_showDlg;
|
bool m_showDlg;
|
||||||
|
@ -64,8 +64,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool onEnabled(Context* context) override;
|
bool onEnabled(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
return !params.empty();
|
return params.empty();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace app {
|
|||||||
bool onEnabled(Context* context) override;
|
bool onEnabled(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
return !params.empty();
|
return !params.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,10 +37,7 @@ protected:
|
|||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
bool onEnabled(Context* context) override;
|
bool onEnabled(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
std::string onGetFriendlyName() const override;
|
||||||
return !params.empty() &&
|
|
||||||
strcmp(params.begin()->second.c_str(), "all") == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum Target {
|
enum Target {
|
||||||
@ -143,6 +140,17 @@ void FramePropertiesCommand::onExecute(Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string FramePropertiesCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
switch (m_target) {
|
||||||
|
case CURRENT_RANGE:
|
||||||
|
return Strings::commands_FrameProperties_Current() ;
|
||||||
|
case ALL_FRAMES:
|
||||||
|
return Strings::commands_FrameProperties_All();
|
||||||
|
}
|
||||||
|
return Command::onGetFriendlyName();
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createFramePropertiesCommand()
|
Command* CommandFactory::createFramePropertiesCommand()
|
||||||
{
|
{
|
||||||
return new FramePropertiesCommand;
|
return new FramePropertiesCommand;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019-2022 Igara Studio S.A.
|
// Copyright (C) 2019-2024 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -87,6 +87,9 @@ protected:
|
|||||||
|
|
||||||
return (frame > 0 ? frame-1: last);
|
return (frame > 0 ? frame-1: last);
|
||||||
}
|
}
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
|
return context == KeyContext::Normal;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class GotoNextFrameCommand : public GotoCommand {
|
class GotoNextFrameCommand : public GotoCommand {
|
||||||
@ -100,9 +103,8 @@ protected:
|
|||||||
|
|
||||||
return (frame < last ? frame+1: 0);
|
return (frame < last ? frame+1: 0);
|
||||||
}
|
}
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
const bool isSkipListing(const Params& params) const override {
|
return context == KeyContext::Normal;
|
||||||
return params.empty();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -607,7 +607,7 @@ private:
|
|||||||
key->type() == KeyType::Quicktool ||
|
key->type() == KeyType::Quicktool ||
|
||||||
key->type() == KeyType::WheelAction ||
|
key->type() == KeyType::WheelAction ||
|
||||||
key->type() == KeyType::DragAction ||
|
key->type() == KeyType::DragAction ||
|
||||||
key->isSkipListing()) {
|
key->isListed()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,11 +20,14 @@ namespace app {
|
|||||||
class LaunchCommand : public Command {
|
class LaunchCommand : public Command {
|
||||||
public:
|
public:
|
||||||
LaunchCommand();
|
LaunchCommand();
|
||||||
const bool isSkipListing(const Params& params) const override { return true; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
|
std::string onGetFriendlyName() const override;
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
|
return params.get("path") != "";
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum Type { Url };
|
enum Type { Url };
|
||||||
@ -60,6 +63,11 @@ void LaunchCommand::onExecute(Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string LaunchCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
return Command::onGetFriendlyName() + ": " + m_path;
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createLaunchCommand()
|
Command* CommandFactory::createLaunchCommand()
|
||||||
{
|
{
|
||||||
return new LaunchCommand;
|
return new LaunchCommand;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2020-2023 Igara Studio S.A.
|
// Copyright (C) 2020-2024 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -56,6 +56,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool onEnabled(Context* context) override;
|
bool onEnabled(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
|
return context == KeyContext::Normal;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class LayerPropertiesWindow;
|
class LayerPropertiesWindow;
|
||||||
|
@ -32,9 +32,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
std::string onGetFriendlyName() const override;
|
||||||
return !params.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_preset;
|
std::string m_preset;
|
||||||
@ -93,6 +91,14 @@ void LoadPaletteCommand::onExecute(Context* context)
|
|||||||
context->executeCommand(cmd);
|
context->executeCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string LoadPaletteCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
std::string name = Command::onGetFriendlyName();
|
||||||
|
if (m_preset == "default")
|
||||||
|
name = Strings::commands_LoadDefaultPalette();
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createLoadPaletteCommand()
|
Command* CommandFactory::createLoadPaletteCommand()
|
||||||
{
|
{
|
||||||
return new LoadPaletteCommand;
|
return new LoadPaletteCommand;
|
||||||
|
@ -45,8 +45,8 @@ protected:
|
|||||||
bool onEnabled(Context* context) override;
|
bool onEnabled(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
return m_modifier == doc::algorithm::SelectionModifier::Contract;
|
return !params.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -24,7 +24,10 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
const bool isSkipListing(const Params& params) const override { return true; }
|
std::string onGetFriendlyName() const override;
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
|
return !params.empty();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_filename;
|
std::string m_filename;
|
||||||
@ -45,6 +48,11 @@ void OpenBrowserCommand::onExecute(Context* context)
|
|||||||
App::instance()->mainWindow()->showBrowser(m_filename);
|
App::instance()->mainWindow()->showBrowser(m_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string OpenBrowserCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
return Command::onGetFriendlyName() + ": " + m_filename;
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createOpenBrowserCommand()
|
Command* CommandFactory::createOpenBrowserCommand()
|
||||||
{
|
{
|
||||||
return new OpenBrowserCommand;
|
return new OpenBrowserCommand;
|
||||||
|
@ -272,6 +272,21 @@ void OpenFileCommand::onExecute(Context* context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string OpenFileCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
// TO DO: would be better to show the last part of the path
|
||||||
|
// via text size hint instead of a fixed number of chars.
|
||||||
|
auto uiScale = Preferences::instance().general.uiScale();
|
||||||
|
auto scScale = Preferences::instance().general.screenScale();
|
||||||
|
int pos(68.0 / double(uiScale) / double(scScale));
|
||||||
|
return Command::onGetFriendlyName().append(
|
||||||
|
(m_filename.empty() ?
|
||||||
|
"" :
|
||||||
|
(": " + (m_filename.size() >= pos ?
|
||||||
|
m_filename.substr(m_filename.size() - pos, pos) :
|
||||||
|
m_filename))));
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createOpenFileCommand()
|
Command* CommandFactory::createOpenFileCommand()
|
||||||
{
|
{
|
||||||
return new OpenFileCommand;
|
return new OpenFileCommand;
|
||||||
|
@ -33,9 +33,7 @@ namespace app {
|
|||||||
protected:
|
protected:
|
||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
std::string onGetFriendlyName() const override;
|
||||||
return !params.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_filename;
|
std::string m_filename;
|
||||||
|
@ -39,7 +39,10 @@ protected:
|
|||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
const bool isSkipListing(const Params& params) const override { return params.empty(); }
|
bool isListed(const Params& params, const KeyContext& context) const override
|
||||||
|
{
|
||||||
|
return !params.empty();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_filename;
|
std::string m_filename;
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
const bool isSkipListing(const Params& params) const override { return !params.empty(); }
|
std::string onGetFriendlyName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_preset;
|
std::string m_preset;
|
||||||
@ -102,6 +102,15 @@ void SavePaletteCommand::onExecute(Context* ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string SavePaletteCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
if (m_preset == "default")
|
||||||
|
return Strings::commands_SavePaletteAsDefault();
|
||||||
|
else if (m_saveAsPreset)
|
||||||
|
return Strings::commands_SavePaletteAsPreset();
|
||||||
|
return Command::onGetFriendlyName();
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createSavePaletteCommand()
|
Command* CommandFactory::createSavePaletteCommand()
|
||||||
{
|
{
|
||||||
return new SavePaletteCommand;
|
return new SavePaletteCommand;
|
||||||
|
@ -45,8 +45,9 @@ protected:
|
|||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
bool isListed(const Params& params, const KeyContext& context) const override
|
||||||
return params.empty();
|
{
|
||||||
|
return !params.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2024 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -33,6 +34,9 @@ protected:
|
|||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
bool onEnabled(Context* context) override;
|
bool onEnabled(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
|
return context == KeyContext::FramesSelection;
|
||||||
|
}
|
||||||
|
|
||||||
Action m_action;
|
Action m_action;
|
||||||
doc::frame_t m_begin, m_end;
|
doc::frame_t m_begin, m_end;
|
||||||
|
@ -24,7 +24,9 @@ protected:
|
|||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
bool onChecked(Context* context) override;
|
bool onChecked(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
std::string onGetFriendlyName() const override;
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override
|
||||||
|
{
|
||||||
return !params.empty();
|
return !params.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +56,11 @@ void SetPaletteEntrySizeCommand::onExecute(Context* context)
|
|||||||
ColorBar::instance()->getPaletteView()->setBoxSize(m_size);
|
ColorBar::instance()->getPaletteView()->setBoxSize(m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string SetPaletteEntrySizeCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
return Command::onGetFriendlyName() + " " + std::to_string(m_size);
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createSetPaletteEntrySizeCommand()
|
Command* CommandFactory::createSetPaletteEntrySizeCommand()
|
||||||
{
|
{
|
||||||
return new SetPaletteEntrySizeCommand;
|
return new SetPaletteEntrySizeCommand;
|
||||||
|
@ -29,8 +29,9 @@ protected:
|
|||||||
bool onChecked(Context* context) override;
|
bool onChecked(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
bool isListed(const Params& params, const KeyContext& context) const override
|
||||||
return params.empty();
|
{
|
||||||
|
return !params.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
filters::TiledMode m_mode;
|
filters::TiledMode m_mode;
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "app/commands/command_factory.h"
|
#include "app/commands/command_factory.h"
|
||||||
#include "app/commands/command_ids.h"
|
#include "app/commands/command_ids.h"
|
||||||
|
#include "app/ui/key_context.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -36,12 +37,12 @@ namespace app {
|
|||||||
void loadParams(const Params& params);
|
void loadParams(const Params& params);
|
||||||
bool isEnabled(Context* context);
|
bool isEnabled(Context* context);
|
||||||
bool isChecked(Context* context);
|
bool isChecked(Context* context);
|
||||||
|
|
||||||
// Not all Commands must be listed on KeyBoard Shortcut list, so
|
// Not all Commands must be listed on KeyBoard Shortcut list, so
|
||||||
// this function returns if a key command should be listed or not.
|
// this function returns if a key command should be listed or not.
|
||||||
// Used on 'cmd_keyboard_shorcuts.cpp'.
|
// Used on 'cmd_keyboard_shorcuts.cpp'.
|
||||||
virtual const bool isSkipListing(const Params& params) const {
|
virtual bool isListed(const Params& params, const KeyContext& context) const
|
||||||
return false;
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019-2021 Igara Studio S.A.
|
// Copyright (C) 2019-2024 Igara Studio S.A.
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
// the End-User License Agreement for Aseprite.
|
// the End-User License Agreement for Aseprite.
|
||||||
@ -54,6 +54,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void onExecute(Context* ctx) override;
|
void onExecute(Context* ctx) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
|
return !params.empty();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ScreenshotCommand::ScreenshotCommand()
|
ScreenshotCommand::ScreenshotCommand()
|
||||||
|
@ -26,8 +26,9 @@ protected:
|
|||||||
bool onChecked(Context* ctx) override;
|
bool onChecked(Context* ctx) override;
|
||||||
void onExecute(Context* ctx) override;
|
void onExecute(Context* ctx) override;
|
||||||
std::string onGetFriendlyName() const override;
|
std::string onGetFriendlyName() const override;
|
||||||
const bool isSkipListing(const Params& params) const override {
|
bool isListed(const Params& params, const KeyContext& context) const override
|
||||||
return params.empty();
|
{
|
||||||
|
return !params.empty();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ protected:
|
|||||||
return Strings::commands_TilesetMode(mode);
|
return Strings::commands_TilesetMode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool isSkipListing(const Params& params) const override {
|
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||||
return params.empty();
|
return !params.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -138,7 +138,7 @@ namespace app {
|
|||||||
const KeyboardShortcuts& globalKeys) const;
|
const KeyboardShortcuts& globalKeys) const;
|
||||||
bool isPressed() const;
|
bool isPressed() const;
|
||||||
bool isLooselyPressed() const;
|
bool isLooselyPressed() const;
|
||||||
bool isSkipListing() const;
|
bool isListed() const;
|
||||||
|
|
||||||
bool hasAccel(const ui::Accelerator& accel) const;
|
bool hasAccel(const ui::Accelerator& accel) const;
|
||||||
bool hasUserDefinedAccels() const;
|
bool hasUserDefinedAccels() const;
|
||||||
|
@ -494,9 +494,9 @@ bool Key::isLooselyPressed() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Key::isSkipListing() const
|
bool Key::isListed() const
|
||||||
{
|
{
|
||||||
return type() == KeyType::Command && command()->isSkipListing(params());
|
return type() != KeyType::Command || !command()->isListed(params(), keycontext());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Key::hasAccel(const ui::Accelerator& accel) const
|
bool Key::hasAccel(const ui::Accelerator& accel) const
|
||||||
|
Loading…
Reference in New Issue
Block a user