← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~mrqtros/ubuntu-rssreader-app/ubuntu-rssreader-app-reboot-night-mode into lp:ubuntu-rssreader-app/reboot

 

Roman Shchekin has proposed merging lp:~mrqtros/ubuntu-rssreader-app/ubuntu-rssreader-app-reboot-night-mode into lp:ubuntu-rssreader-app/reboot.

Commit message:
"Dark mode" implemented (like in DocViewer app).

Requested reviews:
  Ubuntu Shorts Developers (ubuntu-rssreader-dev)

For more details, see:
https://code.launchpad.net/~mrqtros/ubuntu-rssreader-app/ubuntu-rssreader-app-reboot-night-mode/+merge/271254

"Dark mode" implemented (like in DocViewer app).
-- 
Your team Ubuntu Shorts Developers is requested to review the proposed merge of lp:~mrqtros/ubuntu-rssreader-app/ubuntu-rssreader-app-reboot-night-mode into lp:ubuntu-rssreader-app/reboot.
=== modified file 'shorts/qml/components/ArticleViewItem.qml'
--- shorts/qml/components/ArticleViewItem.qml	2015-07-19 14:29:20 +0000
+++ shorts/qml/components/ArticleViewItem.qml	2015-09-16 08:53:29 +0000
@@ -65,7 +65,6 @@
         id: rssListview
 
         property int contentFontSize: optionsKeeper.fontSize()
-        property bool contentDarkTheme: optionsKeeper.useDarkTheme()
 
         width: parent.width
         anchors {

=== added file 'shorts/qml/components/DarkModeShader.qml'
--- shorts/qml/components/DarkModeShader.qml	1970-01-01 00:00:00 +0000
+++ shorts/qml/components/DarkModeShader.qml	2015-09-16 08:53:29 +0000
@@ -0,0 +1,17 @@
+import QtQuick 2.3
+
+ShaderEffect {
+        fragmentShader: "
+            uniform lowp sampler2D source;
+            uniform lowp float qt_Opacity;
+            varying highp vec2 qt_TexCoord0;
+
+            void main() {
+                lowp vec4 p = texture2D(source, qt_TexCoord0);
+                p.r = 1.0 - p.r;
+                p.g = 1.0 - p.g;
+                p.b = 1.0 - p.b;
+                gl_FragColor = vec4(vec3(dot(p.rgb, vec3(0.344, 0.5, 0.156))), p.a) * qt_Opacity;
+            }
+        "
+    }

=== modified file 'shorts/qml/components/ReadingOptions.qml'
--- shorts/qml/components/ReadingOptions.qml	2015-07-04 08:38:18 +0000
+++ shorts/qml/components/ReadingOptions.qml	2015-09-16 08:53:29 +0000
@@ -106,7 +106,7 @@
                     if (v < maximumValue / 3)
                         return i18n.tr("Small")
                     else if (v < maximumValue / 3 * 2)
-                        return i18n.tr("Mid")
+                        return i18n.tr("Normal")
                     else return i18n.tr("Large")
                 }
             } // SLider

=== modified file 'shorts/qml/delegates/ArticleFullImg.qml'
--- shorts/qml/delegates/ArticleFullImg.qml	2015-07-19 14:29:20 +0000
+++ shorts/qml/delegates/ArticleFullImg.qml	2015-09-16 08:53:29 +0000
@@ -21,7 +21,6 @@
 //    color: invalid ? "black" : modelItem.status == "1" ? "#55cccccc" : "#5533b5e5"
     color: invalid ? "black" : modelItem.status == "1" ? "#e5e4e5" : "#b0dded"
 
-
     onModelItemChanged: {
         if (modelItem == null) {
             invalid = true

=== modified file 'shorts/qml/pages/ArticleViewPage.qml'
--- shorts/qml/pages/ArticleViewPage.qml	2015-07-19 14:29:20 +0000
+++ shorts/qml/pages/ArticleViewPage.qml	2015-09-16 08:53:29 +0000
@@ -33,6 +33,9 @@
         anchors.fill: parent
     }
 
+    // This fake item is used for centering Options popup.
+    Item { id: fakeItem; anchors.centerIn: innerArticleView }
+
     Component {
         id: readingOptionsPopoverComponent
         ReadingOptions { }
@@ -60,7 +63,7 @@
             text:  i18n.tr("Options")
             iconSource: "/img/qml/icons/settings.svg"
             onTriggered: {
-                PopupUtils.open(readingOptionsPopoverComponent, null)
+                PopupUtils.open(readingOptionsPopoverComponent, fakeItem)
             }
         },
 

=== modified file 'shorts/qml/shorts-app.qml'
--- shorts/qml/shorts-app.qml	2015-07-19 14:29:20 +0000
+++ shorts/qml/shorts-app.qml	2015-09-16 08:53:29 +0000
@@ -556,4 +556,7 @@
             reloadViews()
         }
     }
+
+    layer.effect: DarkModeShader {}
+    layer.enabled: optionsKeeper.useDarkTheme() && pageStack.currentPage == articlePage
 }

=== modified file 'shorts/shorts.pro'
--- shorts/shorts.pro	2015-07-04 08:38:18 +0000
+++ shorts/shorts.pro	2015-09-16 08:53:29 +0000
@@ -27,6 +27,7 @@
     qml/components/OptionsKeeper.qml \
     qml/components/OrganicGrid.qml \
     qml/components/ReadingOptions.qml \
+    qml/components/DarkModeShader.qml \
     qml/delegates/ArticleFullImg.qml \
     qml/delegates/ArticleOneImgA.qml \
     qml/delegates/ArticleTextA.qml \

=== modified file 'shorts/shorts.qrc'
--- shorts/shorts.qrc	2015-07-21 19:42:29 +0000
+++ shorts/shorts.qrc	2015-09-16 08:53:29 +0000
@@ -31,6 +31,7 @@
         <file>qml/utils/imgSeparator.js</file>
         <file>qml/shorts-app.qml</file>
         <file>qml/content/SharePage.qml</file>
+        <file>qml/components/DarkModeShader.qml</file>
     </qresource>
     <qresource prefix="/img">
         <file>qml/icons/add.svg</file>


Follow ups