← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~verzegnassi-stefano/ubuntu-terminal-app/uitk13-deprecation into lp:ubuntu-terminal-app

 

Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-terminal-app/uitk13-deprecation into lp:ubuntu-terminal-app.

Commit message:
* Use UITK PageHeader, instead of the now deprecated "Page.head" property
* Use ScrollView where appropriate
* Use UITK Label, instead of the QtQuick Text component
* Minor text margins fix in TabsPage

Requested reviews:
  Ubuntu Terminal Developers (ubuntu-terminal-dev)

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-terminal-app/uitk13-deprecation/+merge/287990

* Use UITK PageHeader, instead of the now deprecated "Page.head" property
* Use ScrollView where appropriate
* Use UITK Label, instead of the QtQuick Text component
* Minor text margins fix in TabsPage
-- 
Your team Ubuntu Terminal Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-terminal-app/uitk13-deprecation into lp:ubuntu-terminal-app.
=== modified file 'src/app/qml/CircularTransparentButton.qml'
--- src/app/qml/CircularTransparentButton.qml	2016-01-09 01:47:56 +0000
+++ src/app/qml/CircularTransparentButton.qml	2016-03-15 14:39:40 +0000
@@ -22,7 +22,7 @@
         active: action.text
         z: parent.z + 0.1
         anchors.centerIn: parent
