mirror of https://github.com/aseprite/aseprite.git
Add friendly names for ChangePixelFormat command
This commit is contained in:
parent
03276e0264
commit
e3701940fb
14
data/gui.xml
14
data/gui.xml
|
@ -428,6 +428,20 @@
|
||||||
<key command="SelectTile">
|
<key command="SelectTile">
|
||||||
<param name="mode" value="subtract" />
|
<param name="mode" value="subtract" />
|
||||||
</key>
|
</key>
|
||||||
|
<key command="ChangePixelFormat">
|
||||||
|
<param name="format" value="rgb" />
|
||||||
|
</key>
|
||||||
|
<key command="ChangePixelFormat">
|
||||||
|
<param name="format" value="grayscale" />
|
||||||
|
</key>
|
||||||
|
<key command="ChangePixelFormat">
|
||||||
|
<param name="format" value="indexed" />
|
||||||
|
<param name="dithering" value="ordered" />
|
||||||
|
</key>
|
||||||
|
<key command="ChangePixelFormat">
|
||||||
|
<param name="format" value="indexed" />
|
||||||
|
<param name="dithering" value="old-ordered" />
|
||||||
|
</key>
|
||||||
</commands>
|
</commands>
|
||||||
|
|
||||||
<!-- Keyboard shortcuts to select tools -->
|
<!-- Keyboard shortcuts to select tools -->
|
||||||
|
|
|
@ -316,6 +316,7 @@ protected:
|
||||||
bool onEnabled(Context* context) override;
|
bool onEnabled(Context* context) override;
|
||||||
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;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_useUI;
|
bool m_useUI;
|
||||||
|
@ -430,6 +431,37 @@ void ChangePixelFormatCommand::onExecute(Context* context)
|
||||||
app_refresh_screen();
|
app_refresh_screen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ChangePixelFormatCommand::onGetFriendlyName() const
|
||||||
|
{
|
||||||
|
std::string text = "Change Color Mode";
|
||||||
|
|
||||||
|
if (!m_useUI) {
|
||||||
|
switch (m_format) {
|
||||||
|
case IMAGE_RGB:
|
||||||
|
text += " to RGB";
|
||||||
|
break;
|
||||||
|
case IMAGE_INDEXED:
|
||||||
|
text += " to Indexed";
|
||||||
|
switch (m_dithering) {
|
||||||
|
case render::DitheringAlgorithm::None:
|
||||||
|
break;
|
||||||
|
case render::DitheringAlgorithm::OldOrdered:
|
||||||
|
text += " with Old Ordered Dithering";
|
||||||
|
break;
|
||||||
|
case render::DitheringAlgorithm::Ordered:
|
||||||
|
text += " with Ordered Dithering";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case IMAGE_GRAYSCALE:
|
||||||
|
text += " to Grayscale";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createChangePixelFormatCommand()
|
Command* CommandFactory::createChangePixelFormatCommand()
|
||||||
{
|
{
|
||||||
return new ChangePixelFormatCommand;
|
return new ChangePixelFormatCommand;
|
||||||
|
|
Loading…
Reference in New Issue