@@ -63,7 +63,7 @@ public override void InitializeView(IView parent)
6363 public override void OnEnable ( )
6464 {
6565 base . OnEnable ( ) ;
66- UpdateTreeIcons ( ) ;
66+ UpdateTreeIconAndStyles ( ) ;
6767 AttachHandlers ( Repository ) ;
6868 Repository . CheckLocalAndRemoteBranchListChangedEvent ( lastLocalAndRemoteBranchListChangedEvent ) ;
6969 }
@@ -157,7 +157,7 @@ private void BuildTree()
157157 treeRemotes = new BranchesTree ( ) ;
158158 treeRemotes . IsRemote = true ;
159159
160- UpdateTreeIcons ( ) ;
160+ UpdateTreeIconAndStyles ( ) ;
161161 }
162162
163163 localBranches . Sort ( CompareBranches ) ;
@@ -168,16 +168,22 @@ private void BuildTree()
168168 Redraw ( ) ;
169169 }
170170
171- private void UpdateTreeIcons ( )
171+ private void UpdateTreeIconAndStyles ( )
172172 {
173173 if ( treeLocals != null )
174174 {
175175 treeLocals . UpdateIcons ( Styles . ActiveBranchIcon , Styles . BranchIcon , Styles . FolderIcon , Styles . GlobeIcon ) ;
176+ treeLocals . FolderStyle = Styles . Foldout ;
177+ treeLocals . TreeNodeStyle = Styles . TreeNode ;
178+ treeLocals . ActiveTreeNodeStyle = Styles . TreeNodeActive ;
176179 }
177180
178181 if ( treeRemotes != null )
179182 {
180183 treeRemotes . UpdateIcons ( Styles . ActiveBranchIcon , Styles . BranchIcon , Styles . FolderIcon , Styles . GlobeIcon ) ;
184+ treeRemotes . FolderStyle = Styles . Foldout ;
185+ treeRemotes . TreeNodeStyle = Styles . TreeNode ;
186+ treeRemotes . ActiveTreeNodeStyle = Styles . TreeNodeActive ;
181187 }
182188 }
183189
@@ -295,18 +301,7 @@ private void OnButtonBarGUI()
295301
296302 private void OnTreeGUI ( Rect rect )
297303 {
298- var initialRect = rect ;
299-
300- if ( treeLocals . FolderStyle == null )
301- {
302- treeLocals . FolderStyle = Styles . Foldout ;
303- treeLocals . TreeNodeStyle = Styles . TreeNode ;
304- treeLocals . ActiveTreeNodeStyle = Styles . TreeNodeActive ;
305- treeRemotes . FolderStyle = Styles . Foldout ;
306- treeRemotes . TreeNodeStyle = Styles . TreeNode ;
307- treeRemotes . ActiveTreeNodeStyle = Styles . TreeNodeActive ;
308- }
309-
304+ var initialRect = rect ;
310305 var treeHadFocus = treeLocals . SelectedNode != null ;
311306
312307 rect = treeLocals . Render ( rect , scroll ,
0 commit comments