From 014862b773c90fbb75674a296064a02ff3db43fb Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 19 Feb 2012 21:32:48 +0200 Subject: Rename Recent Sessions -> Sessions All available sessions are displayed, not only recent Change-Id: Ib2bc419526135eff414f7c997b2bf603424aa452 Reviewed-by: Thomas Hartmann Reviewed-by: Daniel Molkentin --- share/qtcreator/welcomescreen/develop.qml | 30 +- .../welcomescreen/widgets/RecentSessions.qml | 338 --------------------- share/qtcreator/welcomescreen/widgets/Sessions.qml | 338 +++++++++++++++++++++ 3 files changed, 353 insertions(+), 353 deletions(-) delete mode 100644 share/qtcreator/welcomescreen/widgets/RecentSessions.qml create mode 100644 share/qtcreator/welcomescreen/widgets/Sessions.qml (limited to 'share') diff --git a/share/qtcreator/welcomescreen/develop.qml b/share/qtcreator/welcomescreen/develop.qml index 73c6a50836f..e6ae8f83ed5 100644 --- a/share/qtcreator/welcomescreen/develop.qml +++ b/share/qtcreator/welcomescreen/develop.qml @@ -68,9 +68,9 @@ Rectangle { width: 1 height: line.height color: "#c4c4c4" - anchors.left: recentSessions.right + anchors.left: sessions.right anchors.leftMargin: -1 - anchors.top: recentSessions.top + anchors.top: sessions.top } @@ -81,9 +81,9 @@ Rectangle { height: 432 id: recentProjects - anchors.left: recentlyUsedProjects.left + anchors.left: recentProjectsTitle.left - anchors.top: recentlyUsedProjects.bottom + anchors.top: recentProjectsTitle.bottom anchors.topMargin: 20 anchors.bottom: parent.bottom anchors.bottomMargin: 40 @@ -104,26 +104,26 @@ Rectangle { } Text { - id: recentlyUsedSessions + id: sessionsTitle x: pageCaption.x + pageCaption.textOffset y: 105 color: "#535353" - text: qsTr("Recently used sessions") + text: qsTr("Sessions") font.pixelSize: 16 font.family: "Helvetica" font.bold: true } Text { - id: recentlyUsedProjects + id: recentProjectsTitle x: 406 y: 105 color: "#535353" - text: qsTr("Recently used Projects") - anchors.left: recentlyUsedSessions.right + text: qsTr("Recent Projects") + anchors.left: sessionsTitle.right anchors.leftMargin: 160 font.bold: true font.family: "Helvetica" @@ -139,7 +139,7 @@ Rectangle { height: 70 anchors.topMargin: 42 - anchors.top: recentSessions.bottom + anchors.top: sessions.bottom LinkedText { id: openProject @@ -169,17 +169,17 @@ Rectangle { } } - RecentSessions { - id: recentSessions + Sessions { + id: sessions x: 87 y: 144 width: 274 - anchors.left: recentlyUsedSessions.left - anchors.right: recentlyUsedProjects.left + anchors.left: sessionsTitle.left + anchors.right: recentProjectsTitle.left anchors.rightMargin: 40 - anchors.top: recentlyUsedSessions.bottom + anchors.top: sessionsTitle.bottom anchors.topMargin: 20 model: sessionList diff --git a/share/qtcreator/welcomescreen/widgets/RecentSessions.qml b/share/qtcreator/welcomescreen/widgets/RecentSessions.qml deleted file mode 100644 index fbcf031a30a..00000000000 --- a/share/qtcreator/welcomescreen/widgets/RecentSessions.qml +++ /dev/null @@ -1,338 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -import QtQuick 1.0 -import qtcomponents 1.0 - -Item { - property alias model: root.model - height: Math.min(root.count * root.delegateHeight, 276) - - - ListView { - id: root - - anchors.fill: parent - - snapMode: ListView.SnapToItem - property int delegateHeight: currentItem.height + spacing - - clip: true - interactive: false - - spacing: 4 - - property bool delayedHide: false - - Behavior on delayedHide { - PropertyAnimation { duration: 200; } - } - - onDelayedHideChanged: { - panel.opacity = 0; - } - - delegate: SessionItem { - id: item - - property bool activate: hovered - - Behavior on activate { - PropertyAnimation { duration: 50 } - } - - onActivateChanged: { - if (activate) { - panel.y = item.y + 20 - root.contentY; - panel.opacity = 1; - panel.projectsPathList = projectsPath; - panel.projectsDisplayList = projectsName - panel.currentSession = sessionName; - } else { - if (!panel.hovered) - panel.opacity = 0 - } - } - - onClicked: { - root.delayedHide = !root.delayedHide - } - - function fullSessionName() - { - var newSessionName = sessionName - if (model.lastSession && sessionList.isDefaultVirgin()) - newSessionName = qsTr("%1 (last session)").arg(sessionName); - else if (model.activeSession && !sessionList.isDefaultVirgin()) - newSessionName = qsTr("%1 (current session)").arg(sessionName); - return newSessionName; - } - - name: fullSessionName() - } - - WheelArea { - id: wheelarea - anchors.fill: parent - verticalMinimumValue: vscrollbar.minimumValue - verticalMaximumValue: vscrollbar.maximumValue - - onVerticalValueChanged: root.contentY = Math.round(verticalValue / root.delegateHeight) * root.delegateHeight - } - - ScrollBar { - id: vscrollbar - orientation: Qt.Vertical - property int availableHeight : root.height - visible: root.contentHeight > availableHeight - maximumValue: root.contentHeight > availableHeight ? root.contentHeight - availableHeight : 0 - minimumValue: 0 - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - singleStep: root.delegateHeight - anchors.topMargin: styleitem.style == "mac" ? 1 : 0 - onValueChanged: root.contentY = Math.round(value / root.delegateHeight) * root.delegateHeight - anchors.rightMargin: styleitem.frameoffset - anchors.bottomMargin: styleitem.frameoffset - } - } - - Rectangle { - - CustomFonts { - id: fonts - } - - id: panel - - border.width: 1 - smooth: true - opacity: 0 - - property int margin: 12 - - width: panelColumn.width + margin * 2 - height: panelColumn.height + margin * 2 - - property bool hovered: false - - property variant projectsPathList - property variant projectsDisplayList - - property string currentSession - - onHoveredChanged: { - if (panel.hovered) - panel.opacity = 1; - else - panel.opacity = 0; - } - - MouseArea { - anchors.topMargin: 0 - anchors.fill: parent - id: panelMouseArea - hoverEnabled: true - onEntered: { - panel.hovered = true - } - onExited: { - panel.hovered = false - } - } - - Column { - x: panel.margin - y: panel.margin - id: panelColumn - spacing: 8 - - Repeater { - model: panel.projectsPathList - delegate: Row { - spacing: 6 - Text { - text: panel.projectsDisplayList[index] - font: fonts.boldDescription - } - Text { - text: modelData - font: fonts.linkFont - } - } - } - - Row { - x: -2 - spacing: 2 - id: add - - Item { - //place hold for an icon - width: 16 - height: 16 - - MouseArea { - id: exitMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: { - panel.hovered = true - } - onExited: { - panel.hovered = false - } - onClicked: { - //Will be uncommented once we have an icon - //model.cloneSession(panel.currentSession); - } - } - } - LinkedText { - text: qsTr("Clone this session") - onEntered: { - panel.hovered = true - } - onExited: { - panel.hovered = false - } - onClicked: { - panel.opacity = 0; - model.cloneSession(panel.currentSession); - } - } - } - Row { - x: -2 - spacing: 2 - id: clear - - Item { - //place holder for an icon - width: 16 - height: 16 - - - MouseArea { - id: clearMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: { - panel.hovered = true - } - onExited: { - panel.hovered = false - } - onClicked: { - //Will be uncommented once we have an icon - //model.deleteSession(panel.currentSession); - } - } - } - LinkedText { - text: qsTr("Delete this session") - onEntered: { - panel.hovered = true - } - onExited: { - panel.hovered = false - } - onClicked: { - panel.opacity = 0; - model.deleteSession(panel.currentSession); - } - } - } - Row { - x: -2 - spacing: 2 - id: rename - - Item { - //place holder for an icon - opacity: clearMouseArea.containsMouse ? 0.8 : 1 - Behavior on opacity { - PropertyAnimation { duration: visible ? 0 : 50; } - } - - width: 16 - height: 16 - - MouseArea { - id: renameMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: { - panel.hovered = true - } - onExited: { - panel.hovered = false - } - onClicked: { - //Will be uncommented once we have an icon - //model.renameSession(panel.currentSession); - } - } - } - LinkedText { - text: qsTr("Rename this session") - onEntered: { - panel.hovered = true - } - onExited: { - panel.hovered = false - } - onClicked: { - panel.opacity = 0; - model.renameSession(panel.currentSession); - } - } - } - } - - Behavior on opacity { - PropertyAnimation { duration: visible ? 50 : 100; } - } - radius: 2 - gradient: Gradient { - GradientStop { - position: 0.00; - color: "#ffffff"; - } - GradientStop { - position: 1.00; - color: "#e4e5f0"; - } - } - } -} diff --git a/share/qtcreator/welcomescreen/widgets/Sessions.qml b/share/qtcreator/welcomescreen/widgets/Sessions.qml new file mode 100644 index 00000000000..fbcf031a30a --- /dev/null +++ b/share/qtcreator/welcomescreen/widgets/Sessions.qml @@ -0,0 +1,338 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +import QtQuick 1.0 +import qtcomponents 1.0 + +Item { + property alias model: root.model + height: Math.min(root.count * root.delegateHeight, 276) + + + ListView { + id: root + + anchors.fill: parent + + snapMode: ListView.SnapToItem + property int delegateHeight: currentItem.height + spacing + + clip: true + interactive: false + + spacing: 4 + + property bool delayedHide: false + + Behavior on delayedHide { + PropertyAnimation { duration: 200; } + } + + onDelayedHideChanged: { + panel.opacity = 0; + } + + delegate: SessionItem { + id: item + + property bool activate: hovered + + Behavior on activate { + PropertyAnimation { duration: 50 } + } + + onActivateChanged: { + if (activate) { + panel.y = item.y + 20 - root.contentY; + panel.opacity = 1; + panel.projectsPathList = projectsPath; + panel.projectsDisplayList = projectsName + panel.currentSession = sessionName; + } else { + if (!panel.hovered) + panel.opacity = 0 + } + } + + onClicked: { + root.delayedHide = !root.delayedHide + } + + function fullSessionName() + { + var newSessionName = sessionName + if (model.lastSession && sessionList.isDefaultVirgin()) + newSessionName = qsTr("%1 (last session)").arg(sessionName); + else if (model.activeSession && !sessionList.isDefaultVirgin()) + newSessionName = qsTr("%1 (current session)").arg(sessionName); + return newSessionName; + } + + name: fullSessionName() + } + + WheelArea { + id: wheelarea + anchors.fill: parent + verticalMinimumValue: vscrollbar.minimumValue + verticalMaximumValue: vscrollbar.maximumValue + + onVerticalValueChanged: root.contentY = Math.round(verticalValue / root.delegateHeight) * root.delegateHeight + } + + ScrollBar { + id: vscrollbar + orientation: Qt.Vertical + property int availableHeight : root.height + visible: root.contentHeight > availableHeight + maximumValue: root.contentHeight > availableHeight ? root.contentHeight - availableHeight : 0 + minimumValue: 0 + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + singleStep: root.delegateHeight + anchors.topMargin: styleitem.style == "mac" ? 1 : 0 + onValueChanged: root.contentY = Math.round(value / root.delegateHeight) * root.delegateHeight + anchors.rightMargin: styleitem.frameoffset + anchors.bottomMargin: styleitem.frameoffset + } + } + + Rectangle { + + CustomFonts { + id: fonts + } + + id: panel + + border.width: 1 + smooth: true + opacity: 0 + + property int margin: 12 + + width: panelColumn.width + margin * 2 + height: panelColumn.height + margin * 2 + + property bool hovered: false + + property variant projectsPathList + property variant projectsDisplayList + + property string currentSession + + onHoveredChanged: { + if (panel.hovered) + panel.opacity = 1; + else + panel.opacity = 0; + } + + MouseArea { + anchors.topMargin: 0 + anchors.fill: parent + id: panelMouseArea + hoverEnabled: true + onEntered: { + panel.hovered = true + } + onExited: { + panel.hovered = false + } + } + + Column { + x: panel.margin + y: panel.margin + id: panelColumn + spacing: 8 + + Repeater { + model: panel.projectsPathList + delegate: Row { + spacing: 6 + Text { + text: panel.projectsDisplayList[index] + font: fonts.boldDescription + } + Text { + text: modelData + font: fonts.linkFont + } + } + } + + Row { + x: -2 + spacing: 2 + id: add + + Item { + //place hold for an icon + width: 16 + height: 16 + + MouseArea { + id: exitMouseArea + anchors.fill: parent + hoverEnabled: true + onEntered: { + panel.hovered = true + } + onExited: { + panel.hovered = false + } + onClicked: { + //Will be uncommented once we have an icon + //model.cloneSession(panel.currentSession); + } + } + } + LinkedText { + text: qsTr("Clone this session") + onEntered: { + panel.hovered = true + } + onExited: { + panel.hovered = false + } + onClicked: { + panel.opacity = 0; + model.cloneSession(panel.currentSession); + } + } + } + Row { + x: -2 + spacing: 2 + id: clear + + Item { + //place holder for an icon + width: 16 + height: 16 + + + MouseArea { + id: clearMouseArea + anchors.fill: parent + hoverEnabled: true + onEntered: { + panel.hovered = true + } + onExited: { + panel.hovered = false + } + onClicked: { + //Will be uncommented once we have an icon + //model.deleteSession(panel.currentSession); + } + } + } + LinkedText { + text: qsTr("Delete this session") + onEntered: { + panel.hovered = true + } + onExited: { + panel.hovered = false + } + onClicked: { + panel.opacity = 0; + model.deleteSession(panel.currentSession); + } + } + } + Row { + x: -2 + spacing: 2 + id: rename + + Item { + //place holder for an icon + opacity: clearMouseArea.containsMouse ? 0.8 : 1 + Behavior on opacity { + PropertyAnimation { duration: visible ? 0 : 50; } + } + + width: 16 + height: 16 + + MouseArea { + id: renameMouseArea + anchors.fill: parent + hoverEnabled: true + onEntered: { + panel.hovered = true + } + onExited: { + panel.hovered = false + } + onClicked: { + //Will be uncommented once we have an icon + //model.renameSession(panel.currentSession); + } + } + } + LinkedText { + text: qsTr("Rename this session") + onEntered: { + panel.hovered = true + } + onExited: { + panel.hovered = false + } + onClicked: { + panel.opacity = 0; + model.renameSession(panel.currentSession); + } + } + } + } + + Behavior on opacity { + PropertyAnimation { duration: visible ? 50 : 100; } + } + radius: 2 + gradient: Gradient { + GradientStop { + position: 0.00; + color: "#ffffff"; + } + GradientStop { + position: 1.00; + color: "#e4e5f0"; + } + } + } +} -- cgit v1.2.3