Skip to content

Commit

Permalink
optimize ui
Browse files Browse the repository at this point in the history
  • Loading branch information
leovan committed Aug 18, 2023
1 parent 33b89c0 commit 33e42eb
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 12 deletions.
8 changes: 5 additions & 3 deletions ui/About.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import QtQuick.Controls.Material
Dialog {
id: dialog

property int margin: 10

x: (parent.width - width) / 2
y: (parent.height - height) / 2

Expand All @@ -18,9 +20,9 @@ Dialog {
anchors.fill: parent

RowLayout {
Layout.fillWidth: true
spacing: margin

spacing: 8
Layout.fillWidth: true

Image {
Layout.alignment: Qt.AlignTop
Expand All @@ -32,7 +34,7 @@ Dialog {

Label {
text: "<style>a { color: " + Material.accent + "; }</style>" +
"<p><b>Sci-Hub EVA</a> " + APPLICATION_VERSION + "</b></p>" +
"<p style=\"font-size: 16px;\"><b>Sci-Hub EVA</a> " + APPLICATION_VERSION + "</b></p>" +
"<p>" + "<a href=\"https://github.com/leovan/SciHubEVA\">Sci-Hub EVA</a> " +
qsTr("is a cross-platform Sci-Hub GUI Application.") + "<br/>" +
"Powered By Python " + PYTHON_VERSION + " & Qt " + QT_VERSION + "</p>" +
Expand Down
2 changes: 1 addition & 1 deletion ui/AddSciHubURL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Window

ApplicationWindow {
Window {
title: qsTr("Add Sci-Hub URL")

modality: Qt.ApplicationModal
Expand Down
2 changes: 1 addition & 1 deletion ui/Captcha.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Window

ApplicationWindow {
Window {
title: qsTr("Captcha")

modality: Qt.ApplicationModal
Expand Down
7 changes: 5 additions & 2 deletions ui/Preferences.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import QtQuick.Window
import "." as UI
import "./elements" as UIElements

ApplicationWindow {
Window {
id: applicationWindowPreferences
title: qsTr("Preferences")

Expand Down Expand Up @@ -273,7 +273,7 @@ ApplicationWindow {
Layout.fillWidth: true

Layout.minimumWidth: 480
Layout.minimumHeight: 360
Layout.minimumHeight: 400

Item {
id: itemPreferencesSystem
Expand All @@ -284,6 +284,7 @@ ApplicationWindow {
anchors.fill: parent

ColumnLayout {
spacing: margin
width: Math.max(implicitWidth, scrollViewPreferencesSystem.width)

RowLayout {
Expand Down Expand Up @@ -373,6 +374,7 @@ ApplicationWindow {
anchors.fill: parent

ColumnLayout {
spacing: margin
width: Math.max(implicitWidth, scrollViewPreferencesFile.width)

RowLayout {
Expand Down Expand Up @@ -446,6 +448,7 @@ ApplicationWindow {
anchors.fill: parent

ColumnLayout {
spacing: margin
width: Math.max(implicitWidth, scrollViewPreferencesNetwork.width)

RowLayout {
Expand Down
8 changes: 6 additions & 2 deletions ui/SciHubEVA.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ApplicationWindow {

visible: true

property int margin: 8
property int margin: 10
property int theme: Material.theme

width: columnLayoutApplication.implicitWidth + 2 * margin
Expand Down Expand Up @@ -151,7 +151,7 @@ ApplicationWindow {

TextField {
id: textFieldQuery
placeholderText: qsTr("URL, PMID, DOI, Search String or Query List File")
placeholderText: qsTr("URL, PMID, DOI, Title or Query List File")

implicitWidth: 300
Layout.minimumWidth: 300
Expand All @@ -166,6 +166,7 @@ ApplicationWindow {

font.bold: false
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: buttonAbout.implicitHeight
Layout.fillWidth: true

onClicked: {
Expand All @@ -189,6 +190,7 @@ ApplicationWindow {

font.bold: false
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: buttonAbout.implicitHeight
Layout.fillWidth: true

onClicked: fileDialogQueryList.open()
Expand Down Expand Up @@ -224,6 +226,7 @@ ApplicationWindow {

font.bold: false
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: buttonPreferences.implicitHeight
Layout.fillWidth: true

onClicked: folderDialogSaveTo.open()
Expand All @@ -235,6 +238,7 @@ ApplicationWindow {

font.bold: false
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: buttonPreferences.implicitHeight
Layout.fillWidth: true

onClicked: systemOpenSaveToDir(textFieldSaveToDir.text.trim())
Expand Down
1 change: 1 addition & 0 deletions ui/elements/IconButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Button {
id: button

property string iconSource

readonly property real iconSize: 20
readonly property bool hasIcon: iconSource.toString().length > 0
readonly property bool hasText: button.text.toString().length > 0
Expand Down
5 changes: 3 additions & 2 deletions ui/elements/ItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import QtQml.Models
ItemDelegate {
id: control

readonly property int margin: 10
readonly property real iconSize: 20

highlighted: ListView.isCurrentItem
Expand All @@ -26,7 +27,7 @@ ItemDelegate {
sourceSize.height: iconSize
sourceSize.width: iconSize

Layout.leftMargin: 8
Layout.leftMargin: margin
}

Label {
Expand All @@ -35,7 +36,7 @@ ItemDelegate {
text: name
font.weight: Font.Medium

Layout.rightMargin: 8
Layout.rightMargin: margin
Layout.fillWidth: true
}
}
Expand Down
4 changes: 3 additions & 1 deletion ui/elements/Message.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import QtQuick.Window
Dialog {
id: dialog

property int margin: 10

x: (parent.width - width) / 2
y: (parent.height - height) / 2

Expand All @@ -28,7 +30,7 @@ Dialog {
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft

spacing: 10
spacing: margin

Image {
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Expand Down

0 comments on commit 33e42eb

Please sign in to comment.