mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 15:26:55 +03:00
Mac: Improve groupbox styling
This commit is contained in:
parent
df4355e3a2
commit
1f529e7add
@ -1,7 +1,9 @@
|
||||
using Eto;
|
||||
using Eto.Drawing;
|
||||
using Eto.Forms;
|
||||
using Eto.Mac;
|
||||
using Eto.Mac.Drawing;
|
||||
using NAPS2.EtoForms.Layout;
|
||||
using NAPS2.Images.Mac;
|
||||
using sd = System.Drawing;
|
||||
|
||||
@ -66,4 +68,22 @@ public class MacEtoPlatform : EtoPlatform
|
||||
// TODO
|
||||
return new NSView().ToEto();
|
||||
}
|
||||
|
||||
public override LayoutElement CreateGroupBox(string title, LayoutElement content)
|
||||
{
|
||||
var titleLabel = new Label
|
||||
{
|
||||
Text = title,
|
||||
Font = NSFont.BoldSystemFontOfSize(12).ToEto()
|
||||
};
|
||||
var groupBox = new GroupBox();
|
||||
|
||||
return L.Overlay(
|
||||
L.Column(
|
||||
titleLabel.Padding(top: 8).SpacingAfter(6),
|
||||
groupBox.YScale()
|
||||
),
|
||||
L.Buffer(content, 6, 32, 6, 6)
|
||||
);
|
||||
}
|
||||
}
|
@ -97,6 +97,12 @@ public abstract class EtoPlatform
|
||||
{
|
||||
}
|
||||
|
||||
public virtual LayoutElement CreateGroupBox(string title, LayoutElement content)
|
||||
{
|
||||
var groupBox = new GroupBox { Text = title };
|
||||
return L.Overlay(groupBox, L.Buffer(content, 6, 18, 6, 6));
|
||||
}
|
||||
|
||||
public virtual void ShowIcon(Dialog dialog)
|
||||
{
|
||||
}
|
||||
|
@ -47,10 +47,10 @@ public static class L
|
||||
|
||||
public static LayoutElement GroupBox(string title, LayoutElement content)
|
||||
{
|
||||
return L.Overlay(new GroupBox { Text = title }, L.Buffer(content, 6, 18, 6, 6));
|
||||
return EtoPlatform.Current.CreateGroupBox(title, content);
|
||||
}
|
||||
|
||||
private static LayoutElement Buffer(LayoutElement element, int left, int top, int right, int bottom)
|
||||
public static LayoutElement Buffer(LayoutElement element, int left, int top, int right, int bottom)
|
||||
{
|
||||
return new BufferLayoutElement(element, left, top, right, bottom);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user