Browse Source

WIP

Change-Id: I67afc98367807103f4e8fa483108de72306e0247
Donald Carr 5 years ago
parent
commit
e6155e50ef
3 changed files with 18 additions and 7 deletions
  1. 11 4
      qml/common/ArtImage.qml
  2. 1 0
      qml/main.qml
  3. 6 3
      src/main.cpp

+ 11 - 4
qml/common/ArtImage.qml

@@ -3,7 +3,7 @@ import PictureModel 1.0
 
 import ".."
 
-Item {
+Rectangle {
     id: root
     property var effect
     property int modelIndex
@@ -11,7 +11,7 @@ Item {
     property alias asynchronous: image.asynchronous
     property alias source: image.source
 
-    //color: Qt.rgba(Math.random(255), Math.random(255), Math.random(255), 1.0)
+    color: Qt.rgba(Math.random(255), Math.random(255), Math.random(255), 1.0)
 
     height: width*nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).height/nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).width
     width: parent ? parent.width : 0
@@ -21,8 +21,15 @@ Item {
         cache: false
         opacity: globalSettings.fadeInImages ? 0 : 1.0
 
-        height: globalVars.imageWidthOverride > 0 ? Math.ceil(globalVars.imageWidthOverride*nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).height/nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).width) : nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).height
-        width: globalVars.imageWidthOverride > 0 ? globalVars.imageWidthOverride : nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).width
+        height: (globalVars.imageWidthOverride > 0
+                 ? Math.ceil(globalVars.imageWidthOverride*nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).height/nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).width)
+                 : nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).height
+                 )
+
+        width: (globalVars.imageWidthOverride > 0
+                ? globalVars.imageWidthOverride
+                : nativeUtils.imageCollection.data(modelIndex, PictureModel.SizeRole).width
+                )
 
         transformOrigin: Item.TopLeft
         scale: root.width/image.width

+ 1 - 0
qml/main.qml

@@ -85,6 +85,7 @@ Item {
         property int columnCount: 8
         property int interval: 5
         property int itemLimit: -1
+        property int artFrameWidth: 1
 
         property string effect: ""
         property string artView: "Trivial"

+ 6 - 3
src/main.cpp

@@ -120,7 +120,7 @@ ArtView::ArtView(QScreen *screen)
 {
     QSettings settings;
 
-    prioritizeRemoteCopy = settings.value("prioritizeRemoteServer", true).toBool();
+    prioritizeRemoteCopy = settings.value("prioritizeRemoteServer", false).toBool();
     settings.setValue("prioritizeRemoteServer", prioritizeRemoteCopy);
 
     // "http://localhost:8000/qml"
@@ -166,8 +166,11 @@ ArtView::ArtView(QScreen *screen)
         view->setColor(Qt::black);
     }
     view->setResizeMode(QQuickView::SizeRootObjectToView);
-    view->setSource(QUrl(webPath + "/main.qml"));
-
+    if (prioritizeRemoteCopy) {
+        view->setSource(QUrl(webPath + "/main.qml"));
+    } else {
+        view->setSource(QUrl(localPath + "/main.qml"));
+    }
     // Does the same thing as showFullScreen for broken backends which dont impl showFS
     view->setGeometry(geometry);
     // Ideally bypasses compositing