diff --git a/dialog.lua b/dialog.lua new file mode 100644 index 000000000..129e36813 --- /dev/null +++ b/dialog.lua @@ -0,0 +1,30 @@ +require "widget" +require "font" + +InfoMessage = { + face = Font:getFace("infofont", 25) +} + +function InfoMessage:show(text) + local dialog = CenterContainer:new({ + dimen = { w = G_width, h = G_height }, + FrameContainer:new({ + margin = 2, + HorizontalGroup:new({ + align = "center", + ImageWidget:new({ + file = "resources/info-i.png" + }), + Widget:new({ + dimen = { w = 10, h = 0 } + }), + TextWidget:new({ + text = text, + face = Font:getFace("cfont", 30) + }) + }) + }) + }) + dialog:paintTo(fb.bb, 0, 0) + dialog:free() +end diff --git a/font.lua b/font.lua index ffc0bd1d1..cdf658956 100644 --- a/font.lua +++ b/font.lua @@ -25,6 +25,9 @@ Font = { -- font for displaying input content -- we have to use mono here for better distance controlling infont = "droid/DroidSansMono.ttf", + + -- font for info messages + infofont = "droid/DroidSans.ttf", }, fontdir = os.getenv("FONTDIR") or "./fonts",