1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-12 07:35:51 +01:00

Make sure columns are full width for key and name views.

This commit is contained in:
lllucius
2013-10-06 07:37:26 +00:00
parent 7f8152ff49
commit 61f8e16026

View File

@@ -672,11 +672,6 @@ KeyView::RefreshBindings(const wxArrayString & names,
// Add it to the tree // Add it to the tree
mNodes.Add(node); mNodes.Add(node);
inpfx = true; inpfx = true;
// Measure prefix
GetTextExtent(pfx, &x, &y);
mLineHeight = wxMax(mLineHeight, y);
mCommandWidth = wxMax(mCommandWidth, x);
} }
} }
@@ -716,9 +711,10 @@ KeyView::RefreshBindings(const wxArrayString & names,
mLineHeight = wxMax(mLineHeight, y); mLineHeight = wxMax(mLineHeight, y);
mKeyWidth = wxMax(mKeyWidth, x); mKeyWidth = wxMax(mKeyWidth, x);
// Prepend prefix for view types other than tree // Prepend prefix for all view types to determine maximum
// column widths
wxString label = node.label; wxString label = node.label;
if (mViewType != ViewByTree && !node.prefix.IsEmpty()) if (!node.prefix.IsEmpty())
{ {
label = node.prefix + wxT(" - ") + label; label = node.prefix + wxT(" - ") + label;
} }
@@ -764,12 +760,6 @@ KeyView::RefreshLines()
{ {
int cnt = (int) mNodes.GetCount(); int cnt = (int) mNodes.GetCount();
int linecnt = 0; int linecnt = 0;
// Clear any previously assigned line numbers
for (int i = 0, lcnt = (int) mLines.GetCount(); i < lcnt; i++)
{
mLines[i]->line = -1;
}
mLines.Empty(); mLines.Empty();
// Process a filter if one is set // Process a filter if one is set
@@ -780,6 +770,9 @@ KeyView::RefreshLines()
{ {
KeyNode & node = mNodes[i]; KeyNode & node = mNodes[i];
// Reset line number
node.line = wxNOT_FOUND;
// Search columns based on view type // Search columns based on view type
wxString searchit; wxString searchit;
switch (mViewType) switch (mViewType)
@@ -881,6 +874,9 @@ KeyView::RefreshLines()
{ {
KeyNode & node = mNodes[i]; KeyNode & node = mNodes[i];
// Reset line number
node.line = wxNOT_FOUND;
// Node is either a category or prefix // Node is either a category or prefix
if (node.isparent) if (node.isparent)
{ {