panel buttons refresh when windows are closed

This commit is contained in:
Michael 2017-07-05 11:24:37 -04:00
parent 181f94e701
commit e7b288968b
2 changed files with 18 additions and 2 deletions

View file

@ -21,6 +21,13 @@ namespace ShiftOS.Frontend.Desktop
if (brdr != null)
{
brdr.Close();
RunningBorders.Remove(brdr);
if (AppearanceManager.OpenForms.Contains(brdr))
{
AppearanceManager.OpenForms.Remove(brdr);
TileWindows();
Engine.Desktop.ResetPanelButtons();
}
win = null;
}
}
@ -324,7 +331,7 @@ namespace ShiftOS.Frontend.Desktop
gfx.DrawRectangle(titlebarleft, 0, titlebarwidth, titleheight, UIManager.SkinTextures["titlebar"]);
}
//Now we draw the title text.
var textMeasure = gfx.MeasureString(_text, titlefont);
var textMeasure = gfx.MeasureString(Text, titlefont);
PointF textloc;
if (titletextcentered)
textloc = new PointF((titlebarwidth - textMeasure.X) / 2,
@ -332,7 +339,7 @@ namespace ShiftOS.Frontend.Desktop
else
textloc = new PointF(titlebarleft + titletextleft.X, titletextleft.Y);
gfx.DrawString(_text, (int)textloc.X, (int)textloc.Y, titletextcolor.ToMonoColor(), titlefont);
gfx.DrawString(Text, (int)textloc.X, (int)textloc.Y, titletextcolor.ToMonoColor(), titlefont);
var tbuttonpos = LoadedSkin.TitleButtonPosition;

View file

@ -55,6 +55,13 @@ namespace ShiftOS.Frontend.GraphicsSubsystem
continue;
}
var _target = TextureCaches[hc];
var gfxContext = new GraphicsContext(batch.GraphicsDevice, batch, ctrl.X, ctrl.Y, ctrl.Width + 5, ctrl.Height + 5);
gfxContext.DrawRectangle(ctrl.Width, 0, 1, ctrl.Height, Color.Black);
gfxContext.DrawRectangle(ctrl.Width + 1, 0, 1, ctrl.Height, Color.Black * 0.75f);
gfxContext.DrawRectangle(ctrl.Width + 2, 0, 1, ctrl.Height, Color.Black * 0.5f);
gfxContext.DrawRectangle(ctrl.Width + 3, 0, 1, ctrl.Height, Color.Black * 0.25f);
batch.Draw(_target, new Rectangle(ctrl.X, ctrl.Y, ctrl.Width, ctrl.Height), Color.White);
}
}
@ -174,6 +181,8 @@ namespace ShiftOS.Frontend.GraphicsSubsystem
}
public static bool ExperimentalEffects = true;
public static Queue<Action> CrossThreadOperations = new Queue<Action>();
public static void DrawBackgroundLayer(GraphicsDevice graphics, SpriteBatch batch, int width, int height)