We have moved to a new Sailfish OS Forum. Please start new discussions there.
14

[BUG] e-mail app does not show responsive layout

asked 2017-02-28 00:14:25 +0300

poddl gravatar image

updated 2018-02-22 16:02:40 +0300

some html mailings are responsive, but the SF email app displays the desktop view. More worse: Some of them are not zoom-able, for no reason at all.

Update: Still present on kymijoki 2.1.3.7

Update Feb, 2018 BEGIN

Still present in 2.1.4.13

This E-Mail even has set the viewport correct:

<meta name="viewport" content="width=device-width, initial-scale=1">

I found that something is wrong with "webView.width", in the file "/usr/share/jolla-email/pages/HtmlViewer.qml" (line 98). As far as an mail has the viewport (correct for responsive) stetted, "webView.width" is used and the email is displayed wrong. If I set a fixed width of 350 on my Xperia, most mail got rendered correct. The scale settings from line 95/96 doesn't do a good job as they should.

Update Feb, 2018 END

Here an example. First image is an android mail client, second the sailfish mail client:

Android email client:

android client

.

Same mailing on sailfish email client:

sailfish client

Still nothing to update on 2.1.0.11

edit retag flag offensive close delete

Comments

The problem is even more evident with the Xperia's screen resolution and also the zoom is quite difficult: after the zoom the scrolling is not simple.

3vixan ( 2017-12-04 18:22:03 +0300 )edit
2

Yes, a linux based OS can not handle a twenty year old task, unbelievable. Not even possible to show as text, need to hit the forward button to be able to read emails. The ugly lag will be fixed in one of the next updates, but the tiny unreadable E-Mails are present from the first beginning with SOS 1. Nobody cares about this. If I find time, I may start to develop a E-Mail app for SOS, I can not endure this anymore...

poddl ( 2017-12-04 20:15:11 +0300 )edit

1 Answer

Sort by » oldest newest most voted
4

answered 2018-02-22 15:57:25 +0300

poddl gravatar image

I will answer this by myself. I found a workarround for this issue with the unreadable/unzoomable mails for the Xperia:

In the file

/usr/share/jolla-email/pages/HtmlViewer.qml

find:

    function setHtml(html) {
    htmlBody = html
    // Respect viewport meta tag if exists
    if (!hasViewportMetaTag(htmlBody)) {
        // This affects only to layouts that do not have width defined in body content.
        // Smaller content layout gets scaled up to WebView's width. Basically meaning that
        // html text emails will get scaled up by factor (1.5*Theme.pixelRatio) rounded to nearest half.
        // With higher scale factor content layouts starts touching edges of WebView and that hinders
        // legibility. Thus, this 1.5 base factor.
        var scale = Math.round((1.5 * Theme.pixelRatio) / .5) * .5
        experimental.customLayoutWidth = webView.width / scale
    } else {
        experimental.customLayoutWidth = webView.width
    }
    // reload html
    webView.loadHtml(htmlBody, "file:///usr/share/jolla-email")
    onScreen = true
}

replace with:

    function setHtml(html) {
    htmlBody = html
    // Respect viewport meta tag if exists
    //if (!hasViewportMetaTag(htmlBody)) {
        // This affects only to layouts that do not have width defined in body content.
        // Smaller content layout gets scaled up to WebView's width. Basically meaning that
        // html text emails will get scaled up by factor (1.5*Theme.pixelRatio) rounded to nearest half.
        // With higher scale factor content layouts starts touching edges of WebView and that hinders
        // legibility. Thus, this 1.5 base factor.
       //var scale = Math.round((1.5 * Theme.pixelRatio) / .5) * .5
       // experimental.customLayoutWidth = webView.width / scale
   // } else {
        experimental.customLayoutWidth = 350
   // }
    // reload html
    webView.loadHtml(htmlBody, "file:///usr/share/jolla-email")
    onScreen = true
}

After this, restart the email app and most mails are readable. It is not a solution, just an ugly fix, which helps me a lot.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2017-02-28 00:14:25 +0300

Seen: 534 times

Last updated: Feb 22 '18