Commit 22cf225b authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Desktop PWAs: Avoid clipping minimal-ui icons when launched maximized

The minimal-ui buttons' preferred insets and sizes were being cached
before the kInternalPaddingKey property was set. This led to the Back
button being too small during the initial layout if a web app initially
opened maximized.

We now set the kInternalPaddingKey property first, before setting
layout insets.

Bug: 1040792
Change-Id: I09ff4383124d304bf71ec0d3ff6e5fc9ccb6c9ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2000444Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#731864}
parent eeea9224
......@@ -138,10 +138,12 @@ int WebAppFrameRightMargin() {
void SetInsetsForWebAppToolbarButton(ToolbarButton* toolbar_button,
bool is_browser_focus_mode) {
if (!is_browser_focus_mode) {
toolbar_button->SetLayoutInsets(gfx::Insets(2));
// We set the kInternalPaddingKey property first, as SetLayoutInsets caches
// the resulting total insets.
constexpr gfx::Insets kInkDropInsets(2);
toolbar_button->SetProperty(views::kInternalPaddingKey, kInkDropInsets);
toolbar_button->SetLayoutInsets(gfx::Insets(2));
}
}
......
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