[haiku-commits] r41257 - haiku/trunk/src/preferences/opengl

  • From: yourpalal2@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 15 Apr 2011 20:44:35 +0200 (CEST)

Author: yourpalal
Date: 2011-04-15 20:44:34 +0200 (Fri, 15 Apr 2011)
New Revision: 41257
Changeset: https://dev.haiku-os.org/changeset/41257
Ticket: https://dev.haiku-os.org/ticket/7446

Modified:
   haiku/trunk/src/preferences/opengl/CapabilitiesView.cpp
   haiku/trunk/src/preferences/opengl/InfoView.cpp
Log:
Update OpenGL preferences to accommodate for the fact that empty columns in a 
BGridLayout are now collapsed to nothingness. Fixes part of #7446.


Modified: haiku/trunk/src/preferences/opengl/CapabilitiesView.cpp
===================================================================
--- haiku/trunk/src/preferences/opengl/CapabilitiesView.cpp     2011-04-15 
18:35:26 UTC (rev 41256)
+++ haiku/trunk/src/preferences/opengl/CapabilitiesView.cpp     2011-04-15 
18:44:34 UTC (rev 41257)
@@ -82,9 +82,11 @@
        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);
 }
 
 

Modified: haiku/trunk/src/preferences/opengl/InfoView.cpp
===================================================================
--- haiku/trunk/src/preferences/opengl/InfoView.cpp     2011-04-15 18:35:26 UTC 
(rev 41256)
+++ haiku/trunk/src/preferences/opengl/InfoView.cpp     2011-04-15 18:44:34 UTC 
(rev 41257)
@@ -51,9 +51,11 @@
        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);
 }
 
 


Other related posts:

  • » [haiku-commits] r41257 - haiku/trunk/src/preferences/opengl - yourpalal2