Fixed the up and down arrows of the paint layers.

This commit is contained in:
Relintai 2022-06-20 22:21:52 +02:00
parent d8185be48f
commit 3db7c40a46
2 changed files with 6 additions and 1 deletions

View File

@ -25,8 +25,8 @@ SOFTWARE.
#include "paint_layer_button.h"
#include "core/image.h"
#include "scene/resources/texture.h"
#include "scene/resources/style_box.h"
#include "scene/resources/texture.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
@ -87,6 +87,7 @@ PaintLayerButton::PaintLayerButton() {
layer_button->set_text_align(Button::ALIGN_RIGHT);
layer_button->set_h_size_flags(SIZE_EXPAND_FILL);
layer_button->set_v_size_flags(SIZE_EXPAND_FILL);
style_box.instance();
style_box->set("bg_color", Color(0.25, 0.25, 0.25));
layer_button->set("custom_styles/hover", style_box);
@ -139,6 +140,7 @@ PaintLayerButton::PaintLayerButton() {
up_button->set_v_size_flags(SIZE_EXPAND_FILL);
up_button->set_normal_texture(make_icon(arrow_up_png));
up_button->set_pressed_texture(make_icon(minidotta_png));
up_button->set_custom_minimum_size(Vector2(15, 15));
right_main_container->add_child(up_button);
down_button = memnew(TextureButton);
@ -148,6 +150,7 @@ PaintLayerButton::PaintLayerButton() {
down_button->set_v_size_flags(SIZE_EXPAND_FILL);
down_button->set_normal_texture(make_icon(arrow_down_png));
down_button->set_pressed_texture(make_icon(minidotta_png));
down_button->set_custom_minimum_size(Vector2(15, 15));
right_main_container->add_child(down_button);
}

View File

@ -1508,4 +1508,6 @@ void PaintWindow::_bind_methods() {
ClassDB::bind_method(D_METHOD("lock_layer"), &PaintWindow::lock_layer);
ClassDB::bind_method(D_METHOD("toggle_layer_visibility"), &PaintWindow::toggle_layer_visibility);
ClassDB::bind_method(D_METHOD("select_layer", "name"), &PaintWindow::select_layer);
ClassDB::bind_method(D_METHOD("move_up", "n"), &PaintWindow::move_up);
ClassDB::bind_method(D_METHOD("move_down", "n"), &PaintWindow::move_down);
}