Fix spacing at the top of the Recent Scores page
This commit is contained in:
parent
a1fa637517
commit
81585b9884
4 changed files with 49 additions and 66 deletions
|
@ -20,8 +20,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import MuseScore.Ui 1.0
|
||||
import MuseScore.UiComponents 1.0
|
||||
|
@ -89,69 +89,61 @@ FocusScope {
|
|||
|
||||
StyledTextLabel {
|
||||
id: addonsLabel
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTrc("appshell", "Add-ons")
|
||||
font: ui.theme.titleBoldFont
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.preferredWidth: topLayout.width - addonsLabel.width - serchAndCategoryLayout.width - topLayout.spacing * 2
|
||||
Layout.fillHeight: true
|
||||
SearchField {
|
||||
id: searchField
|
||||
|
||||
Layout.preferredWidth: 220
|
||||
|
||||
navigation.name: "AddonsSearch"
|
||||
navigation.panel: navSearchPanel
|
||||
navigation.order: 1
|
||||
accessible.name: qsTrc("appshell", "Add-ons search")
|
||||
|
||||
onSearchTextChanged: {
|
||||
categoryComboBox.selectedCategory = ""
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
id: serchAndCategoryLayout
|
||||
Dropdown {
|
||||
id: categoryComboBox
|
||||
|
||||
spacing: 12
|
||||
width: searchField.width
|
||||
|
||||
SearchField {
|
||||
id: searchField
|
||||
navigation.name: "CategoryComboBox"
|
||||
navigation.panel: navSearchPanel
|
||||
navigation.order: 2
|
||||
|
||||
navigation.name: "AddonsSearch"
|
||||
navigation.panel: navSearchPanel
|
||||
navigation.order: 1
|
||||
accessible.name: qsTrc("appshell", "Add-ons search")
|
||||
visible: bar.canFilterByCategories
|
||||
|
||||
onSearchTextChanged: {
|
||||
categoryComboBox.selectedCategory = ""
|
||||
readonly property string allCategoryValue: "ALL_CATEGORY"
|
||||
property string selectedCategory: (currentValue !== allCategoryValue) ? currentValue : ""
|
||||
|
||||
displayText: qsTrc("appshell", "Category: ") + categoryComboBox.currentText
|
||||
currentIndex: indexOfValue(allCategoryValue)
|
||||
|
||||
function initModel() {
|
||||
var categories = bar.categories()
|
||||
var result = []
|
||||
|
||||
result.push({ "text": qsTrc("appshell", "All"), "value": allCategoryValue })
|
||||
|
||||
for (var i = 0; i < categories.length; ++i) {
|
||||
var category = categories[i]
|
||||
result.push({ "text": category, "value": category })
|
||||
}
|
||||
|
||||
model = result
|
||||
}
|
||||
|
||||
Dropdown {
|
||||
id: categoryComboBox
|
||||
|
||||
width: searchField.width
|
||||
|
||||
navigation.name: "CategoryComboBox"
|
||||
navigation.panel: navSearchPanel
|
||||
navigation.order: 2
|
||||
|
||||
visible: bar.canFilterByCategories
|
||||
|
||||
readonly property string allCategoryValue: "ALL_CATEGORY"
|
||||
property string selectedCategory: (currentValue !== allCategoryValue) ? currentValue : ""
|
||||
|
||||
displayText: qsTrc("appshell", "Category: ") + categoryComboBox.currentText
|
||||
currentIndex: indexOfValue(allCategoryValue)
|
||||
|
||||
function initModel() {
|
||||
var categories = bar.categories()
|
||||
var result = []
|
||||
|
||||
result.push({ "text": qsTrc("appshell", "All"), "value": allCategoryValue })
|
||||
|
||||
for (var i = 0; i < categories.length; ++i) {
|
||||
var category = categories[i]
|
||||
result.push({ "text": category, "value": category })
|
||||
}
|
||||
|
||||
model = result
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
initModel()
|
||||
}
|
||||
Component.onCompleted: {
|
||||
initModel()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +152,7 @@ FocusScope {
|
|||
id: bar
|
||||
|
||||
anchors.top: topLayout.bottom
|
||||
anchors.topMargin: 36
|
||||
anchors.topMargin: prv.sideMargin
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: prv.sideMargin - itemSideMargin
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ FocusScope {
|
|||
|
||||
RowLayout {
|
||||
id: topLayout
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: prv.sideMargin
|
||||
anchors.left: parent.left
|
||||
|
@ -96,17 +97,13 @@ FocusScope {
|
|||
|
||||
StyledTextLabel {
|
||||
id: learnLabel
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTrc("learn", "Learn")
|
||||
font: ui.theme.titleBoldFont
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.preferredWidth: topLayout.width - learnLabel.width - searchField.width - topLayout.spacing * 2
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
SearchField {
|
||||
id: searchField
|
||||
|
||||
|
@ -127,7 +124,7 @@ FocusScope {
|
|||
id: bar
|
||||
|
||||
anchors.top: topLayout.bottom
|
||||
anchors.topMargin: 36
|
||||
anchors.topMargin: prv.sideMargin
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: prv.sideMargin - itemSideMargin
|
||||
|
||||
|
|
|
@ -72,8 +72,6 @@ FocusScope {
|
|||
anchors.right: parent.right
|
||||
anchors.rightMargin: prv.sideMargin
|
||||
|
||||
height: childrenRect.height
|
||||
|
||||
spacing: 12
|
||||
|
||||
NavigationPanel {
|
||||
|
@ -86,17 +84,13 @@ FocusScope {
|
|||
|
||||
StyledTextLabel {
|
||||
id: pageTitle
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTrc("project", "Scores")
|
||||
font: ui.theme.titleBoldFont
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.preferredWidth: topLayout.width - pageTitle.width - searchField.width - topLayout.spacing * 2
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
SearchField {
|
||||
id: searchField
|
||||
|
||||
|
@ -133,7 +127,7 @@ FocusScope {
|
|||
id: view
|
||||
|
||||
anchors.top: topLayout.bottom
|
||||
anchors.topMargin: 74
|
||||
anchors.topMargin: prv.sideMargin
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: prv.sideMargin - view.sideMargin
|
||||
anchors.right: parent.right
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import MuseScore.Ui 1.0
|
||||
import MuseScore.UiComponents 1.0
|
||||
|
|
Loading…
Reference in a new issue