summaryrefslogtreecommitdiff
path: root/dw/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/widget.cc')
-rw-r--r--dw/widget.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/dw/widget.cc b/dw/widget.cc
index edabce51..865023a1 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -1361,6 +1361,23 @@ style::Color *Widget::getBgColor ()
return layout->getBgColor ();
}
+/**
+ * \brief Get the actual foreground color of a widget.
+ */
+style::Color *Widget::getFgColor ()
+{
+ Widget *widget = this;
+
+ while (widget != NULL) {
+ if (widget->style->color)
+ return widget->style->color;
+
+ widget = widget->parent;
+ }
+
+ return NULL;
+}
+
/**
* \brief Draw borders and background of a widget part, which allocation is