Open image in preview card

This commit is contained in:
Morgan McMillian 2017-11-16 12:35:30 -08:00
parent 3ec3521b38
commit 6f41f3b948
6 changed files with 27 additions and 25 deletions

View file

@ -154,7 +154,8 @@ Container {
// TODO: add tab to open full image in a page
horizontalAlignment: HorizontalAlignment.Center
bottomMargin: ui.sdu(2.0)
ImageView {
ImageButton {
id: pimage
visible: {
var isphoto = false
if (typeof ListItemData.raw !== "undefined") {
@ -168,9 +169,10 @@ Container {
}
return isphoto
}
scalingMethod: ScalingMethod.AspectFit
//imageSource: "asset:///icons/laughing_man.png"
image: ptracker.image
defaultImage: ptracker.image
onClicked: {
postitem.ListItem.view.showImage(ptracker.imageSource)
}
attachedObjects: [
NetImageTracker {
id: ptracker

View file

@ -122,10 +122,8 @@ NavigationPane {
function copyText(text) {
_app.copyText(text)
}
function showImage(filename, mtype) {
console.log('-- showImage --')
console.log(filename)
_app.showImage(filename, mtype)
function showImage(filename) {
_app.showImage(filename)
}
attachedObjects: [
ListScrollStateHandler {

View file

@ -66,6 +66,9 @@ Page {
return false
}
}
function showImage(filename) {
_app.showImage(filename)
}
attachedObjects: [
NetImageManager {
id: feedImageManager

View file

@ -123,7 +123,7 @@ void ApplicationUI::onInvoke(const bb::system::InvokeRequest& request)
}
}
void ApplicationUI::showImage(const QString& filename, const QString& mtype)
void ApplicationUI::showImage(const QString& filename)
{
qDebug() << "showImage called!";
bb::system::InvokeManager manager;
@ -132,7 +132,6 @@ void ApplicationUI::showImage(const QString& filename, const QString& mtype)
request.setUri(QUrl::fromLocalFile(filename));
request.setTarget("sys.pictures.card.previewer");
request.setAction("bb.action.VIEW");
request.setMimeType(mtype);
bb::system::InvokeTargetReply *targetReply = manager.invoke(request);
manager.setParent(this);

View file

@ -48,7 +48,7 @@ public:
Q_INVOKABLE void setSetting(const QString &key, const QString &value);
Q_INVOKABLE QString appversion();
Q_INVOKABLE void copyText(QByteArray text);
Q_INVOKABLE void showImage(const QString &filename, const QString &mtype);
Q_INVOKABLE void showImage(const QString &filename);
Q_SIGNALS:
void createPost(QByteArray text);

View file

@ -43,52 +43,52 @@
<context>
<name>PostItem</name>
<message>
<location filename="../assets/PostItem.qml" line="220"/>
<location filename="../assets/PostItem.qml" line="222"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="229"/>
<location filename="../assets/PostItem.qml" line="231"/>
<source>Reply All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="239"/>
<location filename="../assets/PostItem.qml" line="241"/>
<source>Delete Bookmark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="239"/>
<location filename="../assets/PostItem.qml" line="241"/>
<source>Add Bookmark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="250"/>
<location filename="../assets/PostItem.qml" line="252"/>
<source>Delete Repost</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="250"/>
<location filename="../assets/PostItem.qml" line="252"/>
<source>Repost</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="261"/>
<location filename="../assets/PostItem.qml" line="263"/>
<source>Quote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="270"/>
<location filename="../assets/PostItem.qml" line="272"/>
<source>View Profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="277"/>
<location filename="../assets/PostItem.qml" line="279"/>
<source>Copy text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="307"/>
<location filename="../assets/PostItem.qml" line="309"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
@ -203,22 +203,22 @@
<context>
<name>StreamTab</name>
<message>
<location filename="../assets/StreamTab.qml" line="157"/>
<location filename="../assets/StreamTab.qml" line="155"/>
<source>New Post</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="171"/>
<location filename="../assets/StreamTab.qml" line="169"/>
<source>To Top</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="199"/>
<location filename="../assets/StreamTab.qml" line="197"/>
<source>To Bottom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="186"/>
<location filename="../assets/StreamTab.qml" line="184"/>
<source>Reload</source>
<translation type="unfinished"></translation>
</message>