mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-07 10:21:30 +00:00
Added buttons in Options dialog to change grid colors (normal grid and pixel grid).
This commit is contained in:
parent
2af3160b3f
commit
e1bdcb9899
@ -12,10 +12,16 @@
|
|||||||
<check text="Smooth auto-scroll" name="smooth" />
|
<check text="Smooth auto-scroll" name="smooth" />
|
||||||
<check text="2 Click Movement" name="move_click2" />
|
<check text="2 Click Movement" name="move_click2" />
|
||||||
<check text="2 Click Drawing" name="draw_click2" />
|
<check text="2 Click Drawing" name="draw_click2" />
|
||||||
<box horizontal="true">
|
<grid columns="2">
|
||||||
<label text="Cursor:" />
|
<label text="Cursor:" />
|
||||||
<box name="cursor_color_box" /><!-- custom widget -->
|
<box name="cursor_color_box" /><!-- custom widget -->
|
||||||
</box>
|
|
||||||
|
<label text="Grid Color:" />
|
||||||
|
<box name="grid_color_box" /><!-- custom widget -->
|
||||||
|
|
||||||
|
<label text="Pixel Grid:" />
|
||||||
|
<box name="pixel_grid_color_box" /><!-- custom widget -->
|
||||||
|
</grid>
|
||||||
|
|
||||||
<!-- Undo -->
|
<!-- Undo -->
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "commands/command.h"
|
#include "commands/command.h"
|
||||||
|
#include "context.h"
|
||||||
#include "core/cfg.h"
|
#include "core/cfg.h"
|
||||||
#include "modules/editors.h"
|
#include "modules/editors.h"
|
||||||
#include "modules/gui.h"
|
#include "modules/gui.h"
|
||||||
@ -63,6 +64,8 @@ void OptionsCommand::execute(Context* context)
|
|||||||
{
|
{
|
||||||
JWidget check_smooth;
|
JWidget check_smooth;
|
||||||
JWidget cursor_color, cursor_color_box;
|
JWidget cursor_color, cursor_color_box;
|
||||||
|
JWidget grid_color, grid_color_box;
|
||||||
|
JWidget pixel_grid_color, pixel_grid_color_box;
|
||||||
JWidget button_ok;
|
JWidget button_ok;
|
||||||
JWidget move_click2, draw_click2;
|
JWidget move_click2, draw_click2;
|
||||||
JWidget checked_bg_reset;
|
JWidget checked_bg_reset;
|
||||||
@ -76,6 +79,8 @@ void OptionsCommand::execute(Context* context)
|
|||||||
"move_click2", &move_click2,
|
"move_click2", &move_click2,
|
||||||
"draw_click2", &draw_click2,
|
"draw_click2", &draw_click2,
|
||||||
"cursor_color_box", &cursor_color_box,
|
"cursor_color_box", &cursor_color_box,
|
||||||
|
"grid_color_box", &grid_color_box,
|
||||||
|
"pixel_grid_color_box", &pixel_grid_color_box,
|
||||||
"checked_bg_size", &checked_bg,
|
"checked_bg_size", &checked_bg,
|
||||||
"checked_bg_zoom", &checked_bg_zoom,
|
"checked_bg_zoom", &checked_bg_zoom,
|
||||||
"checked_bg_color1_box", &checked_bg_color1_box,
|
"checked_bg_color1_box", &checked_bg_color1_box,
|
||||||
@ -85,10 +90,21 @@ void OptionsCommand::execute(Context* context)
|
|||||||
"button_ok", &button_ok, NULL);
|
"button_ok", &button_ok, NULL);
|
||||||
|
|
||||||
// Cursor color
|
// Cursor color
|
||||||
cursor_color = colorbutton_new(Editor::get_cursor_color(), IMAGE_INDEXED);
|
cursor_color = colorbutton_new(Editor::get_cursor_color(), IMAGE_RGB);
|
||||||
cursor_color->setName("cursor_color");
|
cursor_color->setName("cursor_color");
|
||||||
jwidget_add_child(cursor_color_box, cursor_color);
|
jwidget_add_child(cursor_color_box, cursor_color);
|
||||||
|
|
||||||
|
// Grid color
|
||||||
|
grid_color = colorbutton_new(context->getSettings()->getGridColor(), IMAGE_RGB);
|
||||||
|
grid_color->setName("grid_color");
|
||||||
|
jwidget_add_child(grid_color_box, grid_color);
|
||||||
|
|
||||||
|
// Pixel grid color
|
||||||
|
pixel_grid_color = colorbutton_new(context->getSettings()->getPixelGridColor(), IMAGE_RGB);
|
||||||
|
pixel_grid_color->setName("pixel_grid_color");
|
||||||
|
jwidget_add_child(pixel_grid_color_box, pixel_grid_color);
|
||||||
|
|
||||||
|
// Others
|
||||||
if (get_config_bool("Options", "MoveClick2", false))
|
if (get_config_bool("Options", "MoveClick2", false))
|
||||||
jwidget_select(move_click2);
|
jwidget_select(move_click2);
|
||||||
|
|
||||||
@ -129,6 +145,8 @@ void OptionsCommand::execute(Context* context)
|
|||||||
int undo_size_limit_value;
|
int undo_size_limit_value;
|
||||||
|
|
||||||
Editor::set_cursor_color(colorbutton_get_color(cursor_color));
|
Editor::set_cursor_color(colorbutton_get_color(cursor_color));
|
||||||
|
context->getSettings()->setGridColor(colorbutton_get_color(grid_color));
|
||||||
|
context->getSettings()->setPixelGridColor(colorbutton_get_color(pixel_grid_color));
|
||||||
|
|
||||||
set_config_bool("Options", "MoveSmooth", jwidget_is_selected(check_smooth));
|
set_config_bool("Options", "MoveSmooth", jwidget_is_selected(check_smooth));
|
||||||
set_config_bool("Options", "MoveClick2", jwidget_is_selected(move_click2));
|
set_config_bool("Options", "MoveClick2", jwidget_is_selected(move_click2));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user