Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
libcloudstorage
Commits
0af26d44
Commit
0af26d44
authored
Feb 09, 2018
by
Paweł Wegner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cloudbrowser: reworked file info view.
parent
564b665d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
59 deletions
+45
-59
bin/cloudbrowser/qml/ItemPage.qml
bin/cloudbrowser/qml/ItemPage.qml
+45
-59
No files found.
bin/cloudbrowser/qml/ItemPage.qml
View file @
0af26d44
...
@@ -135,6 +135,17 @@ Kirigami.ScrollablePage {
...
@@ -135,6 +135,17 @@ Kirigami.ScrollablePage {
}
}
]
]
function
show_size
(
size
)
{
if
(
size
<
1024
)
return
size
+
"
B
"
;
else
if
(
size
<
1024
*
1024
)
return
(
size
/
1024
).
toFixed
(
2
)
+
"
KB
"
;
else
if
(
size
<
1024
*
1024
*
1024
)
return
(
size
/
(
1024
*
1024
)).
toFixed
(
2
)
+
"
MB
"
;
else
return
(
size
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)
+
"
GB
"
;
}
Kirigami.OverlaySheet
{
Kirigami.OverlaySheet
{
id
:
file_info_sheet
id
:
file_info_sheet
Item
{
Item
{
...
@@ -149,62 +160,39 @@ Kirigami.ScrollablePage {
...
@@ -149,62 +160,39 @@ Kirigami.ScrollablePage {
elide
:
Text
.
ElideRight
elide
:
Text
.
ElideRight
wrapMode
:
Text
.
Wrap
wrapMode
:
Text
.
Wrap
}
}
Column
{
ListView
{
id
:
file_list
anchors.top
:
file_name
.
bottom
anchors.top
:
file_name
.
bottom
width
:
parent
.
implicitWidth
*
0.8
anchors.horizontalCenter
:
parent
.
horizontalCenter
Rectangle
{
width
:
parent
.
width
height
:
childrenRect
.
height
border.width
:
1
anchors.leftMargin
:
10
Column
{
width
:
parent
.
width
Item
{
visible
:
root
.
selected_item
?
root
.
selected_item
.
size
!==
-
1
:
""
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.margins
:
10
height
:
childrenRect
.
height
height
:
50
boundsBehavior
:
Flickable
.
StopAtBounds
Text
{
model
:
[
anchors.verticalCenter
:
parent
.
verticalCenter
{
anchors.left
:
parent
.
left
"
name
"
:
"
size
"
,
font.pointSize
:
12
"
value
"
:
root
.
selected_item
&&
root
.
selected_item
.
size
!==
-
1
?
text
:
"
size
"
show_size
(
root
.
selected_item
.
size
)
:
""
}
},
Text
{
{
function
show_size
(
size
)
{
"
name
"
:
"
last modified
"
,
if
(
size
<
1024
)
"
value
"
:
root
.
selected_item
&&
root
.
selected_item
.
timestamp
!==
-
1
?
return
size
+
"
B
"
;
root
.
selected_item
.
timestamp
:
""
else
if
(
size
<
1024
*
1024
)
return
(
size
/
1024
).
toFixed
(
2
)
+
"
KB
"
;
else
if
(
size
<
1024
*
1024
*
1024
)
return
(
size
/
(
1024
*
1024
)).
toFixed
(
2
)
+
"
MB
"
;
else
return
(
size
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)
+
"
GB
"
;
}
font.pointSize
:
16
text
:
root
.
selected_item
?
show_size
(
root
.
selected_item
.
size
)
:
""
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.right
:
parent
.
right
}
}
}
Item
{
]
visible
:
root
.
selected_item
?
root
.
selected_item
.
timestamp
!==
""
:
false
delegate
:
Kirigami.BasicListItem
{
anchors.left
:
parent
.
left
icon
:
""
anchors.right
:
parent
.
right
visible
:
modelData
.
value
!==
""
anchors.margins
:
10
anchors.margins
:
10
height
:
5
0
height
:
visible
?
50
:
0
Text
{
Text
{
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
font.pointSize
:
12
font.pointSize
:
12
text
:
"
last modified
"
text
:
modelData
.
name
}
}
Text
{
Text
{
font.pointSize
:
16
font.pointSize
:
16
text
:
root
.
selected_item
?
root
.
selected_item
.
timestamp
:
""
text
:
modelData
.
value
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
}
}
...
@@ -212,8 +200,6 @@ Kirigami.ScrollablePage {
...
@@ -212,8 +200,6 @@ Kirigami.ScrollablePage {
}
}
}
}
}
}
}
}
Kirigami.OverlaySheet
{
Kirigami.OverlaySheet
{
id
:
create_directory_sheet
id
:
create_directory_sheet
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment