Skip to content

Commit

Permalink
Fix for issue musescore#12673: On wide screens, the text in Learn > C…
Browse files Browse the repository at this point in the history
…lasses is too wide to be comfortably readable (musescore#18167)

* Initial Fix

Working fix, still need to work on the ClassPage.qml for a better fix

* Update ClassesPage.qml

Changed the root element to a `StyledFlickable`

* Fixed code style and anchors

Fixed the code style of the qml file to match the rest of the codebase.
Removed right anchors and margin from the Rectangle containing authorInfo
  • Loading branch information
octopols committed Jul 4, 2023
1 parent 5aa3c32 commit e032187
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/learn/qml/MuseScore/Learn/LearnPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ FocusScope {
navigation.panel: navSearchPanel
navigation.order: 1

visible: tabBar.currentIndex !== 1 // Not visible for Classes tab

onSearchTextChanged: {
pageModel.setSearchText(searchText)
}
Expand Down
12 changes: 7 additions & 5 deletions src/learn/qml/MuseScore/Learn/internal/ClassesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import QtGraphicalEffects 1.0
import MuseScore.Ui 1.0
import MuseScore.UiComponents 1.0

FocusScope {
StyledFlickable {
id: root

property string authorName: ""
Expand All @@ -41,6 +41,9 @@ FocusScope {
property alias navigation: navPanel
property int sideMargin: 46

contentWidth: parent.width
contentHeight: authorInfo.height + sideMargin

NavigationPanel {
id: navPanel
name: "Classes"
Expand All @@ -61,13 +64,11 @@ FocusScope {
}

Rectangle {
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: root.sideMargin
anchors.right: parent.right
anchors.rightMargin: root.sideMargin

height: authorInfo.height
width: Math.min(1000, parent.width - 2 * root.sideMargin)

radius: 12

Expand All @@ -78,7 +79,8 @@ FocusScope {

anchors.left: parent.left
anchors.leftMargin: 36
anchors.right: parent.horizontalCenter
anchors.right: parent.right
anchors.rightMargin: 36
anchors.top: parent.top
anchors.topMargin: 36

Expand Down
2 changes: 1 addition & 1 deletion src/learn/view/learnpagemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ QVariantMap LearnPageModel::classesAuthor() const
"or are a power user eager to explore advanced engraving and playback techniques, "
"my flagship online course Mastering MuseScore "
"covers everything you need to know to get the most out of MuseScore. "
"In addition, Mastering MuseScore features a supportive community of musicians, "
"\n\nIn addition, Mastering MuseScore features a supportive community of musicians, "
"with discussion spaces, live streams, "
"and other related courses and services to help you create your best music. "
"Take advantage of this opportunity to learn MuseScore from one of its most recognized experts!");
Expand Down

0 comments on commit e032187

Please sign in to comment.