aboutsummaryrefslogtreecommitdiffstats
path: root/src/m_email/ui/main.lua
blob: 78fb6ef61b256f1749eb739a9d74a8ec09cd9e8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- E-mail: where it is offered.
--
-- The message view is the module's own widget, mounted for every document of
-- type "email" and for .eml files, which the Host opens and saves itself.
-- The settings page and the IMAP controller are the module's too. Titles
-- belong to the commands.

local new_message = commands.get("com.bktus.gpgfrontend.module.email.new_message")
local open_imap = commands.get("com.bktus.gpgfrontend.module.email.open_imap_controller")

ui.mount {
  id = "editor",
  anchor = ui.anchor.editor {
    document_type = "email",
    extensions = { "eml" },
    -- The message has its own headers and attachments to show; the Status
    -- Panel starts as a bar here and opens on a new result.
    compact_status = true,
  },
  widget = native.factory("editor"),
}

ui.mount {
  id = "settings",
  anchor = ui.anchor.settings { section = "features" },
  widget = native.widget("settings"),
}

ui.mount { id = "imap", anchor = ui.anchor.dialog {}, widget = native.widget("imap") }

ui.action {
  id = "new",
  anchor = ui.anchor("main.menu.file.workspace"),
  command = new_message,
  icon = ":/icons/email.png",
}

ui.action {
  id = "imap",
  anchor = ui.anchor("main.menu.advanced"),
  command = open_imap,
  icon = ":/icons/receive_email.png",
}