mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-11 22:14:31 +00:00
We have to list commands in Keyboard Shortcuts regardless of context
Removed KeyContext param from Command::isListed().
This commit is contained in:
parent
55e1b320c4
commit
0a1c5275a7
@ -26,7 +26,7 @@ namespace app {
|
||||
bool onEnabled(Context* context) override;
|
||||
void onExecute(Context* context) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||
bool isListed(const Params& params) const override {
|
||||
return !params.empty();
|
||||
}
|
||||
|
||||
|
@ -87,9 +87,6 @@ protected:
|
||||
|
||||
return (frame > 0 ? frame-1: last);
|
||||
}
|
||||
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||
return context == KeyContext::Normal;
|
||||
}
|
||||
};
|
||||
|
||||
class GotoNextFrameCommand : public GotoCommand {
|
||||
@ -103,9 +100,6 @@ protected:
|
||||
|
||||
return (frame < last ? frame+1: 0);
|
||||
}
|
||||
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||
return context == KeyContext::Normal;
|
||||
}
|
||||
};
|
||||
|
||||
class GotoNextFrameWithSameTagCommand : public GotoCommand {
|
||||
|
@ -25,8 +25,8 @@ protected:
|
||||
void onLoadParams(const Params& params) 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") != "";
|
||||
bool isListed(const Params& params) const override {
|
||||
return !params.get("path").empty();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -56,9 +56,6 @@ public:
|
||||
protected:
|
||||
bool onEnabled(Context* context) override;
|
||||
void onExecute(Context* context) override;
|
||||
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||
return context == KeyContext::Normal;
|
||||
}
|
||||
};
|
||||
|
||||
class LayerPropertiesWindow;
|
||||
|
@ -45,9 +45,7 @@ protected:
|
||||
bool onEnabled(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.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
|
||||
private:
|
||||
std::string getActionName() const;
|
||||
|
@ -25,9 +25,7 @@ protected:
|
||||
void onLoadParams(const Params& params) override;
|
||||
void onExecute(Context* context) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||
return !params.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
|
||||
private:
|
||||
std::string m_filename;
|
||||
|
@ -39,10 +39,7 @@ protected:
|
||||
void onLoadParams(const Params& params) override;
|
||||
void onExecute(Context* context) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
bool isListed(const Params& params, const KeyContext& context) const override
|
||||
{
|
||||
return !params.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
|
||||
private:
|
||||
std::string m_filename;
|
||||
|
@ -45,10 +45,7 @@ protected:
|
||||
void onLoadParams(const Params& params) override;
|
||||
void onExecute(Context* context) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
bool isListed(const Params& params, const KeyContext& context) const override
|
||||
{
|
||||
return !params.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
|
||||
private:
|
||||
void selectTiles(const Layer* layer,
|
||||
|
@ -34,9 +34,6 @@ protected:
|
||||
void onLoadParams(const Params& params) override;
|
||||
bool onEnabled(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;
|
||||
doc::frame_t m_begin, m_end;
|
||||
|
@ -25,10 +25,7 @@ protected:
|
||||
bool onChecked(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.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
|
||||
private:
|
||||
int m_size;
|
||||
|
@ -29,10 +29,7 @@ protected:
|
||||
bool onChecked(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.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
|
||||
filters::TiledMode m_mode;
|
||||
};
|
||||
|
@ -37,13 +37,10 @@ namespace app {
|
||||
void loadParams(const Params& params);
|
||||
bool isEnabled(Context* context);
|
||||
bool isChecked(Context* context);
|
||||
// Not all Commands must be listed on KeyBoard Shortcut list, so
|
||||
// this function returns if a key command should be listed or not.
|
||||
// Used on 'cmd_keyboard_shorcuts.cpp'.
|
||||
virtual bool isListed(const Params& params, const KeyContext& context) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Returns true if the command must be displayed in the Keyboard
|
||||
// Shortcuts list.
|
||||
virtual bool isListed(const Params& params) const { return true; }
|
||||
|
||||
protected:
|
||||
virtual bool onNeedsParams() const;
|
||||
|
@ -54,9 +54,7 @@ public:
|
||||
protected:
|
||||
void onExecute(Context* ctx) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||
return !params.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
};
|
||||
|
||||
ScreenshotCommand::ScreenshotCommand()
|
||||
|
@ -26,10 +26,7 @@ protected:
|
||||
bool onChecked(Context* ctx) override;
|
||||
void onExecute(Context* ctx) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
bool isListed(const Params& params, const KeyContext& context) const override
|
||||
{
|
||||
return !params.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
};
|
||||
|
||||
SetPlaybackSpeedCommand::SetPlaybackSpeedCommand()
|
||||
|
@ -54,9 +54,7 @@ protected:
|
||||
return Strings::commands_TilesetMode(mode);
|
||||
}
|
||||
|
||||
bool isListed(const Params& params, const KeyContext& context) const override {
|
||||
return !params.empty();
|
||||
}
|
||||
bool isListed(const Params& params) const override { return !params.empty(); }
|
||||
|
||||
private:
|
||||
TilesetMode m_mode;
|
||||
|
@ -496,7 +496,7 @@ bool Key::isLooselyPressed() const
|
||||
|
||||
bool Key::isListed() const
|
||||
{
|
||||
return type() != KeyType::Command || !command()->isListed(params(), keycontext());
|
||||
return type() != KeyType::Command || !command()->isListed(params());
|
||||
}
|
||||
|
||||
bool Key::hasAccel(const ui::Accelerator& accel) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user