mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 15:26:55 +03:00
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using Eto.Drawing;
|
|
using Eto.Forms;
|
|
using NAPS2.EtoForms.Layout;
|
|
using NAPS2.ImportExport.Email;
|
|
|
|
namespace NAPS2.EtoForms.Ui;
|
|
|
|
internal class EmailProviderForm : EtoDialogBase
|
|
{
|
|
private readonly EmailProviderController _controller;
|
|
|
|
public EmailProviderForm(Naps2Config config, EmailProviderController controller) : base(config)
|
|
{
|
|
_controller = controller;
|
|
}
|
|
|
|
protected override void BuildLayout()
|
|
{
|
|
Title = UiStrings.EmailProviderFormTitle;
|
|
Icon = new Icon(1f, Icons.email_small.ToEtoImage());
|
|
|
|
FormStateController.FixedHeightLayout = true;
|
|
|
|
LayoutController.DefaultSpacing = 0;
|
|
LayoutController.Content = L.Column(
|
|
_controller.GetWidgets().Select(x => C.Button(new ActionCommand(() =>
|
|
{
|
|
if (x.Choose())
|
|
{
|
|
Result = true;
|
|
Close();
|
|
}
|
|
})
|
|
{
|
|
Text = x.ProviderName,
|
|
Image = x.ProviderIcon,
|
|
Enabled = x.Enabled
|
|
}, ButtonImagePosition.Left, big: true).NaturalWidth(500).Height(50)).Expand()
|
|
);
|
|
}
|
|
|
|
public bool Result { get; private set; }
|
|
|
|
} |