summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/view.cc8
-rw-r--r--views/view.h6
2 files changed, 12 insertions, 2 deletions
diff --git a/views/view.cc b/views/view.cc
index a03378e..c5359a7 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -647,11 +647,15 @@ void View::PropagateAddNotifications(View* parent, View* child) {
}
void View::ThemeChanged() {
- int c = GetChildViewCount();
- for (int i = c - 1; i >= 0; --i)
+ for (int i = GetChildViewCount() - 1; i >= 0; --i)
GetChildViewAt(i)->ThemeChanged();
}
+void View::LocaleChanged() {
+ for (int i = GetChildViewCount() - 1; i >= 0; --i)
+ GetChildViewAt(i)->LocaleChanged();
+}
+
#ifndef NDEBUG
bool View::IsProcessingPaint() const {
return GetParent() && GetParent()->IsProcessingPaint();
diff --git a/views/view.h b/views/view.h
index f2469f7..29cd1a9 100644
--- a/views/view.h
+++ b/views/view.h
@@ -982,6 +982,12 @@ class View : public AcceleratorTarget {
// call this method on the RootView.
virtual void ThemeChanged();
+ // Called when the locale has changed, overriding allows individual Views to
+ // update locale-dependent resources (strings, bitmaps) it may have cached
+ // internally. Subclasses that override this method must call the base class
+ // implementation to ensure child views are processed.
+ virtual void LocaleChanged();
+
#ifndef NDEBUG
// Returns true if the View is currently processing a paint.
virtual bool IsProcessingPaint() const;