浏览代码

Merge pull request #101923 from Giganzo/color-button-click

Fix ColorPicker Swatches button width
Thaddeus Crews 7 月之前
父节点
当前提交
53f3143028
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      scene/gui/color_picker.cpp

+ 1 - 4
scene/gui/color_picker.cpp

@@ -2365,13 +2365,10 @@ ColorPicker::ColorPicker() {
 	btn_preset->set_toggle_mode(true);
 	btn_preset->set_toggle_mode(true);
 	btn_preset->set_focus_mode(FOCUS_NONE);
 	btn_preset->set_focus_mode(FOCUS_NONE);
 	btn_preset->set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT);
 	btn_preset->set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT);
+	btn_preset->set_h_size_flags(SIZE_EXPAND_FILL);
 	btn_preset->connect(SceneStringName(toggled), callable_mp(this, &ColorPicker::_show_hide_preset).bind(btn_preset, preset_container));
 	btn_preset->connect(SceneStringName(toggled), callable_mp(this, &ColorPicker::_show_hide_preset).bind(btn_preset, preset_container));
 	palette_box->add_child(btn_preset);
 	palette_box->add_child(btn_preset);
 
 
-	HBoxContainer *padding_box = memnew(HBoxContainer);
-	padding_box->set_h_size_flags(SIZE_EXPAND_FILL);
-	palette_box->add_child(padding_box);
-
 	menu_btn = memnew(Button);
 	menu_btn = memnew(Button);
 	menu_btn->set_flat(true);
 	menu_btn->set_flat(true);
 	menu_btn->set_tooltip_text(ETR("Show all options available."));
 	menu_btn->set_tooltip_text(ETR("Show all options available."));