mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +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,7 +33,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
Size2 TextureButton::get_minimum_size() const {
|
||||
|
||||
Size2 rscale = Control::get_minimum_size();
|
||||
|
||||
if (!expand) {
|
||||
@@ -57,9 +56,7 @@ Size2 TextureButton::get_minimum_size() const {
|
||||
}
|
||||
|
||||
bool TextureButton::has_point(const Point2 &p_point) const {
|
||||
|
||||
if (click_mask.is_valid()) {
|
||||
|
||||
Point2 point = p_point;
|
||||
Rect2 rect = Rect2();
|
||||
Size2 mask_size = click_mask->get_size();
|
||||
@@ -116,9 +113,7 @@ bool TextureButton::has_point(const Point2 &p_point) const {
|
||||
}
|
||||
|
||||
void TextureButton::_notification(int p_what) {
|
||||
|
||||
switch (p_what) {
|
||||
|
||||
case NOTIFICATION_DRAW: {
|
||||
DrawMode draw_mode = get_draw_mode();
|
||||
|
||||
@@ -126,13 +121,11 @@ void TextureButton::_notification(int p_what) {
|
||||
|
||||
switch (draw_mode) {
|
||||
case DRAW_NORMAL: {
|
||||
|
||||
if (normal.is_valid())
|
||||
texdraw = normal;
|
||||
} break;
|
||||
case DRAW_HOVER_PRESSED:
|
||||
case DRAW_PRESSED: {
|
||||
|
||||
if (pressed.is_null()) {
|
||||
if (hover.is_null()) {
|
||||
if (normal.is_valid())
|
||||
@@ -144,7 +137,6 @@ void TextureButton::_notification(int p_what) {
|
||||
texdraw = pressed;
|
||||
} break;
|
||||
case DRAW_HOVER: {
|
||||
|
||||
if (hover.is_null()) {
|
||||
if (pressed.is_valid() && is_pressed())
|
||||
texdraw = pressed;
|
||||
@@ -154,7 +146,6 @@ void TextureButton::_notification(int p_what) {
|
||||
texdraw = hover;
|
||||
} break;
|
||||
case DRAW_DISABLED: {
|
||||
|
||||
if (disabled.is_null()) {
|
||||
if (normal.is_valid())
|
||||
texdraw = normal;
|
||||
@@ -232,7 +223,6 @@ void TextureButton::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void TextureButton::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_normal_texture", "texture"), &TextureButton::set_normal_texture);
|
||||
ClassDB::bind_method(D_METHOD("set_pressed_texture", "texture"), &TextureButton::set_pressed_texture);
|
||||
ClassDB::bind_method(D_METHOD("set_hover_texture", "texture"), &TextureButton::set_hover_texture);
|
||||
@@ -271,61 +261,49 @@ void TextureButton::_bind_methods() {
|
||||
}
|
||||
|
||||
void TextureButton::set_normal_texture(const Ref<Texture2D> &p_normal) {
|
||||
|
||||
normal = p_normal;
|
||||
update();
|
||||
minimum_size_changed();
|
||||
}
|
||||
|
||||
void TextureButton::set_pressed_texture(const Ref<Texture2D> &p_pressed) {
|
||||
|
||||
pressed = p_pressed;
|
||||
update();
|
||||
}
|
||||
void TextureButton::set_hover_texture(const Ref<Texture2D> &p_hover) {
|
||||
|
||||
hover = p_hover;
|
||||
update();
|
||||
}
|
||||
void TextureButton::set_disabled_texture(const Ref<Texture2D> &p_disabled) {
|
||||
|
||||
disabled = p_disabled;
|
||||
update();
|
||||
}
|
||||
void TextureButton::set_click_mask(const Ref<BitMap> &p_click_mask) {
|
||||
|
||||
click_mask = p_click_mask;
|
||||
update();
|
||||
}
|
||||
|
||||
Ref<Texture2D> TextureButton::get_normal_texture() const {
|
||||
|
||||
return normal;
|
||||
}
|
||||
Ref<Texture2D> TextureButton::get_pressed_texture() const {
|
||||
|
||||
return pressed;
|
||||
}
|
||||
Ref<Texture2D> TextureButton::get_hover_texture() const {
|
||||
|
||||
return hover;
|
||||
}
|
||||
Ref<Texture2D> TextureButton::get_disabled_texture() const {
|
||||
|
||||
return disabled;
|
||||
}
|
||||
Ref<BitMap> TextureButton::get_click_mask() const {
|
||||
|
||||
return click_mask;
|
||||
}
|
||||
|
||||
Ref<Texture2D> TextureButton::get_focused_texture() const {
|
||||
|
||||
return focused;
|
||||
};
|
||||
|
||||
void TextureButton::set_focused_texture(const Ref<Texture2D> &p_focused) {
|
||||
|
||||
focused = p_focused;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user