diff --git a/modules/paint/deprecated/paint_window.cpp b/modules/paint/deprecated/paint_window.cpp index 51e586f73..90d4eb367 100644 --- a/modules/paint/deprecated/paint_window.cpp +++ b/modules/paint/deprecated/paint_window.cpp @@ -1318,17 +1318,17 @@ PaintWindow::PaintWindow() { left_main_margin_container->add_child(left_main_vbox_container); //Main Content Mid (App) -- Left Panel -- Margin container -- VBoxContainer -- Colors - ScrollContainer *left_color_scroll_container = memnew(ScrollContainer); - left_color_scroll_container->set_custom_minimum_size(Size2(0, 145)); - left_main_vbox_container->add_child(left_color_scroll_container); + //ScrollContainer *left_color_scroll_container = memnew(ScrollContainer); + //left_color_scroll_container->set_custom_minimum_size(Size2(0, 145)); + //left_main_vbox_container->add_child(left_color_scroll_container); color_grid = memnew(PaintColorGrid); //color_grid->set_columns(4); color_grid->set_custom_minimum_size(Size2(0, 145)); - color_grid->set_h_size_flags(SIZE_EXPAND_FILL); - color_grid->set_v_size_flags(SIZE_EXPAND_FILL); + //color_grid->set_h_size_flags(SIZE_EXPAND_FILL); + //color_grid->set_v_size_flags(SIZE_EXPAND_FILL); color_grid->connect("color_change_request", this, "change_color"); - left_color_scroll_container->add_child(color_grid); + left_main_vbox_container->add_child(color_grid); //Main Content Mid (App) -- Left Panel -- Margin container -- VBoxContainer -- Lock Alpha Button lock_alpha_button = memnew(CheckButton); diff --git a/modules/paint/ui/sidebar_modules/paint_color_grid.cpp b/modules/paint/ui/sidebar_modules/paint_color_grid.cpp index b2cc6752b..7c0348aa7 100644 --- a/modules/paint/ui/sidebar_modules/paint_color_grid.cpp +++ b/modules/paint/ui/sidebar_modules/paint_color_grid.cpp @@ -26,6 +26,7 @@ SOFTWARE. #include "scene/gui/button.h" #include "scene/gui/grid_container.h" +#include "scene/gui/scroll_container.h" #include "scene/resources/style_box.h" void PaintColorGrid::change_color_to(const Color &color) { @@ -54,18 +55,22 @@ void PaintColorGrid::add_color_prefab(const Color &color) { } PaintColorGrid::PaintColorGrid() { + ScrollContainer *scroll_container = memnew(ScrollContainer); + scroll_container->set_custom_minimum_size(Size2(0, 145)); + scroll_container->set_enable_h_scroll(false); + add_child(scroll_container); + _grid = memnew(GridContainer); - add_child(_grid); + scroll_container->add_child(_grid); _grid->set_columns(4); - //color_grid->set_custom_minimum_size(Size2(0, 145)); - //color_grid->set_h_size_flags(SIZE_EXPAND_FILL); - //color_grid->set_v_size_flags(SIZE_EXPAND_FILL); + //_grid->set_custom_minimum_size(Size2(0, 145)); + _grid->set_h_size_flags(SIZE_EXPAND_FILL); + _grid->set_v_size_flags(SIZE_EXPAND_FILL); for (int i = 0; i < 24; ++i) { add_color_prefab(Color(Math::randf(), Math::randf(), Math::randf())); } - } PaintColorGrid::~PaintColorGrid() {