Skip to content

Commit

Permalink
Optimize UI
Browse files Browse the repository at this point in the history
  • Loading branch information
coslyk committed Aug 10, 2023
1 parent 57f65f5 commit 4e9aad7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 41 deletions.
12 changes: 5 additions & 7 deletions src/qml/Explorer.qml
Expand Up @@ -14,11 +14,11 @@
* with this program. If not, see http://www.gnu.org/licenses/.
*/

import QtQuick 2.7
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Qt.labs.settings 1.0 as QSettings
import com.github.coslyk.moonplayer 1.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt.labs.settings as QSettings
import com.github.coslyk.moonplayer

Item {
id: explorer
Expand Down Expand Up @@ -64,7 +64,6 @@ Item {
Button {
id: searchButton
text: qsTr("Search")
implicitWidth: 60
onClicked: {
currentPlugin.keyword = keywordInput.text;
pageSpinBox.value = 1;
Expand Down Expand Up @@ -124,7 +123,6 @@ Item {
text: qsTr("Back")
enabled: resultArea.currentIndex === 1
onClicked: resultArea.currentIndex = 0
implicitWidth: 80
}

SpinBox {
Expand Down
62 changes: 30 additions & 32 deletions src/qml/Playlist.qml
@@ -1,56 +1,57 @@
/* Copyright 2013-2020 Yikun Liu <cos.lyk@gmail.com>
*
* This program is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see http://www.gnu.org/licenses/.
*/

import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.3
import com.github.coslyk.moonplayer 1.0
*
* This program is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see http://www.gnu.org/licenses/.
*/

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Material
import com.github.coslyk.moonplayer

Item {
id: playlist

signal openFileRequested()
signal openUrlRequested()

GridLayout {
anchors.fill: parent
columns: 3

Label {
text: qsTr("Playlist")
font.pointSize: 16
font.bold: true
Layout.columnSpan: 3
}

ScrollView {
Layout.columnSpan: 3
Layout.fillWidth: true
Layout.fillHeight: true

ListView {
id: listView

model: PlaylistModel
delegate: Rectangle {
width: 150
height: 20
radius: 4
clip: true
color: index == listView.currentIndex ? SkinColor.listItemSelected : (index == PlaylistModel.playingIndex ? SkinColor.listItemCurrentActive : "transparent")
color: index == listView.currentIndex ? SkinColor.listItemSelected: (index == PlaylistModel.playingIndex ? SkinColor.listItemCurrentActive : "transparent")
Label { text: title }
MouseArea {
anchors.fill: parent
Expand All @@ -60,33 +61,30 @@ Item {
}
}
}

Button {
id: addButton
text: qsTr("Add")
implicitWidth: 55
onClicked: {
addMenu.x = addButton.x
addMenu.y = addButton.y - addMenu.height
addMenu.open()
}
}

Button {
id: delButton
text: qsTr("Del")
implicitWidth: 55
onClicked: PlaylistModel.removeItem(listView.currentIndex)
}

Button {
id: clearButton
text: qsTr("Clear")
implicitWidth: 55
onClicked: PlaylistModel.clear()
}
}

Menu {
id: addMenu
width: 100
Expand Down
4 changes: 2 additions & 2 deletions src/qml/Sidebar.qml
Expand Up @@ -59,9 +59,9 @@ Control {

// Width
property var widths: [
200, // Playlist
250, // Playlist
320, // Settings
300, // Explorer
320, // Explorer
300, // Video options
320, // Subtitles and danmaku
300, // Downloader
Expand Down

0 comments on commit 4e9aad7

Please sign in to comment.