/*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
import QtQuick 2.4
import "internalPopupUtils.js" as InternalPopupUtils
import Lomiri.Components 1.3
/*!
\qmltype Popover
\inherits PopupBase
\inqmlmodule Lomiri.Components.Popups 1.0
\ingroup lomiri-popups
\brief A popover allows an application to present additional content without changing the view.
A popover has a fixed width and automatic height, depending on is contents.
It can be closed by clicking anywhere outside of the popover area.
\l {https://design.lomiri.com/apps/building-blocks/dialog#popover}{See also the Design Guidelines on Popovers}.
Example:
\qml
import QtQuick 2.4
import Lomiri.Components 1.3
import Lomiri.Components.Popups 1.3
import Lomiri.Components.ListItems 1.3 as Old_ListItem
Rectangle {
color: theme.palette.normal.background
width: units.gu(80)
height: units.gu(80)
Component {
id: popoverComponent
Popover {
id: popover
Column {
id: containerLayout
anchors {
left: parent.left
top: parent.top
right: parent.right
}
// there is no equivalent yet to ListItem.Header
Old_ListItem.Header { text: "Standard list items" }
ListItem {
// shall specify the height when Using ListItemLayout inside ListItem
height: somethingLayout.height + (divider.visible ? divider.height : 0)
ListItemLayout {
id: somethingLayout
title.text: "Do somethings"
}
onClicked: console.log("clicked on ListItem with onClicked implemented")
}
ListItem {
// shall specify the height when Using ListItemLayout inside ListItem
height: somethingElseLayout.height + (divider.visible ? divider.height : 0)
ListItemLayout {
id: somethingElseLayout
title.text: "Do somethings"
subtitle.text: "else"
}
}
ListItem {
// shall specify the height when Using ListItemLayout inside ListItem
height: closeBtn.height + (divider.visible ? divider.height : 0)
Button {
id: closeBtn
text: "Close button"
onClicked: PopupUtils.close(popover);
}
}
}
}
}
Button {
id: popoverButton
anchors.centerIn: parent
text: "open"
onClicked: PopupUtils.open(popoverComponent, popoverButton)
}
}
\endqml
*/
PopupBase {
id: popover
/*!
\qmlproperty list