@@ -40,9 +40,6 @@ class LocksControl
40
40
[ NonSerialized ] private GitLockEntry rightClickNextRenderEntry ;
41
41
[ NonSerialized ] private int controlId ;
42
42
43
- private const string FilePathFormatString = "Path: {0}" ;
44
- private const string UserNameFormatString = "User: {0}" ;
45
-
46
43
public int SelectedIndex
47
44
{
48
45
get { return selectedIndex ; }
@@ -107,17 +104,21 @@ private void RenderEntry(Rect entryRect, GitLockEntry entry, int index)
107
104
{
108
105
var isSelected = index == SelectedIndex ;
109
106
110
- var iconRect = new Rect ( entryRect . x , entryRect . y + Styles . BaseSpacing / 2 , 32 , 32 ) ;
111
- var pathRect = new Rect ( entryRect . x + 32 , entryRect . y + Styles . BaseSpacing / 2 , entryRect . width , Styles . LocksSummaryHeight + Styles . BaseSpacing ) ;
112
- var lastY = pathRect . y + pathRect . height ;
113
- var userRect = new Rect ( entryRect . x + 32 , lastY + Styles . BaseSpacing / 2 , entryRect . width , Styles . LocksUserHeight + Styles . BaseSpacing ) ;
107
+ var iconRect = new Rect ( entryRect . x + Styles . BaseSpacing / 2 , entryRect . y + ( Styles . LocksEntryHeight - 32 ) / 2 , 32 + Styles . BaseSpacing , 32 ) ;
108
+
109
+ var xIconRectRightSidePadded = iconRect . x + iconRect . width ;
110
+
111
+ var pathRect = new Rect ( xIconRectRightSidePadded , entryRect . y + Styles . BaseSpacing / 2 , entryRect . width , Styles . LocksSummaryHeight + Styles . BaseSpacing ) ;
112
+ var userRect = new Rect ( xIconRectRightSidePadded , pathRect . y + pathRect . height + Styles . BaseSpacing / 2 , entryRect . width , Styles . LocksUserHeight + Styles . BaseSpacing ) ;
113
+ var dateRect = new Rect ( xIconRectRightSidePadded , userRect . y + userRect . height + Styles . BaseSpacing / 2 , entryRect . width , Styles . LocksDateHeight + Styles . BaseSpacing ) ;
114
114
115
- var hasKeyboardFocus = GUIUtility . keyboardControl == controlId ;
115
+ var hasKeyboardFocus = GUIUtility . keyboardControl == controlId ;
116
116
117
117
Styles . Label . Draw ( entryRect , GUIContent . none , false , false , isSelected , hasKeyboardFocus ) ;
118
118
Styles . Label . Draw ( iconRect , entry . Content , false , false , isSelected , hasKeyboardFocus ) ;
119
- Styles . Label . Draw ( pathRect , string . Format ( FilePathFormatString , entry . GitLock . Path ) , false , false , isSelected , hasKeyboardFocus ) ;
120
- Styles . Label . Draw ( userRect , string . Format ( UserNameFormatString , entry . GitLock . User ) , false , false , isSelected , hasKeyboardFocus ) ;
119
+ Styles . Label . Draw ( pathRect , entry . GitLock . Path , false , false , isSelected , hasKeyboardFocus ) ;
120
+ Styles . Label . Draw ( userRect , entry . GitLock . User , false , false , isSelected , hasKeyboardFocus ) ;
121
+ Styles . Label . Draw ( dateRect , DateTimeOffset . Now . ToString ( ) , false , false , isSelected , hasKeyboardFocus ) ;
121
122
}
122
123
123
124
private bool HandleInput ( Rect rect , GitLockEntry entry , int index , Action < GitLock > singleClick = null ,
0 commit comments