Skip to content

Commit

Permalink
Reading gutter level preference when executing ShowQuickToggle
Browse files Browse the repository at this point in the history
  • Loading branch information
ChemiKhazi committed Jul 19, 2017
1 parent 0ae699c commit 7c3c93a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Editor/QuickToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private static void UpdateGutterMenu(int gutterLevel)

static QuickToggle()
{
// Setup initial state of editor prefs
// Setup initial state of editor prefs if there are no prefs keys yet
string[] resetPrefs = new string[] {PrefKeyShowToggle, PrefKeyShowDividers, PrefKeyShowIcons};
foreach (string prefKey in resetPrefs)
{
Expand All @@ -157,8 +157,9 @@ static QuickToggle()
// Not calling BuildStyles() in constructor because script gets loaded
// on Unity initialization, styles might not be loaded yet

// Reset mouse state and
// Reset mouse state
ResetVars();
// Setup quick toggle
ShowQuickToggle(EditorPrefs.GetBool(PrefKeyShowToggle));
}

Expand All @@ -167,6 +168,7 @@ private static void ShowQuickToggle(bool show)
EditorPrefs.SetBool(PrefKeyShowToggle, show);
showDivider = EditorPrefs.GetBool(PrefKeyShowDividers, false);
showIcons = EditorPrefs.GetBool(PrefKeyShowIcons, false);
gutterCount = EditorPrefs.GetInt(PrefKeyGutterLevel);

if (show)
{
Expand Down

0 comments on commit 7c3c93a

Please sign in to comment.