From 6a4d08ba17baf9d57a31c0346a0df6f9dc9827f1 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig <jbache@trolltech.com> Date: Mon, 3 May 2010 20:14:32 +0200 Subject: [PATCH] Fix some layout issues with the new dialog * Slightly larger row height * Make the default size slightly nicer * Fixed a drawing artifact in certain styles Note that the dialog will be resizable on linux now. Reviewed-by: mae --- src/plugins/coreplugin/dialogs/newdialog.cpp | 6 +- src/plugins/coreplugin/dialogs/newdialog.ui | 101 ++++++++++--------- 2 files changed, 59 insertions(+), 48 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index a4affddceb7..a45d022b615 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -95,7 +95,7 @@ public: } }; -#define CATEGORY_ROW_HEIGHT 18 +#define ROW_HEIGHT 24 class FancyTopLevelDelegate : public QItemDelegate { @@ -127,8 +127,8 @@ public: { QSize size = QItemDelegate::sizeHint(option, index); - if (!index.parent().isValid()) - size = size.expandedTo(QSize(0, CATEGORY_ROW_HEIGHT)); + + size = size.expandedTo(QSize(0, ROW_HEIGHT)); return size; } diff --git a/src/plugins/coreplugin/dialogs/newdialog.ui b/src/plugins/coreplugin/dialogs/newdialog.ui index 2f4f19f2554..7be599269ac 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.ui +++ b/src/plugins/coreplugin/dialogs/newdialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>513</width> - <height>390</height> + <width>554</width> + <height>412</height> </rect> </property> <property name="sizePolicy"> @@ -16,47 +16,57 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> <property name="windowTitle"> <string>New Project</string> </property> <layout class="QGridLayout" name="gridLayout"> <property name="sizeConstraint"> - <enum>QLayout::SetFixedSize</enum> + <enum>QLayout::SetDefaultConstraint</enum> </property> - <item row="3" column="1"> - <widget class="QTextBrowser" name="templateDescription"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Choose a template:</string> </property> + </widget> + </item> + <item row="1" column="0" rowspan="3"> + <widget class="QTreeView" name="templateCategoryView"> <property name="maximumSize"> <size> - <width>16777215</width> - <height>100</height> + <width>200</width> + <height>16777215</height> </size> </property> <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> - </widget> - </item> - <item row="4" column="0" colspan="2"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="styleSheet"> + <string notr="true"> QTreeView::branch { + background: transparent; + }</string> </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + <property name="indentation"> + <number>0</number> </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Choose a template:</string> + <property name="rootIsDecorated"> + <bool>false</bool> + </property> + <property name="itemsExpandable"> + <bool>false</bool> </property> + <property name="headerHidden"> + <bool>true</bool> + </property> + <attribute name="headerVisible"> + <bool>false</bool> + </attribute> </widget> </item> <item row="1" column="1" rowspan="2"> @@ -78,32 +88,33 @@ </property> </widget> </item> - <item row="1" column="0" rowspan="3"> - <widget class="QTreeView" name="templateCategoryView"> + <item row="3" column="1"> + <widget class="QTextBrowser" name="templateDescription"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="maximumSize"> <size> - <width>200</width> - <height>16777215</height> + <width>16777215</width> + <height>140</height> </size> </property> <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> - </property> - <property name="indentation"> - <number>0</number> - </property> - <property name="rootIsDecorated"> - <bool>false</bool> + <enum>Qt::NoFocus</enum> </property> - <property name="itemsExpandable"> - <bool>false</bool> + </widget> + </item> + <item row="4" column="0" colspan="2"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="headerHidden"> - <bool>true</bool> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> - <attribute name="headerVisible"> - <bool>false</bool> - </attribute> </widget> </item> </layout> -- GitLab