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

Commit

Permalink
Fixes private mode and bookmarks dimming issues (#1671)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Aug 27, 2019
1 parent 13c32ec commit 686fdbe
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public class WindowWidget extends UIWidget implements SessionChangeListener,
boolean mActive = false;
boolean mHovered = false;
boolean mClickedAfterFocus = false;
boolean mIsBookmarksVisible = false;

public interface WindowDelegate {
void onFocusRequest(@NonNull WindowWidget aWindow);
Expand Down Expand Up @@ -281,11 +282,13 @@ public void switchBookmarks() {
setView(mBookmarksView);
for (BookmarkListener listener : mBookmarksListeners)
listener.onBookmarksShown(this);
mIsBookmarksVisible = true;

} else {
unsetView(mBookmarksView);
for (BookmarkListener listener : mBookmarksListeners)
listener.onBookmarksHidden(this);
mIsBookmarksVisible = false;
}

updateTitleBar();
Expand Down Expand Up @@ -684,6 +687,17 @@ public void setVisible(boolean aVisible) {
return;
}
mWidgetPlacement.visible = aVisible;
if (!aVisible) {
if (mIsBookmarksVisible) {
mWidgetManager.popWorldBrightness(this);
}

} else {
if (mIsBookmarksVisible) {
mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);
}
}
mIsBookmarksVisible = isBookmarksVisible();
mWidgetManager.updateWidget(this);
if (!aVisible) {
clearFocus();
Expand Down

0 comments on commit 686fdbe

Please sign in to comment.