1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Rename Control margin to offset

This commit is contained in:
Marcel Admiraal
2020-12-22 16:24:29 +00:00
parent 30d469a5e0
commit 4b8b803931
106 changed files with 1278 additions and 1278 deletions

View File

@@ -55,7 +55,7 @@ Size2 CheckButton::get_minimum_size() const {
minsize.width += get_theme_constant("hseparation");
}
Ref<StyleBox> sb = get_theme_stylebox("normal");
minsize.height = MAX(minsize.height, tex_size.height + sb->get_margin(MARGIN_TOP) + sb->get_margin(MARGIN_BOTTOM));
minsize.height = MAX(minsize.height, tex_size.height + sb->get_margin(SIDE_TOP) + sb->get_margin(SIDE_BOTTOM));
return minsize;
}
@@ -63,11 +63,11 @@ Size2 CheckButton::get_minimum_size() const {
void CheckButton::_notification(int p_what) {
if ((p_what == NOTIFICATION_THEME_CHANGED) || (p_what == NOTIFICATION_LAYOUT_DIRECTION_CHANGED) || (p_what == NOTIFICATION_TRANSLATION_CHANGED)) {
if (is_layout_rtl()) {
_set_internal_margin(MARGIN_LEFT, get_icon_size().width);
_set_internal_margin(MARGIN_RIGHT, 0.f);
_set_internal_margin(SIDE_LEFT, get_icon_size().width);
_set_internal_margin(SIDE_RIGHT, 0.f);
} else {
_set_internal_margin(MARGIN_LEFT, 0.f);
_set_internal_margin(MARGIN_RIGHT, get_icon_size().width);
_set_internal_margin(SIDE_LEFT, 0.f);
_set_internal_margin(SIDE_RIGHT, get_icon_size().width);
}
} else if (p_what == NOTIFICATION_DRAW) {
RID ci = get_canvas_item();
@@ -91,9 +91,9 @@ void CheckButton::_notification(int p_what) {
Size2 tex_size = get_icon_size();
if (rtl) {
ofs.x = sb->get_margin(MARGIN_LEFT);
ofs.x = sb->get_margin(SIDE_LEFT);
} else {
ofs.x = get_size().width - (tex_size.width + sb->get_margin(MARGIN_RIGHT));
ofs.x = get_size().width - (tex_size.width + sb->get_margin(SIDE_RIGHT));
}
ofs.y = (get_size().height - tex_size.height) / 2 + get_theme_constant("check_vadjust");
@@ -109,9 +109,9 @@ CheckButton::CheckButton() {
set_toggle_mode(true);
set_text_align(ALIGN_LEFT);
if (is_layout_rtl()) {
_set_internal_margin(MARGIN_LEFT, get_icon_size().width);
_set_internal_margin(SIDE_LEFT, get_icon_size().width);
} else {
_set_internal_margin(MARGIN_RIGHT, get_icon_size().width);
_set_internal_margin(SIDE_RIGHT, get_icon_size().width);
}
}