Design: Symmetrical adjustment

This commit is contained in:
reven 2021-04-15 10:26:54 +08:00
parent 229a174622
commit 11bf737d1d
2 changed files with 10 additions and 7 deletions

View file

@ -12,7 +12,7 @@ Item {
property alias currentUrl: dirModel.url property alias currentUrl: dirModel.url
property Item currentView: _viewLoader.item property Item currentView: _viewLoader.item
property int statusBarHeight: 30 property int statusBarHeight: 22
signal requestPathEditor() signal requestPathEditor()
@ -33,7 +33,7 @@ Item {
Label { Label {
id: _fileTips id: _fileTips
text: qsTr("Empty folder") text: qsTr("Empty folder")
font.pointSize: 20 font.pointSize: 15
anchors.centerIn: parent anchors.centerIn: parent
visible: false visible: false
} }
@ -117,19 +117,21 @@ Item {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing anchors.leftMargin: FishUI.Units.smallSpacing
anchors.rightMargin: FishUI.Units.largeSpacing anchors.rightMargin: FishUI.Units.largeSpacing
anchors.bottomMargin: 1 anchors.bottomMargin: 1
spacing: FishUI.Units.largeSpacing spacing: FishUI.Units.largeSpacing
Label { Label {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
text: dirModel.count == 1 ? qsTr("%1 item").arg(dirModel.count) font.pointSize: 10
: qsTr("%1 items").arg(dirModel.count) text: dirModel.count === 1 ? qsTr("%1 item").arg(dirModel.count)
: qsTr("%1 items").arg(dirModel.count)
} }
Label { Label {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
font.pointSize: 10
text: qsTr("%1 selected").arg(dirModel.selectionCound) text: qsTr("%1 selected").arg(dirModel.selectionCound)
visible: dirModel.selectionCound >= 1 visible: dirModel.selectionCound >= 1
} }
@ -142,6 +144,7 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: qsTr("Empty Trash") text: qsTr("Empty Trash")
font.pointSize: 10
onClicked: dirModel.emptyTrash() onClicked: dirModel.emptyTrash()
visible: dirModel.url === "trash:/" visible: dirModel.url === "trash:/"
focusPolicy: Qt.NoFocus focusPolicy: Qt.NoFocus
@ -158,7 +161,7 @@ Item {
model: dirModel model: dirModel
delegate: FolderGridItem {} delegate: FolderGridItem {}
leftMargin: FishUI.Units.largeSpacing leftMargin: FishUI.Units.smallSpacing
rightMargin: FishUI.Units.largeSpacing rightMargin: FishUI.Units.largeSpacing
topMargin: FishUI.Units.smallSpacing topMargin: FishUI.Units.smallSpacing
bottomMargin: FishUI.Units.smallSpacing bottomMargin: FishUI.Units.smallSpacing

View file

@ -39,7 +39,7 @@ ListView {
delegate: Item { delegate: Item {
id: _item id: _item
width: ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin width: ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin
height: 40 height: FishUI.Units.fontMetrics.height + FishUI.Units.largeSpacing * 1.5
property bool checked: sideBar.currentIndex === index property bool checked: sideBar.currentIndex === index
property color hoveredColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.1) property color hoveredColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.1)