Merge lp:~verzegnassi-stefano/ubuntu-terminal-app/add-thumbnails-tabspage into lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot

Proposed by Stefano Verzegnassi
Status: Merged
Merge reported by: Filippo Scognamiglio
Merged at revision: not available
Proposed branch: lp:~verzegnassi-stefano/ubuntu-terminal-app/add-thumbnails-tabspage
Merge into: lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
Diff against target: 38 lines (+21/-4)
1 file modified
src/app/qml/TabsPage.qml (+21/-4)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-terminal-app/add-thumbnails-tabspage
Reviewer Review Type Date Requested Status
Filippo Scognamiglio Approve
Review via email: mp+243215@code.launchpad.net

Commit message

Added thumbnails in Tabs page

Description of the change

Added thumbnails in Tabs page

Since the terminal widget is a QQuickItem, we can grab a thumbnail just using a shader. The pointer to QQuickItem is provided by TabsModel.

Just a note: this has been tested on desktop and on a Nexus 5. Please check if sizing is correct on Nexus 4 (and/or other devices w/ same resolution).

To post a comment you must log in.
Revision history for this message
Filippo Scognamiglio (flscogna) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/TabsPage.qml'
2--- src/app/qml/TabsPage.qml 2014-11-22 14:30:52 +0000
3+++ src/app/qml/TabsPage.qml 2014-11-29 16:27:33 +0000
4@@ -29,13 +29,30 @@
5
6 delegate: ListItemWithActions{
7 width: parent.width
8+ height: units.gu(25)
9
10 onItemClicked: { tabsModel.selectTab(index); }
11
12- contents: Label {
13- text: tabsModel.get(index).terminal.session.title
14- anchors.left: parent.left
15- anchors.verticalCenter: parent.verticalCenter
16+ contents: Row {
17+ anchors.fill: parent
18+ spacing: units.gu(4)
19+
20+ ShaderEffectSource {
21+ id: thumb
22+
23+ width: height * (model.terminal.width / model.terminal.height)
24+ height: parent.height
25+
26+ sourceItem: model.terminal
27+ }
28+
29+ Label {
30+ width: parent.width - (thumb.width + units.gu(6))
31+
32+ text: tabsModel.get(index).terminal.session.title
33+ anchors.verticalCenter: parent.verticalCenter
34+ wrapMode: Text.Wrap
35+ }
36 }
37
38 Rectangle {

Subscribers

People subscribed via source and target branches