From 2ddd0a7965b7551f4b2ac1d80c7f20518bbb3a65 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 12 Apr 2012 21:17:17 -0400 Subject: [PATCH] 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 --- src/preferences/3drendering/CapabilitiesView.cpp | 15 ++++++++++----- src/preferences/3drendering/ExtensionsView.cpp | 6 +++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/preferences/3drendering/CapabilitiesView.cpp b/src/preferences/3drendering/CapabilitiesView.cpp index 7d3d5a637a..3cf9983f78 100644 --- a/src/preferences/3drendering/CapabilitiesView.cpp +++ b/src/preferences/3drendering/CapabilitiesView.cpp @@ -35,14 +35,19 @@ CapabilitiesView::CapabilitiesView() { // add the columns + float capabilityColWidth = this->StringWidth("MMMMMMMMMMMMMMMMMMMMM"); + 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->SetSortingEnabled(true); fCapabilitiesList->SetSortColumn(fCapabilityColumn, true, true); - fValueColumn = new BStringColumn(B_TRANSLATE("Value"), 60, 60, 60, - B_TRUNCATE_MIDDLE); + float valueColWidth = this->StringWidth("MMMMMM"); + + fValueColumn = new BStringColumn(B_TRANSLATE("Value"), valueColWidth, + valueColWidth, valueColWidth, B_TRUNCATE_MIDDLE); fCapabilitiesList->AddColumn(fValueColumn, 1); // add the rows @@ -89,10 +94,10 @@ CapabilitiesView::CapabilitiesView() fCapabilitiesList->AddRow(_CreateConvolutionCapabilitiesRow()); fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_INDICES, - "Max. recommended index elements")); + "Maximum recommended index elements")); fCapabilitiesList->AddRow(_CreateCapabilitiesRow(GL_MAX_ELEMENTS_VERTICES, - "Max. recommended vertex elements")); + "Maximum recommended vertex elements")); // add the list diff --git a/src/preferences/3drendering/ExtensionsView.cpp b/src/preferences/3drendering/ExtensionsView.cpp index 36bcba639d..6c8782a2fc 100644 --- a/src/preferences/3drendering/ExtensionsView.cpp +++ b/src/preferences/3drendering/ExtensionsView.cpp @@ -33,8 +33,12 @@ ExtensionsView::ExtensionsView() { // add the columns + float availableColWidth + = this->StringWidth("MMMMMMMMMMMMMMMMMMMMMMMMMMMM"); + fAvailableColumn = new BStringColumn(B_TRANSLATE("Available extensions"), - 280, 280, 280, B_TRUNCATE_MIDDLE); + availableColWidth, availableColWidth, availableColWidth, + B_TRUNCATE_MIDDLE); fExtensionsList->AddColumn(fAvailableColumn, 0); fExtensionsList->SetSortingEnabled(true); fExtensionsList->SetSortColumn(fAvailableColumn, true, true);