Since unity 2020.1.3 we have access to the dark theme!
but this seems super weird for me to have a white bar
I mean this is a lot of contrast, it could be smoother like other applications
Edit: If you meant Unity’s own main bar (File, Edit, Assets, GameObjects, …) instead, then this is something that indeed won’t be affected by the above setting…
.
yes that’s the problem I mean that line too
and the problem of activating the windows settings for tittles is that for me is purple, and if I want it black I have to set everything black, windows menus included umu
I think unity should do something like Discord or Visual Studio, I mean like a custom window
Any update/fix for this? I’ve got everything darker except the selectable tabs where file, edit are etc but even when I click off unity onto my second monitor the top of it goes white again.
As mentioned earlier you can colour the windows bar using the window settings. But use this script to hide/show the menu by pressing F11. Place/create this folder structure:
Assets>Editor>
And create the script - UnityMenuF11Toggle:
// Windows-only. Always hide Unity's native main menu (File/Edit/Assets/…)
// on startup and keep it hidden. Press F11 to toggle show/hide.
// No popups, no extra UI.
// Works from Unity 2020+ on Win10/11.
#if UNITY_EDITOR && UNITY_EDITOR_WIN
using System;
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEngine;
public static class UnityMenuF11Toggle
{
// --- Win32 ---
[DllImport("user32.dll", SetLastError = true)] private static extern IntPtr GetMenu(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true)] private static extern bool SetMenu(IntPtr hWnd, IntPtr hMenu);
[DllImport("user32.dll", SetLastError = true)] private static extern bool DrawMenuBar(IntPtr hWnd);
[DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow();
private const string PrefHMENU = "UnityMenuF11Toggle.SavedHMENU";
private const string PrefSuppress = "UnityMenuF11Toggle.SuppressAutoHide"; // true when user chooses to keep it visible
private static IntPtr _savedMenu = IntPtr.Zero;
// --- F11 hotkey (no modifiers) ---
[MenuItem("Tools/Toggle Main Menu _F11")]
private static void ToggleMainMenu()
{
var hWnd = GetEditorMainWindow();
if (hWnd == IntPtr.Zero) return;
var current = GetMenu(hWnd);
if (current != IntPtr.Zero)
{
// Visible -> hide & resume auto-hide
_savedMenu = current;
EditorPrefs.SetString(PrefHMENU, _savedMenu.ToInt64().ToString());
EditorPrefs.SetBool(PrefSuppress, false);
if (SetMenu(hWnd, IntPtr.Zero)) DrawMenuBar(hWnd);
}
else
{
// Hidden -> restore & temporarily suppress auto-hide
if (_savedMenu == IntPtr.Zero && EditorPrefs.HasKey(PrefHMENU) &&
long.TryParse(EditorPrefs.GetString(PrefHMENU, "0"), out var val))
{
_savedMenu = new IntPtr(val);
}
if (_savedMenu != IntPtr.Zero)
{
if (SetMenu(hWnd, _savedMenu)) DrawMenuBar(hWnd);
EditorPrefs.SetBool(PrefSuppress, true);
}
else
{
// No handle; force redraw (won't show the menu). User can press F11 again to hide->capture.
DrawMenuBar(hWnd);
}
}
}
// --- Always-auto-hide bootstrap + persistent watcher ---
[InitializeOnLoadMethod]
private static void AutoHideBootstrap()
{
// Fresh session starts with auto-hide not suppressed
EditorPrefs.SetBool(PrefSuppress, false);
// Recover saved handle (so F11 can restore even after domain reload)
if (_savedMenu == IntPtr.Zero && EditorPrefs.HasKey(PrefHMENU) &&
long.TryParse(EditorPrefs.GetString(PrefHMENU, "0"), out var val))
{
_savedMenu = new IntPtr(val);
}
// Hide immediately if possible
HideIfVisible();
// Lightweight watcher (~2x/sec) to keep it hidden unless user chose to show
_nextTick = 0;
EditorApplication.update += WatchdogTick;
// Clean up on quit to avoid stale handles across sessions
EditorApplication.quitting += () =>
{
EditorPrefs.DeleteKey(PrefHMENU);
EditorPrefs.DeleteKey(PrefSuppress);
};
}
private static double _nextTick;
private static void WatchdogTick()
{
double now = EditorApplication.timeSinceStartup;
if (now < _nextTick) return;
_nextTick = now + 0.5; // check twice per second
// If user explicitly showed the menu via F11, don't fight them until they hide or restart
if (EditorPrefs.GetBool(PrefSuppress, false)) return;
HideIfVisible();
}
private static void HideIfVisible()
{
var hWnd = GetEditorMainWindow();
if (hWnd == IntPtr.Zero) return;
var current = GetMenu(hWnd);
if (current == IntPtr.Zero) return; // already hidden
// Capture handle, then hide
_savedMenu = current;
EditorPrefs.SetString(PrefHMENU, _savedMenu.ToInt64().ToString());
if (SetMenu(hWnd, IntPtr.Zero)) DrawMenuBar(hWnd);
}
// --- Helpers ---
private static IntPtr GetEditorMainWindow()
{
var h = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
if (h != IntPtr.Zero) return h;
foreach (var cls in new[] { "UnityContainerWndClass", "UnityWndClass" })
{
var w = FindWindow(cls, null);
if (w != IntPtr.Zero) return w;
}
return GetForegroundWindow();
}
}
#endif