Skip to content

Commit

Permalink
Merge pull request #107 from sailfish-spotify/margins-fix
Browse files Browse the repository at this point in the history
Fix invalid margins
  • Loading branch information
ksiazkowicz authored Mar 22, 2019
2 parents 1d05ef7 + 6a242ff commit 22787ba
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 59 deletions.
6 changes: 4 additions & 2 deletions qml/components/AlbumTrackListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ Item {
property var dataModel
signal toggleFavorite()

width: parent.width
width: parent.width - 2 * Theme.horizontalPageMargin
x: Theme.horizontalPageMargin
height: Math.max(labelss.height, savedImage.height)
anchors.verticalCenter: parent.verticalCenter

opacity: Util.isTrackPlayable(dataModel.item) ? 1.0 : 0.4

Image {
id: savedImage
anchors.left: parent.left
x: Theme.horizontalPageMargin
anchors.verticalCenter: parent.verticalCenter
height: Theme.iconSizeSmall
asynchronous: true
Expand All @@ -53,6 +54,7 @@ Item {
id: labelss
anchors.left: savedImage.right
anchors.right: parent.right
anchors.rightMargin: Theme.horizontalPageMargin
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Theme.paddingMedium

Expand Down
4 changes: 1 addition & 3 deletions qml/components/ArtistPicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ Dialog {

delegate: ListItem {
id: delegateItem

width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

onClicked: {
Expand Down
4 changes: 2 additions & 2 deletions qml/components/ConfirmDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Dialog {

Label {
id: msgTextArea
x: Theme.paddingMedium
width: parent.width - 2*Theme.paddingMedium
x: Theme.horizontalPageMargin
width: parent.width - 2*Theme.horizontalPageMargin
textFormat: Text.RichText
truncationMode: TruncationMode.Fade
text: confirmMessageText
Expand Down
5 changes: 1 addition & 4 deletions qml/components/NavigationMenuDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,11 @@ Dialog {
}

delegate: ListItem {
width: parent.width - 2*Theme.paddingLarge
x: Theme.paddingLarge

Image {
id: image
width: Theme.iconSizeMedium
height: width
anchors.left: parent.left
x: Theme.horizontalPageMargin
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
source: model.icon
Expand Down
6 changes: 2 additions & 4 deletions qml/components/PlaylistPicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Dialog {
delegate: ListItem {
id: delegateItem

width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

onClicked: {
Expand All @@ -55,8 +54,7 @@ Dialog {
section.delegate : Component {
id: sectionHeading
Item {
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
height: childrenRect.height

Text {
Expand Down
10 changes: 4 additions & 6 deletions qml/components/SearchResultListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import "../Util.js" as Util

Row {
id: row

property var dataModel

// not used, same as in AlbumTrackListItem so Loader can be used
Expand All @@ -23,7 +22,8 @@ Row {

signal toggleFavorite()

width: parent.width
width: parent.width - 2 * Theme.horizontalPageMargin
x: Theme.horizontalPageMargin
spacing: Theme.paddingMedium

opacity: (dataModel.type !== Util.SpotifyItemType.Track
Expand All @@ -33,17 +33,15 @@ Row {
id: image
width: height
height: column.height
anchors {
verticalCenter: parent.verticalCenter
}
anchors.verticalCenter: parent.verticalCenter
asynchronous: true
fillMode: Image.PreserveAspectFit
source: getImageURL(dataModel)
}

Column {
id: column
width: parent.width - image.width - 2 * Theme.paddingMedium
width: parent.width - image.width - parent.spacing

Label {
id: nameLabel
Expand Down
4 changes: 2 additions & 2 deletions qml/components/SectionDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Sailfish.Silica 1.0

Component {
Item {
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width - 2 * Theme.horizontalPageMargin
x: Theme.horizontalPageMargin
height: childrenRect.height
Text {
width: parent.width
Expand Down
3 changes: 1 addition & 2 deletions qml/pages/Album.qml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeExtraSmall

AlbumTrackListItem {
Expand Down
3 changes: 1 addition & 2 deletions qml/pages/Artist.qml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

SearchResultListItem {
Expand Down
6 changes: 3 additions & 3 deletions qml/pages/Devices.qml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ Page {

delegate: ListItem {
id: delegate
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
opacity: sp == 1 ? 1.0 : 0.4

Column {
id: column
width: parent.width
x: Theme.horizontalPageMargin
width: parent.width - 2 * Theme.horizontalPageMargin
Label {
id: nameLabel
//color: is_active ? Theme.highlightColor : Theme.primaryColor
Expand Down
6 changes: 3 additions & 3 deletions qml/pages/GenreMood.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

Image {
id: categoryIcon
width: Theme.iconSizeLarge
height: width
anchors.left: parent.left
x: Theme.horizontalPageMargin
anchors.verticalCenter: parent.verticalCenter
asynchronous: true
fillMode: Image.PreserveAspectFit
Expand All @@ -72,6 +71,7 @@ Page {
id: categoryName
anchors.left: categoryIcon.right
anchors.right: parent.right
anchors.rightMargin: Theme.horizontalPageMargin
anchors.leftMargin: Theme.paddingMedium
anchors.verticalCenter: parent.verticalCenter
color: Theme.primaryColor
Expand Down
5 changes: 2 additions & 3 deletions qml/pages/GenreMoodPlaylist.qml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

Image {
x: Theme.horizontalPageMargin
id: categoryIcon
width: Theme.iconSizeLarge
height: width
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
asynchronous: true
fillMode: Image.PreserveAspectFit
Expand Down
3 changes: 1 addition & 2 deletions qml/pages/History.qml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
//height: searchResultListItem.height
contentHeight: Theme.itemSizeLarge

Expand Down
3 changes: 1 addition & 2 deletions qml/pages/MyStuff.qml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

SearchResultListItem {
Expand Down
6 changes: 3 additions & 3 deletions qml/pages/NavigationMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ Page {
}

delegate: ListItem {
width: parent.width - 2*Theme.paddingLarge
x: Theme.paddingLarge
width: parent.width

Image {
id: image
width: Theme.iconSizeMedium
height: width
anchors.left: parent.left
x: Theme.horizontalPageMargin
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
source: model.icon
Expand All @@ -104,6 +103,7 @@ Page {
anchors.left: image.right
anchors.leftMargin: Theme.paddingLarge
anchors.right: parent.right
anchors.rightMargin: Theme.horizontalPageMargin
anchors.verticalCenter: parent.verticalCenter
color: _currentIndex === index ? Theme.highlightColor : Theme.primaryColor
text: model.name
Expand Down
4 changes: 1 addition & 3 deletions qml/pages/NewAndFeatured.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
//height: searchResultListItem.height
width: parent.width
contentHeight: Theme.itemSizeLarge

SearchResultListItem {
Expand Down
3 changes: 1 addition & 2 deletions qml/pages/Playing.qml
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: contextType == 0
? Theme.itemSizeExtraSmall
: Theme.itemSizeLarge
Expand Down
3 changes: 1 addition & 2 deletions qml/pages/Playlist.qml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

SearchResultListItem {
Expand Down
6 changes: 2 additions & 4 deletions qml/pages/Recommended.qml
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ Page {
}
delegate: ListItem {
id: seedListItem
width: parent.width //- 2*Theme.paddingMedium
//x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge
SearchResultListItem {
id: seedResultListItem
Expand Down Expand Up @@ -305,8 +304,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

SearchResultListItem {
Expand Down
4 changes: 1 addition & 3 deletions qml/pages/Search.qml
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
//height: searchResultListItem.height
width: parent.width
contentHeight: Theme.itemSizeLarge

SearchResultListItem {
Expand Down
3 changes: 1 addition & 2 deletions qml/pages/TopStuff.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ Page {

delegate: ListItem {
id: listItem
width: parent.width - 2*Theme.paddingMedium
x: Theme.paddingMedium
width: parent.width
contentHeight: Theme.itemSizeLarge

SearchResultListItem {
Expand Down

0 comments on commit 22787ba

Please sign in to comment.