Gerold55 / laptop

Introducing the MineTest Laptop Mod
Other
26 stars 14 forks source link

Read and Unread Emails #85

Closed Grizzly-Adam closed 6 years ago

Grizzly-Adam commented 6 years ago

Could the emails be made BOLD if unread and non-bold if read? I don't think that marking new as read is the way to go.

bell07 commented 6 years ago

I do not know how text can be set to BOLD in formspec. Therefore just different colors is used for read/unread and outbox. If you see a way, just propose a PR. Generally I am not an UI developer so any formspec improvement welcome.

Grizzly-Adam commented 6 years ago

What about black for unread and grey for read? It would give the same unconscious cues that bold/non-bold signals.

Grizzly-Adam commented 6 years ago

Ok, with a lack of a bold option I would like to propose bright white as unread and #888888 grey as read. See screenshot.

screenshot from 2018-02-16 21-39-45

Gerold55 commented 6 years ago

Looks good to me 👍💯 I approve 👍

Grizzly-Adam commented 6 years ago

Not sure if we can change background color on just outbox, many email apps change outbox color to grey to make users know for sure which box they are in. They are subtle.

Gerold55 commented 6 years ago

Yeah 👍

bell07 commented 6 years ago

Not sure if we can change background color on just outbox, many email apps change outbox color to grey to make users know for sure which box they are in. They are subtle.

Of course you can do it. I tried to get it looking nice as I can, but I an not an UI person. In this case the just the default tablecolumns[] coloring was used for background. You can add tableoptions[] for beter formatting. See https://github.com/minetest/minetest/blob/backport-0.4/doc/lua_api.txt#L2054

Grizzly-Adam commented 6 years ago

Bell-- how do I call just the outbox table? Right now I have it working but it is coloring the background for both inbox and outbox.

            "tableoptions[background=#FF0000]"..
bell07 commented 6 years ago

We have already multiple

if account.selected_box == "inbox" then
else
end

blocks. So we need a new one for tableoptions

local formspec
if account.selected_box == "inbox" then
   formspec = "tableoptions[background=#FF0000]"
else
   formspec = "tableoptions[background=#ZZZZZZ]"
end
formspec = formspec .. "tablecolumns[" ..
Grizzly-Adam commented 6 years ago

Thats essentially what I was playing with, I think I just couldn't get the phrasing quite right.

Do you know a way to change text color in the message body? I have been re-skinning the app, but unless we can get black text the look I am going for will not look right.

bell07 commented 6 years ago

also here, unfortunately not. That was the reason to add theme attribute

contrast_bg - dark background to place under white text elements that does not support textcolor

Maybe you can take some optimizations on this?

Grizzly-Adam commented 6 years ago

Would either of the suggestion s in this thread actually work?

https://forum.minetest.net/viewtopic.php?f=47&t=19672

bell07 commented 6 years ago

You know my answer :-( Only possible for read-only textarea, see https://forum.minetest.net/viewtopic.php?f=47&t=18964

One second, we need it for read-only view in the inbox only, right? Try to use "textarea[8.35,1.6;6.8,8.25;;"..minetest.colorize("#123456", minetest.formspec_escape(account.selectedmessage.body) or "")..";]"

Grizzly-Adam commented 6 years ago

Correct. I will try to email fixes and the desktop app label fixes first thing when I get home.

Where are you from bell? I detect a bit of time and language difference. I am guessing Europe, maybe one of the Germanic countries.

Grizzly-Adam commented 6 years ago

I am not sure where you wanted the formspec snippet, but I assumed you wanted it integrated into the "local formspec" segment.

This is what I did and I am receiving "unexpected system near if" errors that match the first IF we used

        local formspec =
                "background[-0.19,0.23;15.38,10.275;".."laptop_mail_background.png".."]"..--full window background
                if account.selected_box == "inbox" then
                   formspec = "tableoptions[background=#FFFFF;highlight=#c5ced8]"
                else
                   formspec = "tableoptions[background=#cccccc;highlight=#c5ced8]"
                end
                "tablecolumns[" ..
                        "image,align=center,1=laptop_mail.png,2=laptop_mail_read.png;"..  --icon column
                        "color;"..  -- subject and date color
                        "text;".. -- subject
                        "text,padding=1.5;".. -- sender
                        "text,padding=1.5,align=right]".. -- date
                "table[0,0.5;7.5,8.2;message;"
Grizzly-Adam commented 6 years ago

This is what the skin is looking like. I assume that you have gone to bed, but when you see this can you please simplify this for me. I didn't know how to just call black text for the sender/receiver and subject so I made a copy of the get_label function that uses black text. Has to be an easier way!

      formspec = formspec .. mtos.theme:get_image_button('8,9;1,1', 'minor', 'print', 'printer_button.png', '', 'Print Email')
      if account.selected_box == "inbox" then
          formspec = formspec .. mtos.theme:get_blacktext('8,0.5', "From: "..(account.selectedmessage.sender or ""))
      else
          formspec = formspec .. mtos.theme:get_blacktext('8,0.5', "To: "..(account.selectedmessage.receiver or ""))
      end

mailshot

bell07 commented 6 years ago

Yes, my timezone is 'Europe/Berlin'. I woke up and cannot sleep, it's 04:00 am here.

The theme:get_label(area, label, color_prefix) does have the optional "color_prefix" to set colors. Without them the "theme.textcolor" attribute is uses that is black in default theme.

So what is wrong with the mtos.theme:get_label("8,0.5", "To: "..(account.selectedmessage.receiver or "")) ? It should work and we do not need the get_blacktext().

Now I go back to bed and try to sleep (They are monsters nearby? :-/ )

Grizzly-Adam commented 6 years ago

The issue is I am using white background and some themes have textcolor set to white or another light color. This is a place where color doesn't need set by the theme.

bell07 commented 6 years ago

Then the themes are wrong. textcolor is "The default theme text color", and if the app_bg is white, the default text color should be black. Previous the white was only for "Basic theme" because this one aims to emulate default formspec behaviour.

If you need white for some strings you need to use prefixes. In the default theme the "titlebar" is white. Do we need new prefixes? Which strings should be white and are the reason for textcolor = white in some themes?

Grizzly-Adam commented 6 years ago

I have noticed in Chess, Mail, Themes, Removable Storage, and Tetris all have this white text on light background problem.

bell07 commented 6 years ago

I have noticed in Chess, Mail, Themes, Removable Storage, and Tetris all have this white text on light background problem.

Only with themes you set textcolor = "#ffffff". The textcolor is the default color in contrast to the background and should be black in most themes. Except the "Basic" theme at the time that have dark background.

What was the reason to change textcolor to white? Asume an other (new?) prefix needs to be used for texts that should be white

bell07 commented 6 years ago

Theming rework done