threads / patch / 6727

patchqgit: Improve default column widths by changing resize modes

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

## tl;dr

2 messages between Feb 7, 2007 and Feb 7, 2007. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Andy Parkins· Feb 7, 2007, 21:39 UTC · lore

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(-)
Show changes to 2 files +6 −2

src/common.h, src/listview.cpp

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
Andy Parkins· Feb 7, 2007, 21:39 UTC · lore

[PATCH] Make file tree to tab widget ratio 1:5

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 src/mainview.ui |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
Show changes to src/mainview.ui +17 −1
diff --git a/src/mainview.ui b/src/mainview.ui
index 5376291..7919b5d 100644
--- a/src/mainview.ui
+++ b/src/mainview.ui
@@ -29,6 +29,14 @@
        <enum>Qt::Horizontal</enum>
       </property>
       <widget class="TreeView" name="treeView" >
+       <property name="sizePolicy" >
+        <sizepolicy>
+         <hsizetype>7</hsizetype>
+         <vsizetype>13</vsizetype>
+         <horstretch>1</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
        <property name="contextMenuPolicy" >
         <enum>Qt::CustomContextMenu</enum>
        </property>
@@ -48,6 +56,14 @@
        </column>
       </widget>
       <widget class="QTabWidget" name="tabWdg" >
+       <property name="sizePolicy" >
+        <sizepolicy>
+         <hsizetype>7</hsizetype>
+         <vsizetype>7</vsizetype>
+         <horstretch>5</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
        <widget class="QWidget" name="TabWdg" >
         <attribute name="title" >
          <string>Tab&amp;Wdg</string>
@@ -90,7 +106,7 @@
      <x>0</x>
      <y>0</y>
      <width>975</width>
-     <height>32</height>
+     <height>31</height>
     </rect>
    </property>
    <widget class="QMenu" name="Edit" >
-- 
1.5.0.rc1.gf4b6c

← back to recent threads