Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Grey out window when resizing (#3525)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Jun 24, 2020
1 parent b58cb6d commit fa52ca1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ private void enterResizeMode() {
if (mAttachedWindow.isResizing()) {
return;
}
mAttachedWindow.mWidgetPlacement.tintColor = Windows.GRAY;
mAttachedWindow.setIsResizing(true);
mAttachedWindow.saveBeforeResizePlacement();
startWidgetResize();
Expand Down Expand Up @@ -746,6 +747,8 @@ private void enterResizeMode() {
}
}

mWidgetManager.updateWidget(mAttachedWindow);

// Update preset styles
}

Expand All @@ -760,7 +763,6 @@ private void exitResizeMode(ResizeAction aResizeAction) {
}
if (aResizeAction == ResizeAction.RESTORE_SIZE) {
mAttachedWindow.restoreBeforeResizePlacement();
mWidgetManager.updateWidget(mAttachedWindow);
mWidgetManager.updateVisibleWidgets();
}
mAttachedWindow.setIsResizing(false);
Expand All @@ -779,6 +781,9 @@ private void exitResizeMode(ResizeAction aResizeAction) {
TelemetryWrapper.windowsResizeEvent();
GleanMetricsService.windowsResizeEvent();
}

mAttachedWindow.mWidgetPlacement.tintColor = Windows.WHITE;
mWidgetManager.updateWidget(mAttachedWindow);
}

private void enterVRVideo(@VideoProjectionMenuWidget.VideoProjectionFlags int aProjection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public class WindowWidget extends UIWidget implements SessionChangeListener,
private int mWidth;
private int mHeight;
private int mHandle;
private WidgetPlacement mWidgetPlacement;
private TopBarWidget mTopBar;
private TitleBarWidget mTitleBar;
private WidgetManagerDelegate mWidgetManager;
Expand Down Expand Up @@ -1578,8 +1577,8 @@ private void hideContextMenus() {
mSelectionMenu = null;
}

if (mWidgetPlacement.tintColor != 0xFFFFFFFF) {
mWidgetPlacement.tintColor = 0xFFFFFFFF;
if (mWidgetPlacement.tintColor != Windows.WHITE) {
mWidgetPlacement.tintColor = Windows.WHITE;
mWidgetManager.updateWidget(this);
}
}
Expand Down Expand Up @@ -1662,7 +1661,7 @@ public void onContextMenu(GeckoSession session, int screenX, int screenY, Contex
}
mContextMenu.show(REQUEST_FOCUS);

mWidgetPlacement.tintColor = 0x555555FF;
mWidgetPlacement.tintColor = Windows.GRAY;
mWidgetManager.updateWidget(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class Windows implements TrayListener, TopBarWidget.Delegate, TitleBarWid

private static final String LOGTAG = SystemUtils.createLogtag(Windows.class);

public static final int WHITE = 0xFFFFFFFF;
public static final int GRAY = 0x555555FF;

@IntDef(value = { OPEN_IN_FOREGROUND, OPEN_IN_BACKGROUND, OPEN_IN_NEW_WINDOW})
public @interface NewTabLocation {}
public static final int OPEN_IN_FOREGROUND = 0;
Expand Down

0 comments on commit fa52ca1

Please sign in to comment.