Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-39736

Android: options menu without native ActionBar

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • 5.4.0 Beta
    • None
    • Quick: Controls 1
    • None
    • Android

    • Android
    • 3b577dfe798bf5065a2bba4d7095709454aa709c

    Description

      Short version:
      Qt Quick Controls need a way to hide the native ActionBar and show the options menu aligned to a non-native ActionBar.

      Long version:
      In Qt Quick Controls, ToolBar is an ordinary item that can have arbitrary content. There's no way for us to transfer/map the ToolBar contents to a native ActionBar. Therefore Qt Quick Controls want to hide the native ActionBar and let ToolBar draw it. This way applications can have a ToolBar with arbitrary content (such as search fields, progress bars and whatsoever), which is very common in native Android applications.

      Hiding the native ActionBar is of course not free of problems. Hiding it also means that the built-in options menu doesn't show up in the desired position. Since there's no visible ActionBar, Activity::openOptionsMenu() pops up the options menu in the top left corner. Notice that ContextMenu is not usable for this purpose either, since it gets shown in the middle of the screen and dims the background => visually quite different than what the options menu is supposed to look like.

      Proposal:
      PopupMenu looks visually similar (same?) than options menu and it can be anchored to a view, so perhaps we could use that when the native ActionBar is hidden? The anchored view could be possibly a temporary view (like they do on iOS, I heard) so it might be possible to position PopupMenu anywhere we want.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              taipan BogDan Vatra
              jpnurmi J-P Nurmi
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes