diff --git a/include/guisan/widget.hpp b/include/guisan/widget.hpp index c5103b1..f5ee277 100644 --- a/include/guisan/widget.hpp +++ b/include/guisan/widget.hpp @@ -720,6 +720,10 @@ namespace gcn * @since 0.1.0 */ static void setGlobalFont(Font* font); + static void setGlobalBaseColor(Color color); + static void setGlobalForegroundColor(Color color); + static void setGlobalBackgroundColor(Color color); + static void setGlobalSelectionColor(Color color); /** * Sets the font for the widget. If nullptr is passed, the global font diff --git a/src/widget.cpp b/src/widget.cpp index 359fbc7..21955c6 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -513,6 +513,38 @@ namespace gcn } } + void Widget::setGlobalBaseColor(Color color) + { + for (Widget* w : mWidgetInstances) + { + w->setBaseColor(color); + } + } + + void Widget::setGlobalForegroundColor(Color color) + { + for (Widget* w : mWidgetInstances) + { + w->setForegroundColor(color); + } + } + + void Widget::setGlobalBackgroundColor(Color color) + { + for (Widget* w : mWidgetInstances) + { + w->setBackgroundColor(color); + } + } + + void Widget::setGlobalSelectionColor(Color color) + { + for (Widget* w : mWidgetInstances) + { + w->setSelectionColor(color); + } + } + void Widget::setFont(Font* font) { mCurrentFont = font;