From 94c8314343ef50db13be7dabfeb0d1e28deb8a5c Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Tue, 19 Jul 2011 19:37:48 +0200
Subject: [PATCH] Fixes and UI-Changes:

- Swap Recent Sessions and Recent Projects
- Fix tooltip error
- Change column width ratio in develop screen from 50/50 to 40/60
- reapply fix for off-by-one pixel error in the tab widget

Change-Id: Ibbcea66262723fed1a54ac63b735bc25241d1846
Reviewed-on: http://codereview.qt.nokia.com/1891
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
---
 share/qtcreator/welcomescreen/develop.qml     | 20 +++++++++----------
 .../qtcreator/welcomescreen/welcomescreen.qml | 16 ++++++++++++---
 .../welcomescreen/widgets/ExampleBrowser.qml  |  3 ++-
 .../welcomescreen/widgets/LinksBar.qml        | 13 +++---------
 .../welcomescreen/widgets/RecentProjects.qml  |  8 ++++----
 .../welcomescreen/widgets/RecentSessions.qml  |  8 ++++----
 6 files changed, 36 insertions(+), 32 deletions(-)

diff --git a/share/qtcreator/welcomescreen/develop.qml b/share/qtcreator/welcomescreen/develop.qml
index 4d0fd4b0335..f4e7defdb99 100644
--- a/share/qtcreator/welcomescreen/develop.qml
+++ b/share/qtcreator/welcomescreen/develop.qml
@@ -47,19 +47,19 @@ Item {
             id: baseitem
             height: Math.max(recentSessions.height, recentProjects.height)
             width: root.width
-
-            Widgets.RecentProjects {
-                id: recentProjects
-                anchors.left: parent.left
-                width: Math.floor(root.width / 2)
-            }
             Widgets.RecentSessions {
                 id: recentSessions
-                anchors.left:  recentProjects.right
+                width: Math.floor(root.width / 2.5)
+                anchors.left: parent.left
+            }
+            Widgets.RecentProjects {
+                id: recentProjects
+                anchors.left:  recentSessions.right
                 anchors.right: parent.right
-                anchors.rightMargin: scrollArea.height >= baseitem.height ?
-                                     -scrollArea.verticalScrollBar.width : 0
+                anchors.rightMargin: scrollArea.verticalScrollBar.visible ? 0 :
+                                         -scrollArea.verticalScrollBar.width
             }
+
         }
     }
     Rectangle {
@@ -67,6 +67,6 @@ Item {
         height: root.height + 2 * margin
         width: 1
         color: "#ccc"
-        x: recentSessions.x - margin
+        x: recentProjects.x - margin
     }
 }
diff --git a/share/qtcreator/welcomescreen/welcomescreen.qml b/share/qtcreator/welcomescreen/welcomescreen.qml
index 75ef60b9c70..288f1e1c32e 100644
--- a/share/qtcreator/welcomescreen/welcomescreen.qml
+++ b/share/qtcreator/welcomescreen/welcomescreen.qml
@@ -62,16 +62,26 @@ Rectangle {
         border.bottom: 10
     }
 
