mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
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">
|
||||
<param name="mode" value="subtract" />
|
||||
</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>
|
||||
|
||||
<!-- Keyboard shortcuts to select tools -->
|
||||
|
@ -316,6 +316,7 @@ protected:
|
||||
bool onEnabled(Context* context) override;
|
||||
bool onChecked(Context* context) override;
|
||||
void onExecute(Context* context) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
|
||||
private:
|
||||
bool m_useUI;
|
||||
@ -430,6 +431,37 @@ void ChangePixelFormatCommand::onExecute(Context* context)
|
||||
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()
|
||||
{
|
||||
return new ChangePixelFormatCommand;
|
||||
|
Loading…
x
Reference in New Issue
Block a user