Browse Source

Fixed bug in code determining the size of the name column in the profiler.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4977 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts 3.1.0
Daniel Grunwald 16 years ago
parent
commit
835431f6ab
  1. 5
      src/AddIns/Misc/Profiler/Frontend/Controls/EventLine.cs
  2. 26
      src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

5
src/AddIns/Misc/Profiler/Frontend/Controls/EventLine.cs

@ -20,9 +20,4 @@ namespace ICSharpCode.Profiler.Controls @@ -20,9 +20,4 @@ namespace ICSharpCode.Profiler.Controls
}
}
class EventItem
{
int dataSet;
}
}

26
src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

@ -166,16 +166,26 @@ namespace ICSharpCode.Profiler.Controls @@ -166,16 +166,26 @@ namespace ICSharpCode.Profiler.Controls
this.Translation = new ControlsTranslation();
this.treeView.SizeChanged += delegate(object sender, SizeChangedEventArgs e) {
if (e.NewSize.Width > 0 && e.PreviousSize.Width > 0 &&
(nameColumn.Width + (e.NewSize.Width - e.PreviousSize.Width)) > 0) {
double newValue = e.NewSize.Width - this.callCountColumn.Width
if (e.NewSize.Width > 0 && e.PreviousSize.Width > 0) {
double adjustedNameColumnWidth = nameColumn.Width + e.NewSize.Width - e.PreviousSize.Width;
double matchingNameColumnWidth = e.NewSize.Width - this.callCountColumn.Width
- this.percentColumn.Width - this.timeSpentColumn.Width
- this.timeSpentSelfColumn.Width - this.timeSpentPerCallColumn.Width
- this.timeSpentSelfPerCallColumn.Width;
if ((nameColumn.Width + (e.NewSize.Width - e.PreviousSize.Width)) >= newValue)
this.nameColumn.Width = newValue - 25;
else
nameColumn.Width += (e.NewSize.Width - e.PreviousSize.Width);
- this.timeSpentSelfPerCallColumn.Width - 25;
// always keep name column at least 75 pixels wide
if (matchingNameColumnWidth < 75)
matchingNameColumnWidth = 75;
if (e.NewSize.Width >= e.PreviousSize.Width) {
// treeView got wider: also make name column wider if there's space free
if (adjustedNameColumnWidth <= matchingNameColumnWidth)
nameColumn.Width = adjustedNameColumnWidth;
} else {
// treeView got smaller: make column smaller unless there's space free
if (adjustedNameColumnWidth >= matchingNameColumnWidth)
nameColumn.Width = adjustedNameColumnWidth;
}
}
};
}

Loading…
Cancel
Save