mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-03 21:46:20 +00:00
Clicking fg/bg colors open the palette editor.
This commit is contained in:
parent
6383d36f25
commit
27c895732d
@ -27,6 +27,7 @@
|
|||||||
#include "Vaca/Rect.h"
|
#include "Vaca/Rect.h"
|
||||||
|
|
||||||
#include "commands/commands.h"
|
#include "commands/commands.h"
|
||||||
|
#include "commands/params.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "core/cfg.h"
|
#include "core/cfg.h"
|
||||||
#include "core/color.h"
|
#include "core/color.h"
|
||||||
@ -498,14 +499,26 @@ bool ColorBar::msg_proc(JMessage msg)
|
|||||||
}
|
}
|
||||||
/* pick the color */
|
/* pick the color */
|
||||||
else if (m_hot != HOTCOLOR_NONE) {
|
else if (m_hot != HOTCOLOR_NONE) {
|
||||||
color_t color = getHotColor(m_hot);
|
switch (m_hot) {
|
||||||
|
case HOTCOLOR_FGCOLOR:
|
||||||
|
case HOTCOLOR_BGCOLOR: {
|
||||||
|
Command* paledit_cmd =
|
||||||
|
CommandsModule::instance()->get_command_by_name(CommandId::palette_editor);
|
||||||
|
Params params;
|
||||||
|
|
||||||
|
UIContext::instance()->execute_command(paledit_cmd, ¶ms);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
color_t color = getHotColor(m_hot);
|
||||||
if (msg->mouse.left) {
|
if (msg->mouse.left) {
|
||||||
colorbar_set_fg_color(this, color);
|
colorbar_set_fg_color(this, color);
|
||||||
}
|
}
|
||||||
if (msg->mouse.right) {
|
if (msg->mouse.right) {
|
||||||
colorbar_set_bg_color(this, color);
|
colorbar_set_bg_color(this, color);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hot_drag = HOTCOLOR_NONE;
|
m_hot_drag = HOTCOLOR_NONE;
|
||||||
|
Loading…
Reference in New Issue
Block a user