Skip to content

Commit

Permalink
Merged in Sfiet_Konstantin/base-sociald/facebook-eventfeed (pull requ…
Browse files Browse the repository at this point in the history
…est #32)


Polish event feed
  • Loading branch information
SfietKonstantin committed Aug 6, 2013
2 parents 4fdca83 + 95f3682 commit 00de0e9
Show file tree
Hide file tree
Showing 15 changed files with 749 additions and 577 deletions.
1 change: 1 addition & 0 deletions rpm/sociald.spec
Expand Up @@ -40,6 +40,7 @@ A daemon process which provides data synchronization with various social service
%{_datadir}/translations/sociald_eng_en.qm
%{_datadir}/translations/lipstick-jolla-home-facebook_eng_en.qm
%{_datadir}/lipstick/eventfeed/facebook.qml
%{_datadir}/lipstick/eventfeed/shared/*.qml

%package ts-devel
Summary: Translation source for sociald
Expand Down
28 changes: 28 additions & 0 deletions src/eventfeed/Body.qml
@@ -0,0 +1,28 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

Column {
property alias text: body.text
property alias time: time.text
anchors {
left: parent.left
right: parent.right
}

Label {
id: body
anchors {
left: parent.left
right: parent.right
}
color: Theme.highlightColor
wrapMode: Text.WordWrap
font.pixelSize: Theme.fontSizeSmall
}
Label {
id: time
color: Theme.highlightColor
opacity: 0.6
font.pixelSize: Theme.fontSizeExtraSmall
}
}
26 changes: 26 additions & 0 deletions src/eventfeed/Face.qml
@@ -0,0 +1,26 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

Image {
id: container
property string icon
width: Theme.itemSizeExtraLarge
height: Theme.itemSizeExtraLarge
sourceSize {
width: Theme.itemSizeExtraLarge
height: Theme.itemSizeExtraLarge
}
asynchronous: true
fillMode: Image.PreserveAspectCrop
source: {
if (container.icon == "") {
return container.icon
} else if (container.icon == 0) {
return container.icon
} else if (container.icon.indexOf("/") == 0) {
return "image://nemoThumbnail/" + container.icon
} else {
return "image://theme/" + container.icon
}
}
}
105 changes: 105 additions & 0 deletions src/eventfeed/MediaRow.qml
@@ -0,0 +1,105 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

Item {
id: container
property variant imageList
property string mediaName
property string mediaCaption
property string mediaDescription

anchors {
left: parent.left
right: parent.right
}

height: childrenRect.height
visible: imageList.length > 0

Rectangle {
anchors.fill: parent
gradient: Gradient {
GradientStop { position: 0; color: Theme.rgba(Theme.highlightColor, 0) }
GradientStop { position: 1; color: Theme.rgba(Theme.highlightColor, 0.05) }
}
}

Row {
anchors {
left: parent.left
right: parent.right
}

Repeater {
id: repeater
property real imageSize: container.imageList.length <= 2 ? container.width / 2
: container.width / 4
model: container.imageList

delegate: Image {
width: repeater.imageSize
height: repeater.imageSize
sourceSize {
width: repeater.imageSize
height: repeater.imageSize
}
asynchronous: true
fillMode: Image.PreserveAspectCrop
source: {
if (container.imageList[index] == "") {
return container.imageList[index]
} else if (container.imageList[index].indexOf("http") == 0) {
return container.imageList[index]
} else if (container.imageList[index].indexOf("/") == 0) {
return "image://nemoThumbnail/" + container.imageList[index]
} else {
return "image://theme/" + container.imageList[index]
}
}
}
}

Item {
width: repeater.imageSize
height: repeater.imageSize
visible: container.imageList.length === 1

Label {
anchors {
top: parent.top
topMargin: Theme.paddingMedium
left: parent.left
leftMargin: Theme.paddingMedium
right: parent.right
rightMargin: Theme.paddingMedium
bottom: caption.top
bottomMargin: Theme.paddingSmall
}
text: container.mediaName
font.pixelSize: Theme.fontSizeSmall
wrapMode: Text.WordWrap
elide: Text.ElideRight
}

Label {
id: caption
anchors {
bottom: parent.bottom
bottomMargin: Theme.paddingMedium
left: parent.left
leftMargin: Theme.paddingMedium
right: parent.right
rightMargin: Theme.paddingMedium
}
text: container.mediaCaption
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeExtraSmall
wrapMode: Text.WordWrap
elide: Text.ElideRight
maximumLineCount: 1
}
}
}
}


29 changes: 29 additions & 0 deletions src/eventfeed/SocialButton.qml
@@ -0,0 +1,29 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

MouseArea {
id: container
property alias icon: icon.source
property alias text: label.text
height: label.height + 2 * Theme.paddingLarge
width: icon.width + Theme.paddingSmall + label.width

Image {
id: icon
anchors.verticalCenter: parent.verticalCenter
height: 32
width: 32
opacity: container.enabled ? 1 : 0.5
}

Label {
id: label
anchors {
left: icon.right
leftMargin: Theme.paddingSmall
verticalCenter: parent.verticalCenter
}
color: container.pressed ? Theme.highlightColor : Theme.primaryColor
opacity: container.enabled ? 1 : 0.5
}
}

0 comments on commit 00de0e9

Please sign in to comment.