-        sourceComponent: Text {
+        sourceComponent: Label {
             opacity: innerOpacity
             text: action.text
             color: textColor

=== modified file 'src/app/qml/ColorSchemePage.qml'
--- src/app/qml/ColorSchemePage.qml	2016-02-07 18:30:11 +0000
+++ src/app/qml/ColorSchemePage.qml	2016-03-15 14:39:40 +0000
@@ -23,38 +23,44 @@
     id: rootItem
     objectName: "colorSchemePage"
 
-    title: i18n.tr("Color Scheme")
+    header: PageHeader {
+        title: i18n.tr("Color Scheme")
+        flickable: listView
+    }
 
     property alias model: listView.model
     property var namesModel
 
     readonly property string currentName: namesModel[listView.currentIndex]
 
-    ListView {
-        id: listView
+    ScrollView {
         anchors.fill: parent
-        model: settings.profilesList
-        currentIndex: model.indexOf(settings.colorScheme)
-        delegate: ListItem {
-            ListItemLayout {
-                anchors.verticalCenter: parent.verticalCenter
-                title.text: namesModel[model.index]
-
-                Icon {
-                    SlotsLayout.position: SlotsLayout.Last
-                    width: units.gu(2); height: units.gu(2)
-                    color: UbuntuColors.green
-                    name: "tick"
-
-                    visible: model.index === listView.currentIndex
+        ListView {
+            id: listView
+            anchors.fill: parent
+            model: settings.profilesList
+            currentIndex: model.indexOf(settings.colorScheme)
+            delegate: ListItem {
+                ListItemLayout {
+                    anchors.verticalCenter: parent.verticalCenter
+                    title.text: namesModel[model.index]
+
+                    Icon {
+                        SlotsLayout.position: SlotsLayout.Last
+                        width: units.gu(2); height: units.gu(2)
+                        color: UbuntuColors.green
+                        name: "tick"
+
+                        visible: model.index === listView.currentIndex
+                    }
                 }
-            }
-
-            onClicked: listView.currentIndex = model.index
-        }
-
-        onCurrentIndexChanged: {
-            settings.colorScheme = model[currentIndex];
+
+                onClicked: listView.currentIndex = model.index
+            }
+
+            onCurrentIndexChanged: {
+                settings.colorScheme = model[currentIndex];
+            }
         }
     }
 }

=== modified file 'src/app/qml/ExpandableButton.qml'
--- src/app/qml/ExpandableButton.qml	2016-01-09 01:47:56 +0000
+++ src/app/qml/ExpandableButton.qml	2016-03-15 14:39:40 +0000
@@ -61,7 +61,7 @@
                 z: parent.z + 0.01
                 anchors.centerIn: parent
                 active: actions[index].text
-                sourceComponent: Text {
+                sourceComponent: Label {
                     color: textColor
                     text: actions[index].text
                 }

=== modified file 'src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml'
--- src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml	2016-01-09 01:47:56 +0000
+++ src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml	2016-03-15 14:39:40 +0000
@@ -18,7 +18,7 @@
         z: parent.z + 1
     }
 
-    Text {
+    Label {
         id: mainLabel
         anchors.centerIn: parent
         z: parent.z + 0.02

=== modified file 'src/app/qml/KeyboardRows/KeyboardButton.qml'
--- src/app/qml/KeyboardRows/KeyboardButton.qml	2016-01-09 01:47:56 +0000
+++ src/app/qml/KeyboardRows/KeyboardButton.qml	2016-03-15 14:39:40 +0000
@@ -7,7 +7,7 @@
 
     color: "black"
 
-    Text {
+    Label {
         id: mainLabel
         anchors.centerIn: parent
         color: "white"

=== modified file 'src/app/qml/LayoutsPage.qml'
--- src/app/qml/LayoutsPage.qml	2016-01-09 02:00:10 +0000
+++ src/app/qml/LayoutsPage.qml	2016-03-15 14:39:40 +0000
@@ -23,33 +23,40 @@
     id: rootItem
     objectName: "layoutsPage"
 
-    title: i18n.tr("Layouts")
+    header: PageHeader {
+        title: i18n.tr("Layouts")
+        flickable: listView
+    }
 
     onVisibleChanged: {
         if (visible === false)
             settings.profilesChanged();
     }
 
-    ListView {
+    ScrollView {
         anchors.fill: parent
-        model: settings.profilesList
-        delegate: ListItem {
-            ListItemLayout {
-                anchors.fill: parent
-                title.text: name
-
-                Switch {
-                    id: layoutSwitch
-                    SlotsLayout.position: SlotsLayout.Trailing
-
-                    checked: profileVisible
-                    onCheckedChanged: {
-                        settings.profilesList.setProperty(index, "profileVisible", checked);
+        ListView {
+            id: listView
+            anchors.fill: parent
+            model: settings.profilesList
+            delegate: ListItem {
+                ListItemLayout {
+                    anchors.fill: parent
+                    title.text: name
+
+                    Switch {
+                        id: layoutSwitch
+                        SlotsLayout.position: SlotsLayout.Trailing
+
+                        checked: profileVisible
+                        onCheckedChanged: {
+                            settings.profilesList.setProperty(index, "profileVisible", checked);
+                        }
                     }
                 }
+
+                onClicked: layoutSwitch.trigger()
             }
-
-            onClicked: layoutSwitch.trigger()
         }
     }
 }

=== modified file 'src/app/qml/SettingsPage.qml'
--- src/app/qml/SettingsPage.qml	2016-02-07 18:30:11 +0000
+++ src/app/qml/SettingsPage.qml	2016-03-15 14:39:40 +0000
@@ -23,17 +23,20 @@
     id: settingsPage
     objectName: "settingsPage"
 
-    title: i18n.tr("Settings")
-    flickable: null
+    header: PageHeader {
+        title: i18n.tr("Settings")
+        flickable: scrollView.flickableItem
+    }
 
-    Flickable {
+    ScrollView {
+        id: scrollView
         anchors.fill: parent
-        interactive: contentHeight + units.gu(6) > height
-        contentHeight: mainColumn.height
 
         Column {
-            id: mainColumn
-            anchors { left: parent.left; right: parent.right }
+            // Column is not a child of ScrollView, but it's reparented to
+            // ScrollView.viewport. For that reason we can not use 'anchors'
+            // but we have to set the width instead.
+            width: scrollView.width
 
             ListItem {
                 ListItemLayout {

=== modified file 'src/app/qml/TabsPage.qml'
--- src/app/qml/TabsPage.qml	2016-01-09 02:00:10 +0000
+++ src/app/qml/TabsPage.qml	2016-03-15 14:39:40 +0000
@@ -4,10 +4,12 @@
 Page {
     id: tabsPage
     objectName: "tabsPage"
-    title: i18n.tr("Tabs")
-
-    head.actions: [
-        Action {
+
+    header: PageHeader {
+        title: i18n.tr("Tabs")
+        flickable: tabsGrid
+
+        trailingActionBar.actions: Action {
             objectName: "newTabAcion"
             iconName: "add"
             text: i18n.tr("New tab")
@@ -15,12 +17,10 @@
                 tabsModel.addTab();
             }
         }
-    ]
+    }
 
-    Item {
+    ScrollView {
         anchors.fill: parent
-        clip: true
-
         GridView {
             id: tabsGrid
             anchors.fill: parent
@@ -29,9 +29,9 @@
             cellWidth: (parent.width - units.gu(2)) * 0.5
             cellHeight: cellWidth * (terminalPage.terminalContainer.height / terminalPage.terminalContainer.width)
 
-//            add: Transition {
-//                NumberAnimation { properties: "x,y"; duration: 200 }
-//            }
+            //      add: Transition {
+            //          NumberAnimation { properties: "x,y"; duration: 200 }
+            //      }
 
             removeDisplaced: Transition {
                 NumberAnimation { properties: "x,y"; duration: 200 }
@@ -83,8 +83,8 @@
                         opacity: 0.5
                     }
 
-                    Text {
-                        anchors.fill: blackRect
+                    Label {
+                        anchors { fill: blackRect; margins: units.dp(2) }
                         text: tabsModel.get(index).terminal.session.title
                         wrapMode: Text.Wrap
                         color: "white"
@@ -110,69 +110,5 @@
                 }
             }
         }
-
-//        ListView {
-//            id: tabView
-//            anchors.fill: parent
-//            model: tabsModel
-
-//            delegate: ListItemWithActions{
-//                width: parent.width
-//                height: units.gu(25)
-
-//                onItemClicked: {
-//                    // If the currently active tab is pressed. Return to it.
-//                    if (tabsModel.selectedIndex == index) {
-//                        pageStack.pop();
-//                    } else {
-//                        tabsModel.selectTab(index);
-//                    }
-//                }
-
-//                contents: Row {
-//                    anchors.fill: parent
-//                    spacing: units.gu(4)
-
-//                    ShaderEffectSource {
-//                        id: thumb
-
-//                        width: height * (model.terminal.width / model.terminal.height)
-//                        height: parent.height
-
-//                        sourceItem: model.terminal
-//                    }
-
-//                    Label {
-//                        width: parent.width - (thumb.width + units.gu(6))
-
-//                        text: tabsModel.get(index).terminal.session.title
-//                        anchors.verticalCenter: parent.verticalCenter
-//                        wrapMode: Text.Wrap
-//                    }
-//                }
-
-//                Rectangle {
-//                    id: selectedTab
-//                    anchors.fill: parent
-//                    color: Theme.palette.selected.background
-//                    opacity: tabsModel.selectedIndex == index ? 1.0 : 0.0
-
-//                    Behavior on opacity {
-//                        NumberAnimation { duration: 200 }
-//                    }
-//                }
-
-//                leftSideAction: Action {
-//                    iconName: "delete"
-//                    text: i18n.tr("Delete")
-//                    enabled: tabsModel.count !== 1
-//                    onTriggered:  {
-//                        //Workaround since enabled is ignored
-//                        if (enabled)
-//                            tabsModel.removeTab(index);
-//                    }
-//                }
-//            }
-//        }
     }
 }

=== modified file 'src/app/qml/TerminalPage.qml'
--- src/app/qml/TerminalPage.qml	2016-03-03 23:14:40 +0000
+++ src/app/qml/TerminalPage.qml	2016-03-15 14:39:40 +0000
@@ -173,7 +173,7 @@
             color: "black"
             opacity: 0.7
 
-            Text {
+            Label {
                 anchors.centerIn: parent
                 color: "white"
                 text: i18n.tr("Selection Mode")


Follow ups