mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -33,14 +33,12 @@
|
||||
#include "margin_container.h"
|
||||
|
||||
struct _MinSizeCache {
|
||||
|
||||
int min_size;
|
||||
bool will_stretch;
|
||||
int final_size;
|
||||
};
|
||||
|
||||
void BoxContainer::_resort() {
|
||||
|
||||
/** First pass, determine minimum size AND amount of stretchable elements */
|
||||
|
||||
Size2i new_size = get_size();
|
||||
@@ -105,7 +103,6 @@ void BoxContainer::_resort() {
|
||||
bool refit_successful = true; //assume refit-test will go well
|
||||
|
||||
for (int i = 0; i < get_child_count(); i++) {
|
||||
|
||||
Control *c = Object::cast_to<Control>(get_child(i));
|
||||
if (!c || !c->is_visible_in_tree())
|
||||
continue;
|
||||
@@ -158,7 +155,6 @@ void BoxContainer::_resort() {
|
||||
int idx = 0;
|
||||
|
||||
for (int i = 0; i < get_child_count(); i++) {
|
||||
|
||||
Control *c = Object::cast_to<Control>(get_child(i));
|
||||
if (!c || !c->is_visible_in_tree())
|
||||
continue;
|
||||
@@ -187,10 +183,8 @@ void BoxContainer::_resort() {
|
||||
Rect2 rect;
|
||||
|
||||
if (vertical) {
|
||||
|
||||
rect = Rect2(0, from, new_size.width, size);
|
||||
} else {
|
||||
|
||||
rect = Rect2(from, 0, size, new_size.height);
|
||||
}
|
||||
|
||||
@@ -202,7 +196,6 @@ void BoxContainer::_resort() {
|
||||
}
|
||||
|
||||
Size2 BoxContainer::get_minimum_size() const {
|
||||
|
||||
/* Calculate MINIMUM SIZE */
|
||||
|
||||
Size2i minimum;
|
||||
@@ -247,15 +240,11 @@ Size2 BoxContainer::get_minimum_size() const {
|
||||
}
|
||||
|
||||
void BoxContainer::_notification(int p_what) {
|
||||
|
||||
switch (p_what) {
|
||||
|
||||
case NOTIFICATION_SORT_CHILDREN: {
|
||||
|
||||
_resort();
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
||||
minimum_size_changed();
|
||||
} break;
|
||||
}
|
||||
@@ -271,7 +260,6 @@ BoxContainer::AlignMode BoxContainer::get_alignment() const {
|
||||
}
|
||||
|
||||
void BoxContainer::add_spacer(bool p_begin) {
|
||||
|
||||
Control *c = memnew(Control);
|
||||
c->set_mouse_filter(MOUSE_FILTER_PASS); //allow spacer to pass mouse events
|
||||
|
||||
@@ -286,13 +274,11 @@ void BoxContainer::add_spacer(bool p_begin) {
|
||||
}
|
||||
|
||||
BoxContainer::BoxContainer(bool p_vertical) {
|
||||
|
||||
vertical = p_vertical;
|
||||
align = ALIGN_BEGIN;
|
||||
}
|
||||
|
||||
void BoxContainer::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_spacer", "begin"), &BoxContainer::add_spacer);
|
||||
ClassDB::bind_method(D_METHOD("get_alignment"), &BoxContainer::get_alignment);
|
||||
ClassDB::bind_method(D_METHOD("set_alignment", "alignment"), &BoxContainer::set_alignment);
|
||||
@@ -305,7 +291,6 @@ void BoxContainer::_bind_methods() {
|
||||
}
|
||||
|
||||
MarginContainer *VBoxContainer::add_margin_child(const String &p_label, Control *p_control, bool p_expand) {
|
||||
|
||||
Label *l = memnew(Label);
|
||||
l->set_text(p_label);
|
||||
add_child(l);
|
||||
|
||||
Reference in New Issue
Block a user