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

Unified Diff: chrome/browser/chromeos/status/network_menu.cc

Issue 3586005: Aligns the network menu width with combo box width. (Closed)
Patch Set: merged with trunk Created 10 years, 3 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 | « chrome/browser/chromeos/status/network_menu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status/network_menu.cc
diff --git a/chrome/browser/chromeos/status/network_menu.cc b/chrome/browser/chromeos/status/network_menu.cc
index dbcbfe42bcde0c41d280ef18da8ba23836e7313f..24085751a4d33fb6445a472e1ee3f755fa0e36f3 100644
--- a/chrome/browser/chromeos/status/network_menu.cc
+++ b/chrome/browser/chromeos/status/network_menu.cc
@@ -23,7 +23,8 @@ namespace chromeos {
const int NetworkMenu::kNumWifiImages = 9;
NetworkMenu::NetworkMenu()
- : ALLOW_THIS_IN_INITIALIZER_LIST(network_menu_(this)) {
+ : ALLOW_THIS_IN_INITIALIZER_LIST(network_menu_(this)),
+ min_width_(-1) {
}
NetworkMenu::~NetworkMenu() {
@@ -167,6 +168,8 @@ void NetworkMenu::ActivatedAt(int index) {
}
void NetworkMenu::SetFirstLevelMenuWidth(int width) {
+ min_width_ = width;
+ // This actually has no effect since menu is rebuilt before showing.
network_menu_.SetMinimumWidth(width);
}
@@ -239,6 +242,11 @@ void NetworkMenu::RunMenu(views::View* source, const gfx::Point& pt) {
InitMenuItems();
network_menu_.Rebuild();
network_menu_.UpdateStates();
+ // Restore menu width, if it was set up.
+ // NOTE: width isn't checked for correctness here since all width-related
+ // logic implemented inside |network_menu_|.
+ if (min_width_ != -1)
+ network_menu_.SetMinimumWidth(min_width_);
refreshing_menu_ = false;
network_menu_.RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
}
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698