Commit af34e503 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Remove trick of padding for subtitled network title view

It seems this causes repositions of the toggle buttons when
subtitles are set / cleared.

Bug: 823656
Change-Id: Id987bd7f6291d4debdfb17d7fac34daedbe21117
Reviewed-on: https://chromium-review.googlesource.com/978889Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545653}
parent e2cf13fa
......@@ -140,16 +140,6 @@ class NetworkListView::SectionHeaderRowView : public views::View,
void SetSubtitle(int subtitle_id) {
network_row_title_view_->SetSubtitle(subtitle_id);
// The left padding of the toggle is different depending on whether the
// subtitle is displayed.
const int toggle_left_padding = subtitle_id == 0
? kToggleLeftPaddingWithoutSubtitle
: kToggleLeftPaddingWithSubtitle;
const gfx::Insets previous_insets = toggle_->border()->GetInsets();
toggle_->SetBorder(views::CreateEmptyBorder(
gfx::Insets(previous_insets.top(), toggle_left_padding,
previous_insets.bottom(), previous_insets.right())));
}
virtual void SetToggleState(bool toggle_enabled, bool is_on) {
......@@ -188,9 +178,6 @@ class NetworkListView::SectionHeaderRowView : public views::View,
}
private:
static const int kToggleLeftPaddingWithoutSubtitle = 18;
static const int kToggleLeftPaddingWithSubtitle = 8;
void InitializeLayout() {
TrayPopupUtils::ConfigureAsStickyHeader(this);
SetLayoutManager(std::make_unique<views::FillLayout>());
......@@ -233,7 +220,7 @@ namespace {
class MobileHeaderRowView : public NetworkListView::SectionHeaderRowView,
public chromeos::NetworkStateHandlerObserver {
public:
MobileHeaderRowView(NetworkStateHandler* network_state_handler)
explicit MobileHeaderRowView(NetworkStateHandler* network_state_handler)
: SectionHeaderRowView(IDS_ASH_STATUS_TRAY_NETWORK_MOBILE),
network_state_handler_(network_state_handler),
weak_ptr_factory_(this) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment