Skip to content

Commit 69c6e87

Browse files
committed
Redesign PathView
1 parent 0b02b60 commit 69c6e87

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

src/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ int main(int argc, char* argv[])
2929
qmlRegisterSingletonInstance("Settings", 1, 0, "Settings", Settings::get());
3030

3131
engine.load(QUrl(QLatin1String("qrc:/Backend/src/qml/main.qml")));
32-
if (engine.rootObjects().isEmpty())
33-
return -1;
32+
if (engine.rootObjects().isEmpty()) {
33+
return EXIT_FAILURE;
34+
}
35+
3436
return QGuiApplication::exec();
3537
}

src/qml/PathView.qml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ ListView {
88
id: pathView
99
model: PathModel
1010
visible: count
11-
spacing: 2
12-
header: Rectangle {
11+
spacing: 6
12+
header: Button {
1313
width: parent.width
14-
height: pathView.count ? 32 : 0
14+
height: pathView.count ? 40 : 0
1515
Behavior on height { NumberAnimation { duration: 300; easing.type: Easing.InOutSine }}
1616
visible: pathView.count
17-
color: Material.accent
17+
highlighted: true
1818
Text {
1919
anchors.centerIn: parent
2020
text: "Drag all " + pathView.count + " items"
@@ -34,11 +34,10 @@ ListView {
3434
delegate: Item {
3535
height: 64
3636
width: ListView.view.width
37-
Rectangle {
38-
id: rectangle
37+
Pane {
38+
id: pane
3939
anchors.fill: parent
40-
color: !exists ? Material.color(Material.Red) : used ? Material.primary : Material.color(Material.Grey)
41-
Behavior on color { ColorAnimation { duration: 200; easing.type: Easing.InOutSine }}
40+
Material.elevation: 6
4241
Text {
4342
anchors.centerIn: parent
4443
text: path
@@ -47,11 +46,17 @@ ListView {
4746
ToolTip.delay: 1500
4847
ToolTip.timeout: 2000
4948
}
49+
Rectangle {
50+
anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
51+
width: 8
52+
color: !exists ? Material.color(Material.Red) : used ? Material.primary : Material.color(Material.Grey)
53+
Behavior on color { ColorAnimation { duration: 200; easing.type: Easing.InOutSine }}
54+
}
5055
}
5156
DragArea {
5257
id: dragArea
5358
anchors.fill: parent
54-
target: rectangle
59+
target: pane
5560
dragUri: uri
5661
hoverEnabled: true
5762
onDragFinished: (dropAction) => {

src/qml/main.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ApplicationWindow {
1111
flags: Qt.Window | (Settings.alwaysOnTop ? Qt.WindowStaysOnTopHint : 0)
1212
title: Stdin.closed ? "blobdrop" : "Reading from stdin..."
1313
width: 485
14-
height: 300
14+
height: 400
1515
Material.theme: Material.System
1616
Material.primary: Material.Green
1717
Material.accent: Material.Pink
@@ -33,5 +33,7 @@ ApplicationWindow {
3333
PathView {
3434
id: pathView
3535
anchors.fill: parent
36+
anchors.leftMargin: 4
37+
anchors.rightMargin: 4
3638
}
3739
}

0 commit comments

Comments
 (0)