mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-01 01:20:25 +00:00
Don't show warning icon for Mask color
This commit is contained in:
parent
72d6aebbda
commit
8ca323492e
@ -25,6 +25,7 @@
|
|||||||
#include "app/context_access.h"
|
#include "app/context_access.h"
|
||||||
#include "app/document_api.h"
|
#include "app/document_api.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
|
#include "app/modules/editors.h"
|
||||||
#include "app/modules/gui.h"
|
#include "app/modules/gui.h"
|
||||||
#include "app/modules/palettes.h"
|
#include "app/modules/palettes.h"
|
||||||
#include "app/pref/preferences.h"
|
#include "app/pref/preferences.h"
|
||||||
@ -980,11 +981,23 @@ void ColorBar::onFixWarningClick(ColorButton* colorButton, ui::Button* warningIc
|
|||||||
|
|
||||||
void ColorBar::updateWarningIcon(const app::Color& color, ui::Button* warningIcon)
|
void ColorBar::updateWarningIcon(const app::Color& color, ui::Button* warningIcon)
|
||||||
{
|
{
|
||||||
int index = get_current_palette()->findExactMatch(
|
int index = -1;
|
||||||
color.getRed(),
|
|
||||||
color.getGreen(),
|
if (color.getType() == app::Color::MaskType) {
|
||||||
color.getBlue(),
|
if (current_editor &&
|
||||||
color.getAlpha(), -1);
|
current_editor->sprite()) {
|
||||||
|
index = current_editor->sprite()->transparentColor();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
index = get_current_palette()->findExactMatch(
|
||||||
|
color.getRed(),
|
||||||
|
color.getGreen(),
|
||||||
|
color.getBlue(),
|
||||||
|
color.getAlpha(), -1);
|
||||||
|
}
|
||||||
|
|
||||||
warningIcon->setVisible(index < 0);
|
warningIcon->setVisible(index < 0);
|
||||||
warningIcon->getParent()->layout();
|
warningIcon->getParent()->layout();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user