Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from benlau/DEV
Browse files Browse the repository at this point in the history
Merge from development branch
  • Loading branch information
benlau committed Sep 3, 2015
2 parents 89549a3 + 3a3fdf7 commit 6fbdc80
Show file tree
Hide file tree
Showing 73 changed files with 1,188 additions and 269 deletions.
38 changes: 15 additions & 23 deletions QuickAndroid/ActionBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Item {

property bool upEnabled : false

property string icon
property string iconSource

property ActionBarStyle style : ActionBarStyle {
icon : Style.theme.actionBar.icon
iconSource : Style.theme.actionBar.iconSource
background: Style.theme.actionBar.background
actionButtonBackground: Style.theme.actionBar.actionButtonBackground
titleTextStyle: Style.theme.actionBar.titleTextStyle
Expand All @@ -41,13 +41,6 @@ Item {
width : 480
height: A.dp * 48

anchors.top: parent.top
anchors.topMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0

Drawable {
id : bg
anchors.fill: parent
Expand All @@ -61,11 +54,9 @@ Item {
QuickButton {
id : actionButton
objectName : "ActionButton"
anchors.top : parent.top
anchors.left: parent.left
width : show ? Math.min(implicitWidth , menuBarRegion.x) : 0
implicitWidth: titleText.x + (titleText.implicitWidth + 8 * A.dp) * showTitle
height : 48 * A.dp
height : actionBar.height
background: actionBar.style.actionButtonBackground
clip : true

Expand All @@ -87,30 +78,31 @@ Item {

Image {
id : home
width: showIcon && actionBar.style.icon || actionBar.icon ? height : 0
width: show ? height : 0
height: 32 * A.dp
anchors.left: up.right
anchors.leftMargin: actionBar.style.homeMarginLeft * A.dp
x: Math.max(actionBar.style.keyline1 * A.dp,up.x + up.width)
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
asynchronous: true
source: actionBar.icon ? actionBar.icon : actionBar.style.icon
source: actionBar.iconSource ? actionBar.iconSource : actionBar.style.iconSource
sourceSize: Qt.size(32 * A.dp,32 * A.dp)

property bool show: showIcon && actionBar.style.iconSource || actionBar.iconSource
}

Text {
id : titleText
text: "Application Title"

property int keyline: (home.show ? actionBar.style.keyline2 : actionBar.style.keyline1 ) * A.dp

x: keyline
verticalAlignment: Text.AlignVCenter
wrapMode : Text.NoWrap
maximumLineCount:1
visible : showTitle

anchors.left: home.right
anchors.leftMargin: 8 * A.dp
elide: Text.ElideRight
visible: showTitle
anchors.verticalCenter: parent.verticalCenter
// horizontalAlignment: paintedWidth < width ? Text.AlignHCenter : Text.AlignLeft
horizontalAlignment : Text.AlignLeft

color : actionBar.style.titleTextStyle.textColor
Expand Down Expand Up @@ -146,8 +138,8 @@ Item {
Component.onCompleted: {
if (!actionBar.icon &&
Global.application &&
Global.application.icon) {
actionBar.icon = Global.application.icon
Global.application.iconSource) {
actionBar.iconSource = Global.application.iconSource
}

}
Expand Down
2 changes: 1 addition & 1 deletion QuickAndroid/Application.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FocusScope {

property Theme theme

property var icon
property var iconSource
property var current;
property var history : new Array

Expand Down
77 changes: 77 additions & 0 deletions QuickAndroid/FloatingActionButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import QtQuick 2.0
import QtQuick.Controls 1.2 as Controls
import QtQuick.Controls.Styles 1.2 as ControlStyles
import QtGraphicalEffects 1.0
import QuickAndroid 0.1
import QuickAndroid.style 0.1

Controls.Button {
id: component

width: 56 * A.dp
height: 56 * A.dp

property color color : Style.theme.colorPrimary
property int depth: 1

style: ControlStyles.ButtonStyle {
background: Item {

RectangularGlow {
id: shadow
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
height: parent.height
color: "#606060"

cornerRadius: width / 2

glowRadius: 0.1 * A.dp
anchors.verticalCenterOffset: 1 * A.dp

spread: 0.8

Binding { target: shadow; property: "glowRadius"; when: component.depth === 2; value: 0.1 * A.dp;}
Binding { target: shadow; property: "spread"; when: component.depth === 2; value: 0.4;}
Binding { target: shadow; property: "anchors.verticalCenterOffset"; when: component.depth === 2; value: 10 * A.dp;}

Binding { target: shadow; property: "glowRadius"; when: component.depth === 3; value: 0.2 * A.dp;}
Binding { target: shadow; property: "spread"; when: component.depth === 3; value: 0.2;}
Binding { target: shadow; property: "anchors.verticalCenterOffset"; when: component.depth === 3; value: 10 * A.dp;}

Binding { target: shadow; property: "glowRadius"; when: component.depth === 4; value: 0.3 * A.dp;}
Binding { target: shadow; property: "spread"; when: component.depth === 4; value: 0.1;}
Binding { target: shadow; property: "anchors.verticalCenterOffset"; when: component.depth === 4; value: 10 * A.dp;}

Binding { target: shadow; property: "glowRadius"; when: component.depth === 5; value: 0.6 * A.dp;}
Binding { target: shadow; property: "spread"; when: component.depth === 5; value: 0;}
Binding { target: shadow; property: "anchors.verticalCenterOffset"; when: component.depth === 5; value: 10 * A.dp;}

}

Rectangle {
id: circle
anchors.centerIn: parent
width: parent.width
height: parent.height
color: component.color
radius: width / 2
}

Rectangle {
id: mask
anchors.centerIn: parent
width: parent.width
height: parent.height
color: "#1F000000"
radius: width / 2
visible: component.pressed
}

}

}

}

8 changes: 8 additions & 0 deletions QuickAndroid/ListItem.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import QtQuick 2.0
import QuickAndroid 0.1
import "./priv"

BaseListItem {
height: subtitle === "" ? 48 * A.dp : 72 * A.dp
}

1 change: 0 additions & 1 deletion QuickAndroid/Text.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Quick.Text {

property alias gravity : textBehaviour.gravity


TextBehaviour {
id: textBehaviour
}
Expand Down
9 changes: 0 additions & 9 deletions QuickAndroid/drawable/DividerHorizontalHoloLight.qml

This file was deleted.

9 changes: 9 additions & 0 deletions QuickAndroid/drawable/ListDivider.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import QtQuick 2.0
import QuickAndroid.def 0.1
import QuickAndroid 0.1

Rectangle {
height: 1 * A.dp
color : Color.black12
}

2 changes: 1 addition & 1 deletion QuickAndroid/drawable/qmldir
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuickAndroid.drawable
BtnDefault 0.1 BtnDefault.qml
BtnDropdown 0.1 BtnDropdown.qml
DividerHorizontalHoloLight 0.1 DividerHorizontalHoloLight.qml
ListDivider 0.1 ListDivider.qml
ItemBackgroundHoloLight 0.1 ItemBackgroundHoloLight.qml
ListSelectorHoloLight 0.1 ListSelectorHoloLight.qml
MenuDropdownPanelHoloLight 0.1 MenuDropdownPanelHoloLight.qml
Expand Down
17 changes: 4 additions & 13 deletions QuickAndroid/item/DropDownList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,19 @@ Item {
style.textStyle: dropDownList.style.textStyle
gravity: "left"

Drawable {
source: dropDownList.style.divider
anchors.bottom: parent.bottom
Loader {
anchors.left: parent.left
anchors.right: parent.right
height : 1 * A.dp
anchors.bottom: parent.bottom
sourceComponent: dropDownList.style.divider
}

}

function itemAt(index){
return repeater.itemAt(index)
}

Item {
id : styleItem
property var background
property var verticalOffset
property var textStyle
property var divider
property var button
}

Drawable {
id : background
source: style.background
Expand Down
Loading

0 comments on commit 6fbdc80

Please sign in to comment.