diff --git a/TBO/ApplicationLibrary.cs b/TBO/ApplicationLibrary.cs
index 573bb4e..22c27bf 100644
--- a/TBO/ApplicationLibrary.cs
+++ b/TBO/ApplicationLibrary.cs
@@ -1,25 +1,50 @@
using System.Drawing;
using TBO.i18n;
+using TBO.UI;
using TBO.UI.tboTK;
namespace TBO
{
class ApplicationLibrary : Application
{
- Button btFullscreen = new Button("btFullscreen") { Image = Properties.Resources.screen_full_256, Top = 5 };
+ Button btFullscreen = new Button("btFullscreen") { Image = Properties.Resources.screen_full, Top = 5 };
+ Button btClose = new Button("btClose") { Image = Properties.Resources.x, Top = 5, Visible = Shell.FullScreen };
Panel pLib = new Panel("pLib") { Width = 500 };
+
public ApplicationLibrary()
{
Add(btFullscreen);
+ Add(btClose);
+
+ btFullscreen.DoClick = btFullscreenClick;
+ btClose.DoClick = btCloseClick;
}
public override void ResizeTo(Size size)
{
- btFullscreen.Left = size.Width - (btFullscreen.Width + 5);
+ if (btClose.Visible)
+ {
+ btFullscreen.Left = size.Width - (btFullscreen.Width * 2 + 10);
+ btClose.Left = size.Width - (btClose.Width + 5);
+ }
+ else
+ btFullscreen.Left = size.Width - (btFullscreen.Width + 5);
pLib.Height = size.Height;
pLib.Left = (size.Width - pLib.Width) / 2;
}
+ private void btFullscreenClick(Control c, Event e)
+ {
+ bool nfs = !Shell.FullScreen;
+ btClose.Visible = nfs;
+ Shell.FullScreen = nfs;
+ }
+
+ private void btCloseClick(Control c, Event e)
+ {
+ Shell.DoClose?.Invoke();
+ }
+
public static string ApplicationId = "Library";
public override string Id => ApplicationId;
public override string Title => I18n.Lang.Library;
diff --git a/TBO/TBO.csproj b/TBO/TBO.csproj
index 9073526..214cb5d 100644
--- a/TBO/TBO.csproj
+++ b/TBO/TBO.csproj
@@ -125,9 +125,10 @@
-
-
-
+
+
+
+