Skip to content

Commit

Permalink
Buttons for initial window weren't being set
Browse files Browse the repository at this point in the history
  • Loading branch information
Reavenk committed Jan 18, 2021
1 parent 7bfa551 commit f142910
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion UIDock/Root.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public Window WrapIntoWindow(RectTransform rt, string title, Window.Flag flags =
GameObject goWindow = new GameObject("DockWindow");
Window window = goWindow.AddComponent<Window>();
window.Initialize(this, rt, title, flags);
window.NotifyFloating();
window.NotifyFloating(true);

window.rectTransform.anchoredPosition =
this.GetNewSpawnSpot();
Expand Down
9 changes: 5 additions & 4 deletions UIDock/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,9 @@ public void NotifyMaximized()
/// <summary>
/// Called on the window when changed to be floating.
/// </summary>
public void NotifyFloating()
public void NotifyFloating(bool forceStyle = false)
{
this.ChangeStyle(DockProps.WinType.Float);
this.ChangeStyle(DockProps.WinType.Float, true, forceStyle);

if (this.btnPin.plate != null)
this.btnPin.plate.gameObject.SetActive(false);
Expand Down Expand Up @@ -834,9 +834,10 @@ public void NotifyDocked()
/// </summary>
/// <param name="winType">The window style to change to.</param>
/// <param name="placeContent">If true, PlaceContent() will be called afterwards.</param>
public void ChangeStyle(DockProps.WinType winType, bool placeContent = true)
/// <param name="forceStyle">If true, setting the style is forced, even if it's detected to be redundant.</param>
public void ChangeStyle(DockProps.WinType winType, bool placeContent = true, bool forceStyle = false)
{
if(this.style == winType)
if(this.style == winType && forceStyle == false)
return;

this.style = winType;
Expand Down

0 comments on commit f142910

Please sign in to comment.