+    BorderImage {
+        id: deadArea
+        anchors.left: parent.left
+        anchors.top: inner_background.bottom
+        anchors.topMargin: -2
+        width: news.width
+        height: navigationAndDevLinks.height
+        border { top: 1; bottom: 1}
+        source: "qrc:welcome/images/tab_inactive.png"
+        Rectangle { anchors.right: parent.right; height: parent.height; y:0; width: 1; color: "black"}
+    }
     LinksBar {
         id: navigationAndDevLinks
         property alias current: root.current
         anchors.top: inner_background.bottom
-        anchors.left: parent.left
+        anchors.left: deadArea.right
+        anchors.right: parent.right
         anchors.bottomMargin: 4
         anchors.topMargin: -2
-        width: parent.width
         model: tabs.model
-        tabBarWidth: width
     }
 
     Rectangle {
diff --git a/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml b/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml
index f94c673f874..c81c6e31a16 100644
--- a/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml
+++ b/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml
@@ -32,6 +32,7 @@
 
 import QtQuick 1.0
 import components 1.0 as Components
+import widgets 1.0 as Widgets
 
 Item {
     id: exampleBrowserRoot
@@ -48,7 +49,7 @@ Item {
         anchors.leftMargin: - 8
         anchors.rightMargin: scrollArea.verticalScrollBar.visible ? 0 : -8
 
-        LineEdit {
+        Widgets.LineEdit {
             placeholderText: !checkBox.checked ? qsTr("Search in Tutorials") : qsTr("Search in Tutorials, Examples and Demos")
             focus: true
             id: lineEdit
diff --git a/share/qtcreator/welcomescreen/widgets/LinksBar.qml b/share/qtcreator/welcomescreen/widgets/LinksBar.qml
index b91b40fe31c..dbf3ce55b36 100644
--- a/share/qtcreator/welcomescreen/widgets/LinksBar.qml
+++ b/share/qtcreator/welcomescreen/widgets/LinksBar.qml
@@ -38,23 +38,16 @@ Row {
     height: 25
 
     property alias model: tabs.model
-    property int tabBarWidth
-
+    property int tabWidth: Math.floor(tabBar.width/tabs.count)
     Repeater {
         id: tabs
         height: tabBar.height
         model: parent.model
-        delegate:
-            Item {
+        delegate: Item {
             Components.QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent }
-            width: tabBarWidth / tabs.count
             height: tabBar.height
 
-            Rectangle {
-                width: parent.width; height: 1
-                anchors { bottom: parent.bottom; bottomMargin: 1 }
-                color: "#acb2c2"
-            }
+            width: tabs.count-1 === index ? tabWidth : tabWidth + tabBar.width%tabs.count
             BorderImage {
                 id: tabBackground
                 anchors.fill: parent
diff --git a/share/qtcreator/welcomescreen/widgets/RecentProjects.qml b/share/qtcreator/welcomescreen/widgets/RecentProjects.qml
index d277f5ce406..0c620bbd9b9 100644
--- a/share/qtcreator/welcomescreen/widgets/RecentProjects.qml
+++ b/share/qtcreator/welcomescreen/widgets/RecentProjects.qml
@@ -53,13 +53,13 @@ HeaderItemView {
             id: arrowImage;
             source: "qrc:welcome/images/list_bullet_arrow.png";
             anchors.verticalCenter: parent.verticalCenter;
-            anchors.right: parent.right
-            anchors.rightMargin: 10
+            anchors.left: parent.left
+            anchors.leftMargin: 10
         }
 
         Column {
             spacing: 4
-            anchors.left: parent.left
+            anchors.left: arrowImage.right
             anchors.right: parent.right
             anchors.verticalCenter: parent.verticalCenter
             Text {
@@ -91,7 +91,7 @@ HeaderItemView {
             interval: 1000
             onTriggered: {
                 if (filepath.truncated)
-                    styleItem.showToolTip(sessionName)
+                    styleItem.showToolTip(filePath)
             }
         }
 
diff --git a/share/qtcreator/welcomescreen/widgets/RecentSessions.qml b/share/qtcreator/welcomescreen/widgets/RecentSessions.qml
index ac4a825d329..19c6fb6c3ac 100644
--- a/share/qtcreator/welcomescreen/widgets/RecentSessions.qml
+++ b/share/qtcreator/welcomescreen/widgets/RecentSessions.qml
@@ -64,16 +64,16 @@ HeaderItemView {
             id: arrowImage;
             source: "qrc:welcome/images/list_bullet_arrow.png"
             anchors.verticalCenter: parent.verticalCenter
-            anchors.right: parent.right
-            anchors.rightMargin: 10
+            anchors.left: parent.left
+            anchors.leftMargin: 10
         }
 
         Text {
             id: fileNameText
             text: parent.fullSessionName()
             elide: Text.ElideMiddle
-            anchors.left: parent.left
-            anchors.right: arrowImage.right
+            anchors.left: arrowImage.right
+            anchors.right: parent.right
             anchors.verticalCenter: parent.verticalCenter
             anchors.leftMargin: 10
             anchors.rightMargin: 20
-- 
GitLab