Browse Source

styling

master
Amélia Liao 2 years ago
parent
commit
a9d67af25b
2 changed files with 35 additions and 5 deletions
  1. +32
    -3
      src/main.qml
  2. +3
    -2
      src/widgets/Reaction.qml

+ 32
- 3
src/main.qml View File

@ -1,6 +1,7 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Window 2.15 import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Qt.labs.folderlistmodel 2.15 import Qt.labs.folderlistmodel 2.15
@ -16,6 +17,12 @@ Window {
flags: Qt.Dialog flags: Qt.Dialog
id: window; id: window;
property string background: "#282C34";
property string emphasis: "#50536b";
property string foreground: "#abb2bf";
property string text: "#dfdfdf";
property string textAlt: "#b2b2b2";
Component { Component {
id: delegate id: delegate
@ -26,7 +33,8 @@ Window {
Column { Column {
anchors.fill: parent anchors.fill: parent
topPadding: 5
Reaction { Reaction {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -39,11 +47,17 @@ Window {
id: label id: label
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: fileName text: fileName
color: window.foreground
} }
} }
} }
} }
Rectangle {
anchors.fill: parent
color: window.background
}
Column { Column {
anchors.fill: parent anchors.fill: parent
@ -55,6 +69,20 @@ Window {
height: 40 height: 40
width: parent.width width: parent.width
style: TextFieldStyle {
textColor: window.text
placeholderTextColor: window.textAlt
background: Rectangle {
radius: 2
implicitWidth: 100
implicitHeight: 24
border.color: "#333"
border.width: 1
color: window.background
}
}
onTextChanged: () => { onTextChanged: () => {
backingModel.nameFilters = makeFilter(text.text) backingModel.nameFilters = makeFilter(text.text)
imageList.currentIndex = 0 imageList.currentIndex = 0
@ -91,6 +119,7 @@ Window {
Rectangle { Rectangle {
width: 2 * (parent.width / 3) width: 2 * (parent.width / 3)
height: parent.height height: parent.height
color: window.background
GridView { GridView {
id: imageList id: imageList
@ -115,7 +144,7 @@ Window {
delegate: delegate delegate: delegate
highlight: Rectangle { highlight: Rectangle {
color: "lightsteelblue"
color: window.emphasis
radius: 5 radius: 5
} }
} }


+ 3
- 2
src/widgets/Reaction.qml View File

@ -25,8 +25,9 @@ Item {
Drag.dragType: Drag.Automatic Drag.dragType: Drag.Automatic
Drag.onDragFinished: {
Qt.quit()
Drag.onDragFinished: (x) => {
if (x === 1)
Qt.quit()
} }
onStatusChanged: { onStatusChanged: {


Loading…
Cancel
Save