← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1481147] Re: actons does not show in MainView

 

I think you misunderstood the API (or wrongly guessed its purpose).
MainView.actions is a list of actions globally available in the app,
originally incepted for the HUD. If you want actions to show in the
header, you actually need to use Page.head.actions.

** Changed in: ubuntu-ui-toolkit (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to ubuntu-ui-toolkit in Ubuntu.
https://bugs.launchpad.net/bugs/1481147

Title:
  actons does not show in MainView

Status in ubuntu-ui-toolkit package in Ubuntu:
  Invalid

Bug description:
  I created a very simple MainView app, and I got an action in the
  MainView. The actions do not show up:

  import QtQuick 2.0
  import Ubuntu.Components 1.1

  /*!
      \brief MainView with a Label and Button elements.
  */

  MainView {
      // objectName for functional testing purposes (autopilot-qt5)
      objectName: "mainView"

      // Note! applicationName needs to match the "name" field of the click manifest
      applicationName: "maiviewactions.liu-xiao-guo"

      /*
       This property enables the application to change orientation
       when the device is rotated. The default is false.
      */
      //automaticOrientation: true

      // Removes the old toolbar and enables new features of the new header.
      useDeprecatedToolbar: false

      width: units.gu(60)
      height: units.gu(85)

      actions: [
          Action  {
              objectName: "action"

              // iconSource: Qt.resolvedUrl("images/avatar.jpg")
              iconName: "active-call"

              onTriggered: {
                  console.log("action is clicked!");
              }
          }
      ]

      Page {
          title: i18n.tr("maiviewactions")

          Label {
              anchors.centerIn: parent
              text: "this is the label"
          }

      }
  }

  Thanks & best regards,
  XiaoGuo

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1481147/+subscriptions


References