QmlDesigner.ItemLibrary: corrected layout margins and spacing

among others, the scrollbars of the Items and Resources views
have the same size and position now
This commit is contained in:
Jörg Schummer
2010-02-18 23:57:13 +02:00
parent ce41deff98
commit 72fb762809
3 changed files with 14 additions and 12 deletions

View File

@@ -129,8 +129,8 @@ ItemLibrary::ItemLibrary(QWidget *parent) :
m_d(new ItemLibraryPrivate(this)) m_d(new ItemLibraryPrivate(this))
{ {
m_d->m_ui.setupUi(this); m_d->m_ui.setupUi(this);
layout()->setContentsMargins(3, 3, 3, 3); layout()->setContentsMargins(2, 2, 2, 0);
layout()->setSpacing(3); layout()->setSpacing(2);
m_d->m_resourcesDirModel = new QDirModel(this); m_d->m_resourcesDirModel = new QDirModel(this);

View File

@@ -124,10 +124,11 @@ Rectangle {
id: itemsFlickable id: itemsFlickable
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 2
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: scrollbar.left anchors.right: scrollbar.left
anchors.rightMargin: 6 anchors.rightMargin: 2
clip: true clip: true
interactive: false interactive: false
@@ -161,7 +162,9 @@ Rectangle {
id: scrollbar id: scrollbar
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 2
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: 2
anchors.left: parent.right anchors.left: parent.right
anchors.leftMargin: -10 anchors.leftMargin: -10
anchors.right: parent.right anchors.right: parent.right

View File

@@ -128,23 +128,22 @@ Item {
id: handle id: handle
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 1
anchors.right: parent.right anchors.right: parent.right
// anchors.rightMargin: 1
height: Math.max(width, bar.height * Math.min(1, scrollFlickable.visibleArea.heightRatio)) height: Math.max(width, bar.height * Math.min(1, scrollFlickable.visibleArea.heightRatio))
// radius: width / 2
// color: style.scrollbarHandleColor
Rectangle { Rectangle {
width: parent.height width: parent.height - 1
height: parent.width height: parent.width
y: parent.height y: 1 - height
rotation: -90 rotation: 90
transformOrigin: Item.TopLeft transformOrigin: Item.BottomLeft
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: "#C6C6C6" } GradientStop { position: 0.0; color: "#7E7E7E" }
GradientStop { position: 1.0; color: "#7E7E7E" } GradientStop { position: 1.0; color: "#C6C6C6" }
} }
} }