[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.4/kdepim/kalarm
From:       David Jarvie <software () astrojar ! org ! uk>
Date:       2006-01-22 14:29:42
Message-ID: 1137940182.124465.14855.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 501245 by djarvie:

Bug 120539: Fix column widths when main window is resized, if columns have been reordered

 M  +2 -1      Changelog  
 M  +18 -7     eventlistviewbase.cpp  


--- branches/KDE/3.4/kdepim/kalarm/Changelog #501244:501245
@@ -1,10 +1,11 @@
 KAlarm
 
-=== Version 1.2.11 --- 3 January 2006 ===
+=== Version 1.2.11 --- 22 January 2006 ===
 Make autoclose of message windows work.
 Fix toolbar configuration being lost after quitting KAlarm.
 Ensure that day and month names translations are independent of locale calendar.
 Display alarm message windows within current screen in multi-head systems.
+Fix column widths when main window is resized, if columns have been reordered.
 
 === Version 1.2.10 --- 10 September 2005 ===
 Prevent session restoration displaying main windows which should be hidden.
--- branches/KDE/3.4/kdepim/kalarm/eventlistviewbase.cpp #501244:501245
@@ -211,13 +211,24 @@
 		if (mw > lastColumnWidth)
 			lastColumnWidth = mw;
 	}
-	int x = header()->sectionPos(mLastColumn);
-	int width = visibleWidth() - x;
-	if (width < lastColumnWidth)
-		width = lastColumnWidth;
-	setColumnWidth(mLastColumn, width);
-	if (contentsWidth() > x + width)
-		resizeContents(x + width, contentsHeight());
+	QHeader* head = header();
+	int x = head->sectionPos(mLastColumn);
+	int availableWidth = visibleWidth() - x;
+	int rightColWidth = 0;
+	int index = head->mapToIndex(mLastColumn);
+	if (index < mLastColumn)
+	{
+		// The last column has been dragged by the user to a different position.
+		// Ensure that the columns now to the right of it are still shown.
+		for (int i = index + 1;  i <= mLastColumn;  ++i)
+			rightColWidth += columnWidth(head->mapToSection(i));
+		availableWidth -= rightColWidth;
+	}
+	if (availableWidth < lastColumnWidth)
+		availableWidth = lastColumnWidth;
+	setColumnWidth(mLastColumn, availableWidth);
+	if (contentsWidth() > x + availableWidth + rightColWidth)
+		resizeContents(x + availableWidth + rightColWidth, contentsHeight());
 }
 
 /******************************************************************************
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic