Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: ui/views/examples/widget_example.cc

Issue 11756005: Implement rough new dialog style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/widget_example.cc
diff --git a/ui/views/examples/widget_example.cc b/ui/views/examples/widget_example.cc
index 112f57a98e358da89ddff0f333b1b32b01d3527d..a4c221b9b7d417d81cc8e38c7ce4950478e77a92 100644
--- a/ui/views/examples/widget_example.cc
+++ b/ui/views/examples/widget_example.cc
@@ -14,6 +14,19 @@
namespace views {
namespace examples {
+namespace {
+
+class DialogExample : public DialogDelegateView {
+ public:
+ virtual string16 GetWindowTitle() const OVERRIDE;
+};
+
+string16 DialogExample::GetWindowTitle() const {
+ return ASCIIToUTF16("Dialog Widget Example");
+}
+
+} // namespace
+
WidgetExample::WidgetExample() : ExampleBase("Widget") {
}
@@ -34,6 +47,7 @@ void WidgetExample::BuildButton(View* container,
const std::string& label,
int tag) {
TextButton* button = new TextButton(this, ASCIIToUTF16(label));
+ button->set_focusable(true);
button->set_tag(tag);
container->AddChildView(button);
}
@@ -42,7 +56,7 @@ void WidgetExample::ShowWidget(View* sender, Widget::InitParams params) {
// Setup shared Widget heirarchy and bounds parameters.
params.parent = sender->GetWidget()->GetNativeView();
params.bounds = gfx::Rect(sender->GetBoundsInScreen().CenterPoint(),
- gfx::Size(200, 100));
+ gfx::Size(300, 200));
Widget* widget = new Widget();
widget->Init(params);
@@ -66,7 +80,9 @@ void WidgetExample::ButtonPressed(Button* sender, const ui::Event& event) {
break;
case DIALOG: {
Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
- params.delegate = new DialogDelegateView();
+ params.delegate = new DialogExample();
+ params.remove_standard_frame = true;
+ params.transparent = true;
ShowWidget(sender, params);
break;
}
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698