From e3919359d66e401d31688f61824f7c7f7d2ca698 Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Fri, 15 Apr 2011 18:44:34 +0000 Subject: [PATCH] Update OpenGL preferences to accommodate for the fact that empty columns in a BGridLayout are now collapsed to nothingness. Fixes part of #7446. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41257 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/opengl/CapabilitiesView.cpp | 8 +++++--- src/preferences/opengl/InfoView.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/preferences/opengl/CapabilitiesView.cpp b/src/preferences/opengl/CapabilitiesView.cpp index 031638ab9c..e5de1a2335 100644 --- a/src/preferences/opengl/CapabilitiesView.cpp +++ b/src/preferences/opengl/CapabilitiesView.cpp @@ -82,9 +82,11 @@ CapabilitiesView::CapabilitiesView() layout->AddItem(BSpaceLayoutItem::CreateGlue(), 0, layout->CountRows(), layout->CountColumns(), 1); - float spacing = be_control_look->DefaultItemSpacing(); - layout->SetHorizontalSpacing(spacing / 2.0f); - // divide by two to compensate for empty column 1 + // Set horizontal spacing to 0, and use the middle column as + // variable-width spacing (like layout 'glue'). + layout->SetHorizontalSpacing(0); + layout->SetMinColumnWidth(1, be_control_look->DefaultLabelSpacing()); + layout->SetMaxColumnWidth(1, B_SIZE_UNLIMITED); } diff --git a/src/preferences/opengl/InfoView.cpp b/src/preferences/opengl/InfoView.cpp index 4fdc5703a3..f1f05c0496 100644 --- a/src/preferences/opengl/InfoView.cpp +++ b/src/preferences/opengl/InfoView.cpp @@ -51,9 +51,11 @@ InfoView::InfoView() layout->AddItem(BSpaceLayoutItem::CreateGlue(), 0, layout->CountRows(), layout->CountColumns(), 1); - float spacing = be_control_look->DefaultItemSpacing(); - layout->SetHorizontalSpacing(spacing / 2.0f); - // divide by two to compensate for empty column 1 + // Set horizontal spacing to 0, and use the middle column as + // variable-width spacing (like layout 'glue'). + layout->SetHorizontalSpacing(0); + layout->SetMinColumnWidth(1, be_control_look->DefaultLabelSpacing()); + layout->SetMaxColumnWidth(1, B_SIZE_UNLIMITED); }