Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change bulk_theme_override variable to an integer #91563

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2962,14 +2962,14 @@ int Control::get_theme_default_font_size() const {

void Control::begin_bulk_theme_override() {
ERR_MAIN_THREAD_GUARD;
data.bulk_theme_override = true;
data.bulk_theme_override += 1;
}

void Control::end_bulk_theme_override() {
ERR_MAIN_THREAD_GUARD;
ERR_FAIL_COND(!data.bulk_theme_override);
ERR_FAIL_COND_MSG(data.bulk_theme_override <= 0, "end_bulk_theme_override() called without a matching begin_bulk_theme_override().");

data.bulk_theme_override = false;
data.bulk_theme_override -= 1;
_notify_theme_override_changed();
}

Expand Down
2 changes: 1 addition & 1 deletion scene/gui/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class Control : public CanvasItem {
Ref<Theme> theme;
StringName theme_type_variation;

bool bulk_theme_override = false;
int bulk_theme_override = 0;
Theme::ThemeIconMap theme_icon_override;
Theme::ThemeStyleMap theme_style_override;
Theme::ThemeFontMap theme_font_override;
Expand Down
6 changes: 3 additions & 3 deletions scene/main/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2518,14 +2518,14 @@ int Window::get_theme_default_font_size() const {

void Window::begin_bulk_theme_override() {
ERR_MAIN_THREAD_GUARD;
bulk_theme_override = true;
bulk_theme_override += 1;
}

void Window::end_bulk_theme_override() {
ERR_MAIN_THREAD_GUARD;
ERR_FAIL_COND(!bulk_theme_override);
ERR_FAIL_COND_MSG(bulk_theme_override <= 0, "end_bulk_theme_override() called without a matching begin_bulk_theme_override().");

bulk_theme_override = false;
bulk_theme_override -= 1;
_notify_theme_override_changed();
}

Expand Down
2 changes: 1 addition & 1 deletion scene/main/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Window : public Viewport {
Ref<Theme> theme;
StringName theme_type_variation;

bool bulk_theme_override = false;
int bulk_theme_override = 0;
Theme::ThemeIconMap theme_icon_override;
Theme::ThemeStyleMap theme_style_override;
Theme::ThemeFontMap theme_font_override;
Expand Down