Merge pull request #53 from bell07/pr_contrast_background
Mail adjustments for #51
This commit is contained in:
commit
0bcae1e292
3
API.md
3
API.md
@ -68,11 +68,12 @@ same as register_app, but the view flag is set. app_name and app_icon not necess
|
||||
Definitiontable:
|
||||
- `launcher_bg` Launcher background image
|
||||
- `app_bg` Apps background image
|
||||
- `contrast_bg` dark background to place under white text elements that does not support textcolor
|
||||
- `textcolor` Default text color for buttons and labels. For buttons the major_textcolor and minor_textcolor supported
|
||||
- `back_button` Back Button image
|
||||
- `exit_button` Exit button image
|
||||
- `major_button` Major (highlighted) button image
|
||||
- `minor_button` Minor button image
|
||||
- `textcolor` Default text color for buttons and labels. For buttons the major_textcolor and minor_textcolor supported
|
||||
|
||||
## Theme methods
|
||||
`function laptop.get_theme(theme_name)`
|
||||
|
@ -79,9 +79,9 @@ laptop.register_app("mail", {
|
||||
|
||||
-- toggle inbox/sentbox
|
||||
if account.selected_box == "inbox" then
|
||||
formspec = formspec .. mtos.theme:get_button('0,9;1.5,1', 'minor', 'switch_sentbox', 'Sentbox', 'Show sent messages')
|
||||
formspec = formspec .. "image_button[0,8.8;1.5,1.5;"..mtos.theme.minor_button.."^laptop_mail_sentbox.png;switch_sentbox;]tooltip[switch_sentbox;Show sent messages]"
|
||||
else
|
||||
formspec = formspec .. mtos.theme:get_button('0,9;1.5,1', 'minor', 'switch_inbox', 'Inbox', 'Show received messages')
|
||||
formspec = formspec .. "image_button[0,8.8;1.5,1.5;"..mtos.theme.minor_button.."^laptop_mail_received.png;switch_inbox;]tooltip[switch_inbox;Show received messages]"
|
||||
end
|
||||
|
||||
formspec = formspec .. "image_button[1.7,9;1,1;"..mtos.theme.minor_button.."^laptop_email_new.png;new;]tooltip[new;New message]"
|
||||
@ -108,7 +108,7 @@ laptop.register_app("mail", {
|
||||
end
|
||||
|
||||
formspec = formspec .. mtos.theme:get_label('8,1', "Subject: "..(account.selectedmessage.subject or ""))..
|
||||
"background[8,1.55;6.92,7.3;gui_formbg.png]"..
|
||||
"background[8,1.55;6.92,7.3;"..mtos.theme.contrast_bg.."]"..
|
||||
"textarea[8.25,1.5;7,8.35;body;;"..(minetest.formspec_escape(account.selectedmessage.body) or "").."]"
|
||||
end
|
||||
return formspec
|
||||
@ -211,9 +211,9 @@ laptop.register_view("mail:compose", {
|
||||
account.newmessage = account.newmessage or {}
|
||||
local message = account.newmessage
|
||||
|
||||
local formspec = "background[-0.1,0.4;4.2,2.4;gui_formbg.png]"..
|
||||
local formspec = "background[-0.1,0.4;4.2,2.4;"..mtos.theme.contrast_bg.."]"..
|
||||
"field[0.25,1;4,1;receiver;To:;%s]field[0.25,2;4,1;subject;Subject:;%s]"..
|
||||
"background[0,3.05;7.95,3.44;gui_formbg.png]"..
|
||||
"background[0,3.05;7.95,3.44;"..mtos.theme.contrast_bg.."]"..
|
||||
"textarea[0.25,3;8,4;body;;%s]"..
|
||||
mtos.theme:get_button("0,8;2,1", "major", "send", "Send message")
|
||||
formspec = string.format(formspec,minetest.formspec_escape(message.receiver or ""),minetest.formspec_escape(message.subject or ""),minetest.formspec_escape(message.body or ""))
|
||||
|
@ -2,14 +2,14 @@ laptop.register_app("stickynote", {
|
||||
app_name = "Notepad",
|
||||
app_icon = "laptop_notes_pad.png",
|
||||
app_info = "Write notes in a text document.",
|
||||
formspec_func = function(app, os)
|
||||
formspec_func = function(app, mtos)
|
||||
local data = app:get_storage_ref()
|
||||
data.text = data.text or ""
|
||||
|
||||
return "background[0,0.35;15.2,9.2;gui_formbg.png]"..
|
||||
return "background[0,0.35;15.2,9.2;"..mtos.theme.contrast_bg.."]"..
|
||||
"textarea[0.35,0.35;15.08,10.5;text;;"..minetest.formspec_escape(data.text).."]"
|
||||
end,
|
||||
receive_fields_func = function(app, os, fields, sender)
|
||||
receive_fields_func = function(app, mtos, fields, sender)
|
||||
if fields.text then
|
||||
local data = app:get_storage_ref()
|
||||
data.text = fields.text
|
||||
|
Before Width: | Height: | Size: 467 B After Width: | Height: | Size: 467 B |
@ -8,6 +8,7 @@ laptop.themes = {
|
||||
exit_button = "laptop_theme_freedom_exit_button.png",
|
||||
app_button = "laptop_theme_freedom_app_button.png",
|
||||
textcolor = "#000000",
|
||||
contrast_bg = "gui_formbg.png",
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user