Skip to content

Commit

Permalink
Fixes Igalia#1494
Browse files Browse the repository at this point in the history
Add a Fullscreen item in the hamburger menu to set the current window in the fullscreen mode. This item will not be available in kiosk mode.
  • Loading branch information
haanhvu committed Nov 18, 2024
1 parent 86abf88 commit 9f55776
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,11 @@ public void onResize() {
enterResizeMode();
}

@Override
public void onFullScreen() {
mAttachedWindow.setIsFullScreen(true);
}

@Override
public void onPassthrough() {
mWidgetManager.togglePassthrough();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public interface MenuDelegate {
void onPageZoomIn();
void onPageZoomOut();
int getCurrentZoomLevel();
void onFullScreen();
}

public static final int SWITCH_ITEM_ID = 0;
Expand Down Expand Up @@ -189,6 +190,18 @@ private void updateItems() {

// In kiosk mode, only resize, find in page and passthrough are available.
if (!mWidgetManager.getFocusedWindow().isKioskMode()) {
mItems.add(new HamburgerMenuAdapter.MenuItem.Builder(
HamburgerMenuAdapter.MenuItem.TYPE_DEFAULT,
(menuItem) -> {
if (mDelegate != null) {
mDelegate.onFullScreen();
}
return null;
})
.withTitle(getContext().getString(R.string.hamburger_menu_fullscreen))
.withIcon(R.drawable.fullscreen_button)
.build());

final Session activeSession = SessionStore.get().getActiveSession();

if (!BuildConfig.FLAVOR_backend.equals("chromium")) {
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,10 @@ the Select` button. When clicked it bookmarks all the previously selected tabs -
it saves the Web App provided by the current page -->
<string name="hamburger_menu_save_web_app">Save Web app…</string>

<!-- This string is displayed inside the Hamburger menu at the right of the navigation bar. When clicked
it put the current window in fullscreen mode -->
<string name="hamburger_menu_fullscreen">Fullscreen</string>

<!-- This string is displayed in the tooltip that is displayed when the user hovers the hamburger menu icon -->
<string name="hamburger_menu_tooltip">Menu</string>

Expand Down

0 comments on commit 9f55776

Please sign in to comment.