git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] qgit: Improve default column widths by changing resize modes

From
APAndy Parkins <andyparkins@gmail.com>
Date
Feb 7, 2007, 21:39 UTC
Message-ID
<200702072139.22272.andyparkins@gmail.com>
In-Reply-To
<75ebbfaed42a61c54ec6a38bc60d5e777a074dc5.1170884269.git.andyparkins@gmail.com>

The time column is not the best column to be auto stretched, it's probably a fixed width because it's only showing dates. The log column is more typically variable, so have that one be the one that takes up whatever space is left.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 src/common.h     |    2 +-
 src/listview.cpp |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/common.h b/src/common.h
index e3da323..43b5527 100644
--- a/src/common.h
+++ b/src/common.h
@@ -158,7 +158,7 @@ namespace QGit {
 	const int DEF_GRAPH_COL_WIDTH = 80;
 	const int DEF_LOG_COL_WIDTH   = 500;
 	const int DEF_AUTH_COL_WIDTH  = 230;
-	const int DEF_TIME_COL_WIDTH  = 130;
+	const int DEF_TIME_COL_WIDTH  = 160;
 
 	// colors
 	extern const QColor BROWN;
diff --git a/src/listview.cpp b/src/listview.cpp
index d5f8daf..91be60a 100644
--- a/src/listview.cpp
+++ b/src/listview.cpp
@@ -64,12 +64,16 @@ void ListView::setupGeometry() {
 	setPalette(pl); // does not seem to inherit application 
paletteAnnotate
 
 	QHeaderView* hv = header();
-	hv->resizeSection(GRAPH_COL, DEF_GRAPH_COL_WIDTH);
+	hv->setStretchLastSection( false );
+	hv->setResizeMode( LOG_COL, QHeaderView::Stretch );
+	hv->setResizeMode( TIME_COL, QHeaderView::Interactive);
 	hv->setResizeMode(ANN_ID_COL, QHeaderView::ResizeToContents);
+	hv->resizeSection(GRAPH_COL, DEF_GRAPH_COL_WIDTH);
 	hv->resizeSection(LOG_COL, DEF_LOG_COL_WIDTH);
 	hv->resizeSection(AUTH_COL, DEF_AUTH_COL_WIDTH);
 	hv->resizeSection(TIME_COL, DEF_TIME_COL_WIDTH);
 
+
 	if (git->isMainHistory(fh))
 		hideColumn(ANN_ID_COL);
 }
-- 
1.5.0.rc1.gf4b6c
Next: Andy Parkins
Message 1 of 2 in “qgit: Improve default column widths by changing resize modes”
  1. qgit: Improve default column widths by changing resize modesAndy Parkins, Feb 7, 2007
  2. Make file tree to tab widget ratio 1:5Andy Parkins, Feb 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.