Commit ce10c2e2 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

ChromeOS: Don't add spacing between caption buttons

After [1], dynamic refresh is the default MD mode on ChromeOS so the UI switches
between touchable and non-touchable UI depending on the tablet mode state.
Since the frame caption buttons are hidden when in tablet mode, there's no
longer a need to change the tablet mode spacing depending on the tablet mode
state: we just always use 0 spacing.

This fixes an issue where a browser window gets created when in touchable UI
mode (but the frame caption buttons are not shown) and then when the UI changes
to non-touchable mode, the spacing between buttons is not updated to 0, but the
buttons are shown.

[1] https://chromium.googlesource.com/chromium/src/+/63bf489f5d0038b1208c2439a1140910d263e9dc

BUG=881371

Change-Id: Ifa76428abe266aaddc2ba9c946a213060a630713
Reviewed-on: https://chromium-review.googlesource.com/c/1283942Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600161}
parent d5f73ba8
...@@ -158,12 +158,8 @@ FrameCaptionButtonContainerView::FrameCaptionButtonContainerView( ...@@ -158,12 +158,8 @@ FrameCaptionButtonContainerView::FrameCaptionButtonContainerView(
: frame_(frame), : frame_(frame),
delegate_(delegate), delegate_(delegate),
model_(std::make_unique<DefaultCaptionButtonModel>(frame)) { model_(std::make_unique<DefaultCaptionButtonModel>(frame)) {
constexpr int kTouchOptimizedCaptionButtonsSpacing = 8; auto layout =
auto layout = std::make_unique<views::BoxLayout>( std::make_unique<views::BoxLayout>(views::BoxLayout::kHorizontal);
views::BoxLayout::kHorizontal, gfx::Insets(),
ui::MaterialDesignController::IsTouchOptimizedUiEnabled()
? kTouchOptimizedCaptionButtonsSpacing
: 0);
layout->set_cross_axis_alignment( layout->set_cross_axis_alignment(
views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_END); layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_END);
......
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