Make the capabilities view and extensions view font aware. the capabilities column is 21 M's wide and can be adjusted, the value column is 6 M's wide, the available extensions column is 28 M's wide. I do mean M's

This commit is contained in:
John Scipione 2012-04-12 21:17:17 -04:00
parent 3f551e5c43
commit 2ddd0a7965
2 changed files with 15 additions and 6 deletions

View File

@ -35,14 +35,19 @@ CapabilitiesView::CapabilitiesView()
{ {
// add the columns // add the columns
float capabilityColWidth = this->StringWidth("MMMMMMMMMMMMMMMMMMMMM");
fCapabilityColumn = new BStringColumn(B_TRANSLATE("Capability"), fCapabilityColumn = new BStringColumn(B_TRANSLATE("Capability"),
240, 240, 240, B_TRUNCATE_MIDDLE); capabilityColWidth, capabilityColWidth - 20.0,
capabilityColWidth + 60.0, B_TRUNCATE_MIDDLE);
fCapabilitiesList->AddColumn(fCapabilityColumn, 0); fCapabilitiesList->AddColumn(fCapabilityColumn, 0);
fCapabilitiesList->SetSortingEnabled(true); fCapabilitiesList->SetSortingEnabled(true);
fCapabilitiesList->SetSortColumn(fCapabilityColumn, true, true); fCapabilitiesList->SetSortColumn(fCapabilityColumn, true, true);
fValueColumn = new BStringColumn(B_TRANSLATE("Value"), 60, 60, 60, float valueColWidth = this->StringWidth("MMMMMM");
B_TRUNCATE_MIDDLE);
fValueColumn = new BStringColumn(B_TRANSLATE("Value"), valueColWidth,
valueColWidth, valueColWidth, B_TRUNCATE_MIDDLE);
fCapabilitiesList->AddColumn(fValueColumn, 1); fCapabilitiesList->AddColumn(fValueColumn, 1);
// add the rows // add the rows
@ -89,10 +94,10 @@ CapabilitiesView::CapabilitiesView()
fCapabilitiesList->AddRow(_CreateConvolutionCapabilitiesRow()); fCapabilitiesList->AddRow(_CreateConvolutionCapabilitiesRow());
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_INDICES, fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_INDICES,
"Max. recommended index elements")); "Maximum recommended index elements"));
fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_VERTICES, fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_VERTICES,
"Max. recommended vertex elements")); "Maximum recommended vertex elements"));
// add the list // add the list

View File

@ -33,8 +33,12 @@ ExtensionsView::ExtensionsView()
{ {
// add the columns // add the columns
float availableColWidth
= this->StringWidth("MMMMMMMMMMMMMMMMMMMMMMMMMMMM");
fAvailableColumn = new BStringColumn(B_TRANSLATE("Available extensions"), fAvailableColumn = new BStringColumn(B_TRANSLATE("Available extensions"),
280, 280, 280, B_TRUNCATE_MIDDLE); availableColWidth, availableColWidth, availableColWidth,
B_TRUNCATE_MIDDLE);
fExtensionsList->AddColumn(fAvailableColumn, 0); fExtensionsList->AddColumn(fAvailableColumn, 0);
fExtensionsList->SetSortingEnabled(true); fExtensionsList->SetSortingEnabled(true);
fExtensionsList->SetSortColumn(fAvailableColumn, true, true); fExtensionsList->SetSortColumn(fAvailableColumn, true, true);