diff options
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/widget.h | 12 | ||||
-rw-r--r-- | views/widget/widget_gtk.cc | 3 | ||||
-rw-r--r-- | views/widget/widget_win.cc | 7 |
3 files changed, 18 insertions, 4 deletions
diff --git a/views/widget/widget.h b/views/widget/widget.h index cf893ee..7443bcb 100644 --- a/views/widget/widget.h +++ b/views/widget/widget.h @@ -64,10 +64,20 @@ class Widget { NotDeleteOnDestroy }; + enum MirroringParam { + MirrorOriginInRTL, + DontMirrorOriginInRTL + }; + // Creates a transient popup widget specific to the current platform. + // If |mirror_in_rtl| is set to MirrorOriginInRTL, the contents of the + // popup will be mirrored if the current locale is RTL. You should use + // DontMirrorOriginInRTL if you are aleady handling the RTL layout within + // the widget. static Widget* CreatePopupWidget(TransparencyParam transparent, EventsParam accept_events, - DeleteParam delete_on_destroy); + DeleteParam delete_on_destroy, + MirroringParam mirror_in_rtl); // Returns the root view for |native_window|. If |native_window| does not have // a rootview, this recurses through all of |native_window|'s children until diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 7bc8d03..f38267b 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -1427,7 +1427,8 @@ void WidgetGtk::DrawTransparentBackground(GtkWidget* widget, // static Widget* Widget::CreatePopupWidget(TransparencyParam transparent, EventsParam accept_events, - DeleteParam delete_on_destroy) { + DeleteParam delete_on_destroy, + MirroringParam mirror_in_rtl) { WidgetGtk* popup = new WidgetGtk(WidgetGtk::TYPE_POPUP); popup->set_delete_on_destroy(delete_on_destroy == DeleteOnDestroy); if (transparent == Transparent) diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index 72431b0..ef6612a 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -1257,9 +1257,12 @@ void WidgetWin::PostProcessActivateMessage(WidgetWin* widget, // static Widget* Widget::CreatePopupWidget(TransparencyParam transparent, EventsParam accept_events, - DeleteParam delete_on_destroy) { + DeleteParam delete_on_destroy, + MirroringParam mirror_in_rtl) { WidgetWin* popup = new WidgetWin; - DWORD ex_style = WS_EX_TOOLWINDOW | l10n_util::GetExtendedTooltipStyles(); + DWORD ex_style = WS_EX_TOOLWINDOW; + if (mirror_in_rtl == MirrorOriginInRTL) + ex_style |= l10n_util::GetExtendedTooltipStyles(); if (transparent == Transparent) ex_style |= WS_EX_LAYERED; if (accept_events != AcceptEvents) |