Skip to content

Commit

Permalink
tablet: Slightly improve desktop view
Browse files Browse the repository at this point in the history
Style labels and remove paging because we are not quite ready yet.

Issue: #155
  • Loading branch information
plfiorini committed Apr 12, 2014
1 parent d078dbb commit 77b77e2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
53 changes: 26 additions & 27 deletions src/packages/shells/tablet/contents/views/DesktopView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,45 +42,44 @@ Item {
}

readonly property int itemSize: 192
readonly property int numRows: 5
readonly property int numColumns: 3

ColumnLayout {
anchors.fill: parent
anchors.topMargin: 10
anchors.bottomMargin: 10

TextField {
placeholderText: qsTr("Search")

Layout.minimumWidth: 250
Layout.alignment: Qt.AlignHCenter
}

GridView {
id: grid
cacheBuffer: 100
cellWidth: itemSize
cellHeight: itemSize
width: itemSize * numRows
height: itemSize * numColumns
clip: true
snapMode: GridView.SnapOneRow
flow: GridView.TopToBottom
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightRangeMode: GridView.StrictlyEnforceRange
highlightFollowsCurrentItem: true
model: VisualDataModel {
id: visualModel
model: ApplicationsModel {
id: appsModel
}
delegate: IconDelegate {
icon: "image://appicon/" + iconName
label: name
onClicked: {
// Launch the application
appsModel.launch(VisualDataModel.itemsIndex);
ScrollView {
GridView {
id: grid
cacheBuffer: 100
cellWidth: itemSize
cellHeight: itemSize
interactive: true
model: VisualDataModel {
id: visualModel
model: ApplicationsModel {
id: appsModel
}
delegate: IconDelegate {
icon: "image://appicon/" + iconName
label: name
onClicked: {
// Launch the application
appsModel.launch(VisualDataModel.itemsIndex);
}
}
}
}

Layout.fillWidth: true
Layout.fillHeight: true
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/packages/shells/tablet/contents/views/IconDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ MouseArea {
id: labelItem
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignTop
color: "white"
wrapMode: Text.Wrap
elide: Text.ElideRight
style: Text.Raised
styleColor: "#80000000"

Layout.fillWidth: true
Layout.fillHeight: true
Expand Down

0 comments on commit 77b77e2

Please sign in to comment.