Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalability hacks #11

Merged
merged 1 commit into from
Dec 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions qml/items/Card.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ FreeCellItem {
property string suitChar
property string suitColor
stack: 0
property int maxOffset : 50
property int stackNarrowStart: deviceOrientation === Orientation.Portrait ? 8 : 6
property double narrowMultiplier: deviceOrientation === Orientation.Portrait ? 1 : 1.5
property int maxOffset : 50 * Theme.pixelRatio
property int stackNarrowStart: 5 * Theme.pixelRatio
property double narrowMultiplier: (deviceOrientation === Orientation.Portrait ? 1 : 1.5) * Theme.pixelRatio
maxStack : 1
property int totalStack : 0
property Item dragParent
Expand All @@ -30,8 +30,8 @@ FreeCellItem {
[{x: 5, y: 5}, {x: 55, y: 5}]://, {x: 5, y: 42 }, {x: 55, y: 42}] :
[{x: 5, y: 5}, {x: 69, y: 5}]//, {x: 5, y: 47 }, {x: 69, y: 47}]
property bool dropEnabled : dropArea.enabled
width: deviceOrientation === Orientation.Portrait ? 60 : 74
height: deviceOrientation === Orientation.Portrait ? 84 : 94
width: (deviceOrientation === Orientation.Portrait ? 60 : 74) * Theme.pixelRatio
height: (deviceOrientation === Orientation.Portrait ? 84 : 94) * Theme.pixelRatio
color: "white"
border.color: "black"
border.width: 1
Expand Down Expand Up @@ -243,7 +243,7 @@ FreeCellItem {
id: rankText
x:4; y:0
color: "black"
font.pixelSize: 24
font.pixelSize: 24 * Theme.pixelRatio
font.bold: true
text: rankChar
}
Expand All @@ -252,7 +252,7 @@ FreeCellItem {
x: card.width - font.pixelSize - 4/*32*/;
y: 0
color: suitColor
font.pixelSize: 24
font.pixelSize: 24 * Theme.pixelRatio
text: suitChar
}

Expand Down
6 changes: 3 additions & 3 deletions qml/items/Cell.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ FreeCellItem {
property var childCard;
property bool dropEnabled : dropArea.enabled
z: 1
width: deviceOrientation === Orientation.Portrait ? 62 : 76
height: deviceOrientation === Orientation.Portrait ? 86 : 96
width: (deviceOrientation === Orientation.Portrait ? 62 : 76) * Theme.pixelRatio
height: (deviceOrientation === Orientation.Portrait ? 86 : 96) * Theme.pixelRatio

color: Theme.rgba(Theme.secondaryHighlightColor, 0.5)//"#800000FF"
border.color: "black"
Expand Down Expand Up @@ -108,7 +108,7 @@ FreeCellItem {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
color: "black"
font.pixelSize: 48
font.pixelSize: 48 * Theme.pixelRatio
opacity: 0.5
text: suitChar
}
Expand Down
17 changes: 9 additions & 8 deletions qml/items/PlayField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import QtQuick.LocalStorage 2.0

Item {
id : playfield
width : 470; height: 400
width : parent.width // 470 * Theme.pixelRatio
height: parent.height // 400 * Theme.pixelRatio
property bool canAutoMove : false
property string type: "playfield"
property int smallGap: 2
property int bigGap: 4
property int cellGap: 20
property int landCellsX : 570
property int landCellsY : 12//140
property int smallGap: 2 * Theme.pixelRatio
property int bigGap: 4 * Theme.pixelRatio
property int cellGap: 20 * Theme.pixelRatio
property int landCellsX : 570 * Theme.pixelRatio
property int landCellsY : 12 * Theme.pixelRatio //140
property int landFieldsY : 12
property int landFieldsX : 112
property int portCellsX : 12
property int portCellsY : 0
property int portCellsX : 0.025 * width
property int portCellsY : 2 * Theme.pixelRatio
property var selectedCard : null
property var db

Expand Down
8 changes: 5 additions & 3 deletions qml/pages/FirstPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ Page {
id: rect
y: deviceOrientation === Orientation.Portrait ? 12 : 0
x: deviceOrientation === Orientation.Portrait ? 0 : 12
width: deviceOrientation === Orientation.Portrait ? page.width : 80
width: deviceOrientation === Orientation.Portrait ? page.width : 80 * Theme.pixelRatio
anchors.left: deviceOrientation === Orientation.Portrait ? column.left : undefined
height: deviceOrientation === Orientation.Portrait ? 60 : page.height
height: deviceOrientation === Orientation.Portrait ? 60 * Theme.pixelRatio : page.height
color : "transparent"
//border.color: "white"
//border.width: 1
Button
{

id: undoMove
anchors.left: deviceOrientation === Orientation.Portrait ? rect.left : rect.left
width: deviceOrientation === Orientation.Portrait ? rect.width / 2 : rect.width
height: deviceOrientation === Orientation.Portrait ? rect.height : rect.height / 2
Expand All @@ -88,6 +88,7 @@ Page {
}
Button
{
id: newGame
width: deviceOrientation === Orientation.Portrait ? rect.width / 2 : rect.width
height: deviceOrientation === Orientation.Portrait ? rect.height : rect.height / 2
y: deviceOrientation === Orientation.Portrait ? 0 : rect.height
Expand All @@ -113,6 +114,7 @@ Page {
{
id: field
y: deviceOrientation === Orientation.Portrait ? rect.height + 20 : 0
x: deviceOrientation === Orientation.Portrait ? 0 : (rect.height <= 540 ? 0 : newGame.width) // jolla phone special
}
}
}
Expand Down