[Commits] (davids) colheader - reduced minimum inset for center-justified items

commits at osafoundation.org commits at osafoundation.org
Sat Apr 23 14:16:22 PDT 2005


Commit by: davids
Modified files:
internal/wxPython-2.5/src/generic/colheader.cpp 1.80 1.81

Log message:

colheader - reduced minimum inset for center-justified items
r=TBD



ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/src/generic/colheader.cpp.diff?r1=text&tr1=1.80&r2=text&tr2=1.81

Index: internal/wxPython-2.5/src/generic/colheader.cpp
diff -u internal/wxPython-2.5/src/generic/colheader.cpp:1.80 internal/wxPython-2.5/src/generic/colheader.cpp:1.81
--- internal/wxPython-2.5/src/generic/colheader.cpp:1.80	Sat Apr 23 01:52:50 2005
+++ internal/wxPython-2.5/src/generic/colheader.cpp	Sat Apr 23 14:16:20 2005
@@ -2277,8 +2277,8 @@
 
 	rightInsetX =
 		(m_BSortEnabled
-		? (2 * wxCH_kMetricInsetX) + wxCH_kMetricArrowSizeX
-		: wxCH_kMetricInsetX);
+		? wxCH_kMetricInsetX + wxCH_kMetricArrowSizeX
+		: wxCH_kMetricInsetX / 2);
 
 	switch (m_TextJust)
 	{
@@ -2287,9 +2287,6 @@
 		break;
 
 	case CH_JUST_Right:
-		leftInsetX = wxCH_kMetricInsetX;
-		break;
-
 	case CH_JUST_Left:
 	default:
 		leftInsetX = wxCH_kMetricInsetX;
@@ -2309,13 +2306,13 @@
 	switch (m_TextJust)
 	{
 	case CH_JUST_Right:
-		if ((m_LabelTextExtent.x >= 0) && (extentX > m_LabelTextExtent.x))
-			leftDeltaX = extentX - m_LabelTextExtent.x;
-		break;
-
 	case CH_JUST_Center:
-		if ((m_LabelTextExtent.x >= 0) && (extentX > m_LabelTextExtent.x))
-			leftDeltaX = (extentX - m_LabelTextExtent.x) / 2;
+		if ((m_LabelTextExtent.x >= 0) && (m_LabelTextExtent.x < extentX))
+		{
+			leftDeltaX = extentX - m_LabelTextExtent.x;
+			if (m_TextJust == CH_JUST_Center)
+				leftDeltaX /= 2;
+		}
 		break;
 
 	case CH_JUST_Left:



More information about the Commits mailing list