Commit ebe544f3 authored by Paweł Wegner's avatar Paweł Wegner

cloudbrowser: elide long names.

parent 2b6d2570
...@@ -333,11 +333,11 @@ Kirigami.ScrollablePage { ...@@ -333,11 +333,11 @@ Kirigami.ScrollablePage {
anchors.left: parent.left anchors.left: parent.left
anchors.right: icon.left anchors.right: icon.left
height: parent.height height: parent.height
clip: true
Templates.Label { Templates.Label {
anchors.fill: parent anchors.fill: parent
anchors.margins: 10 anchors.margins: 10
text: modelData.filename text: modelData.filename
elide: Text.ElideRight
} }
} }
Kirigami.Icon { Kirigami.Icon {
...@@ -423,9 +423,11 @@ Kirigami.ScrollablePage { ...@@ -423,9 +423,11 @@ Kirigami.ScrollablePage {
} }
Templates.Label { Templates.Label {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: parent.width - image.width
text: modelData.filename text: modelData.filename
color: Kirigami.Theme.textColor color: Kirigami.Theme.textColor
visible: list_view.currentEdit !== index visible: list_view.currentEdit !== index
elide: Text.ElideRight
} }
RowLayout { RowLayout {
visible: list_view.currentEdit === index visible: list_view.currentEdit === index
......
...@@ -97,6 +97,13 @@ Kirigami.ApplicationWindow { ...@@ -97,6 +97,13 @@ Kirigami.ApplicationWindow {
} }
} }
function elided(str, length) {
if (str.length <= length)
return str;
else
return str.substr(0, length) + "...";
}
function actions() { function actions() {
var ret = [settings.createObject(root.globalDrawer)], i; var ret = [settings.createObject(root.globalDrawer)], i;
if (cloud.isFree) { if (cloud.isFree) {
...@@ -168,7 +175,7 @@ Kirigami.ApplicationWindow { ...@@ -168,7 +175,7 @@ Kirigami.ApplicationWindow {
Kirigami.Action { Kirigami.Action {
property variant provider property variant provider
text: "<b>" + cloud.pretty(provider.type) + "</b>" + "<br/><div>" + text: "<b>" + cloud.pretty(provider.type) + "</b>" + "<br/><div>" +
provider.label + "</div>" elided(provider.label, 30) + "</div>"
onTriggered: { onTriggered: {
pageStack.clear(); pageStack.clear();
cloud.currently_moved = null; cloud.currently_moved = null;
...@@ -190,7 +197,7 @@ Kirigami.ApplicationWindow { ...@@ -190,7 +197,7 @@ Kirigami.ApplicationWindow {
height: parent.height - footer_height height: parent.height - footer_height
handle.anchors.bottomMargin: footer_height handle.anchors.bottomMargin: footer_height
title: selected_item ? title: selected_item ?
selected_item.filename : elided(selected_item.filename, 20) :
"Actions" "Actions"
} }
pageStack.initialPage: mainPageComponent pageStack.initialPage: mainPageComponent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment