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

Side by Side Diff: chrome/browser/gtk/download_shelf_gtk.cc

Issue 507022: Fix issue 11258: Linux: gracefully handle small browser window... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/gtk_expanded_container.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gtk/download_shelf_gtk.h" 5 #include "chrome/browser/gtk/download_shelf_gtk.h"
6 6
7 #include "app/gfx/gtk_util.h" 7 #include "app/gfx/gtk_util.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // To make things pretty, we have to add a few more widgets. To get padding 55 // To make things pretty, we have to add a few more widgets. To get padding
56 // right, we stick the hbox in an alignment. We put that alignment in an 56 // right, we stick the hbox in an alignment. We put that alignment in an
57 // event box so we can color the background. 57 // event box so we can color the background.
58 58
59 // Create the top border. 59 // Create the top border.
60 top_border_ = gtk_event_box_new(); 60 top_border_ = gtk_event_box_new();
61 gtk_widget_set_size_request(GTK_WIDGET(top_border_), 0, 1); 61 gtk_widget_set_size_request(GTK_WIDGET(top_border_), 0, 1);
62 62
63 // Create |hbox_|. 63 // Create |hbox_|.
64 hbox_.Own(gtk_hbox_new(FALSE, kDownloadItemPadding)); 64 hbox_.Own(gtk_hbox_new(FALSE, kDownloadItemPadding));
65 gtk_widget_set_size_request(hbox_.get(), -1, kDownloadItemHeight); 65 // We want the download shelf to be horizontally shrinkable, so that the
66 // Chrome window can be resized freely even with many download items.
67 gtk_widget_set_size_request(hbox_.get(), 0, kDownloadItemHeight);
66 68
67 // Get the padding and background color for |hbox_| right. 69 // Get the padding and background color for |hbox_| right.
68 GtkWidget* padding = gtk_alignment_new(0, 0, 1, 1); 70 GtkWidget* padding = gtk_alignment_new(0, 0, 1, 1);
69 // Subtract 1 from top spacing to account for top border. 71 // Subtract 1 from top spacing to account for top border.
70 gtk_alignment_set_padding(GTK_ALIGNMENT(padding), 72 gtk_alignment_set_padding(GTK_ALIGNMENT(padding),
71 kTopBottomPadding - 1, kTopBottomPadding, kLeftPadding, kRightPadding); 73 kTopBottomPadding - 1, kTopBottomPadding, kLeftPadding, kRightPadding);
72 padding_bg_ = gtk_event_box_new(); 74 padding_bg_ = gtk_event_box_new();
73 gtk_container_add(GTK_CONTAINER(padding_bg_), padding); 75 gtk_container_add(GTK_CONTAINER(padding_bg_), padding);
74 gtk_container_add(GTK_CONTAINER(padding), hbox_.get()); 76 gtk_container_add(GTK_CONTAINER(padding), hbox_.get());
75 77
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // static 247 // static
246 void DownloadShelfGtk::OnButtonClick(GtkWidget* button, 248 void DownloadShelfGtk::OnButtonClick(GtkWidget* button,
247 DownloadShelfGtk* shelf) { 249 DownloadShelfGtk* shelf) {
248 if (button == shelf->close_button_->widget()) { 250 if (button == shelf->close_button_->widget()) {
249 shelf->Close(); 251 shelf->Close();
250 } else { 252 } else {
251 // The link button was clicked. 253 // The link button was clicked.
252 shelf->browser_->ShowDownloadsTab(); 254 shelf->browser_->ShowDownloadsTab();
253 } 255 }
254 } 256 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/gtk_expanded_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698