~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarStyle.qml

  • Committer: CI Train Bot
  • Author(s): Christian Dywan, Zsombor Egri, Zoltán Balogh, Tim Peeters, Albert Astals Cid, Michael Sheldon, Benjamin Zeller
  • Date: 2015-12-17 17:13:49 UTC
  • mfrom: (1000.739.27 OTA9-landing-2015-12-16)
  • Revision ID: ci-train-bot@canonical.com-20151217171349-8xwclnhnx8v9oz4m
OTA9-landing-2015-12-16
Approved by: Zoltan Balogh

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 */
16
16
import QtQuick 2.4
 
17
import QtQuick.Window 2.2
17
18
import Ubuntu.Components 1.3
18
 
 
19
 
Item {
20
 
    id: visuals
21
 
    // styling properties
22
 
    property color color: theme.palette.normal.overlay
23
 
 
24
 
    anchors.fill: parent
25
 
 
26
 
    Rectangle {
27
 
        id: background
28
 
        anchors.fill: parent
29
 
        color: visuals.color
30
 
    }
31
 
 
32
 
    Image {
33
 
        id: dropshadow
34
 
        anchors {
35
 
            left: parent.left
36
 
            right: parent.right
37
 
            bottom: background.top
38
 
        }
39
 
        source: Qt.resolvedUrl("../artwork/toolbar_dropshadow.png")
40
 
        opacity: styledItem.opened || styledItem.animating ? 0.5 : 0.0
41
 
        Behavior on opacity {
42
 
            UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
43
 
        }
 
19
import Ubuntu.Components.Styles 1.3 as Style
 
20
 
 
21
Style.ToolbarStyle {
 
22
    id: toolbarStyle
 
23
    implicitWidth: parent ? parent.width : 0
 
24
    // reduce toolbar height on phone in landscape orientation:
 
25
    implicitHeight: Screen.height > units.gu(50) ? units.gu(4) : units.gu(3)
 
26
 
 
27
    /*!
 
28
      The default action delegate if the styled item does
 
29
      not provide a delegate.
 
30
     */
 
31
    defaultDelegate: AbstractButton {
 
32
        style: IconButtonStyle { }
 
33
        objectName: action.objectName + "_button"
 
34
        height: parent ? parent.height : undefined
 
35
        width: units.gu(4)
 
36
        action: modelData
44
37
    }
45
38
}