Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
Merge pull request #126 from mymike00/master
Browse files Browse the repository at this point in the history
switching from Devices.density to units.gu
  • Loading branch information
Flohack74 authored Jan 9, 2018
2 parents 1688795 + 7b5bbbf commit 6c405ed
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 92 deletions.
8 changes: 4 additions & 4 deletions telegram/app/qml/AccountLoading.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ Rectangle {

Column {
anchors.centerIn: parent
spacing: 8*Devices.density
spacing: units.gu(1)

Indicator {
id: indicator
anchors.horizontalCenter: parent.horizontalCenter
indicatorSize: 22*Devices.density
indicatorSize: units.gu(2.75)
modern: true
light: false
Component.onCompleted: start()
Expand All @@ -47,7 +47,7 @@ Rectangle {
id: logout_text
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.verticalCenter
anchors.topMargin: 80*Devices.density
anchors.topMargin: units.gu(10)
font.family: AsemanApp.globalFont.family
font.pixelSize: 10*Devices.fontDensity
font.underline: true
Expand All @@ -56,7 +56,7 @@ Rectangle {

MouseArea {
anchors.fill: parent
anchors.margins: -10*Devices.density
anchors.margins: -units.gu(1.25)
cursorShape: Qt.PointingHandCursor
onClicked: Cutegram.logout(telegramObject.phoneNumber)
}
Expand Down
4 changes: 2 additions & 2 deletions telegram/app/qml/AccountMessageAction.qml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ Item {
Image {
id: img
anchors.horizontalCenter: parent.horizontalCenter
width: 64*Devices.density
height: 80*Devices.density
width: units.gu(8)
height: units.gu(10)
sourceSize: Qt.size(width,width)
source: {
if(imgPath.length==0)
Expand Down
33 changes: 16 additions & 17 deletions telegram/app/qml/AccountMessageList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ Rectangle {
Rectangle {
anchors.centerIn: parent
color: "#ffffff"
width: welcome_txt.width + 20*Devices.density
height: welcome_txt.height + 10*Devices.density
radius: 5*Devices.density
width: welcome_txt.width + units.gu(2.5)
height: welcome_txt.height + units.gu(1.25)
radius: units.dp(4)
visible: currentDialog == telegramObject.nullDialog

Text {
Expand Down Expand Up @@ -361,27 +361,26 @@ Rectangle {
}

PhysicalScrollBar {
scrollArea: mlist; height: mlist.height-bottomMargin-topMargin; width: 6*Devices.density
scrollArea: mlist; height: mlist.height-bottomMargin-topMargin; width: units.gu(0.75)
anchors.right: mlist.right; anchors.top: mlist.top;
anchors.topMargin: topMargin; reverse: true
}

Rectangle {
ProportionalShape {
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.bottomMargin: bottomMargin + 8*Devices.density
anchors.rightMargin: 8*Devices.density
width: units.gu(7)//64*Devices.density
height: width
radius: height / 2//5*Devices.density
anchors.bottomMargin: bottomMargin + units.gu(1)
anchors.rightMargin: units.gu(1)
width: units.gu(7)
color: "#88000000"
// normalColor: "#88000000"
// highlightColor: "#aa000000"
// iconSource: "files/down.png"
// cursorShape: Qt.PointingHandCursor
// iconHeight: 18*Devices.density
// iconHeight: units.gu(2.25)
visible: opacity != 0
opacity: mlist.visibleArea.yPosition+mlist.visibleArea.heightRatio < 0.95? 1 : 0
aspect: UbuntuShape.Flat

MouseArea {
anchors.fill: parent
Expand All @@ -390,11 +389,11 @@ Rectangle {

// onClicked: mlist.positionViewAtBeginning()

Image {
Icon {
anchors.centerIn: parent
height: units.gu(2)
fillMode: Image.PreserveAspectFit
source: "qrc:/qml/files/down.png"
height: units.gu(3.25)
color: "white"
name: "down"
}

Behavior on opacity {
Expand Down Expand Up @@ -439,10 +438,10 @@ Rectangle {

Column {
anchors.top: acc_rjc_txt.bottom
anchors.topMargin: 10*Devices.density
anchors.topMargin: units.gu(1.25)
anchors.left: parent.left
anchors.right: parent.right
spacing: 10*Devices.density
spacing: units.gu(1.25)
visible: acc_rjc_txt.visible

TelegramButton {
Expand Down
16 changes: 8 additions & 8 deletions telegram/app/qml/AccountMessageMedia.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Item {
property variant mediaType: file_handler.targetType
property bool downloading: file_handler.progressType != FileHandler.TypeProgressEmpty

property real maximumMediaHeight: 256 * Devices.density
property real maximumMediaHeight: units.gu(32)
property real maximumMediaWidth: width * 0.75
property real maximumMediaRatio: maximumMediaWidth / maximumMediaHeight

Expand Down Expand Up @@ -265,7 +265,7 @@ Item {
visible: fileLocation.length == 0 && !isSticker
&& file_handler.targetType != FileHandler.TypeTargetMediaPhoto
&& file_handler.targetType != FileHandler.TypeTargetMediaGeoPoint
radius: 3*Devices.density
radius: units.dp(4)

Icon {
height: units.gu(4)
Expand Down Expand Up @@ -298,7 +298,7 @@ Item {
id:filesize_lbl
anchors.top: parent.top
anchors.left: parent.left
anchors.margins: 3*Devices.density
anchors.margins: units.gu(0.5)
font.weight: Font.DemiBold
fontSize: "small"
color: "white"
Expand All @@ -319,7 +319,7 @@ Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 4*Devices.density
anchors.margins: units.gu(0.5)
height: units.dp(3)
radius: 0
percent: downloading ? file_handler.progressPercent : 0
Expand All @@ -332,8 +332,8 @@ Item {
source: file_handler.targetType == FileHandler.TypeTargetMediaOther? "files/map-pin.png" : ""
sourceSize: Qt.size(width,height)
fillMode: Image.PreserveAspectFit
width: 92*Devices.density
height: 92*Devices.density
width: units.gu(12)
height: units.gu(12)
visible: file_handler.targetType == FileHandler.TypeTargetMediaOther
asynchronous: true
smooth: true
Expand Down Expand Up @@ -399,8 +399,8 @@ Item {
Component {
id: media_player_component
MediaPlayerItem {
width: 180*Devices.density
height: 40*Devices.density
width: units.gu(22)
height: units.gu(5)
anchors.verticalCenter: parent.verticalCenter
filePath: fileLocation
z: fileLocation.length == 0? -1 : 0
Expand Down
6 changes: 3 additions & 3 deletions telegram/app/qml/AccountMessageUpload.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Item {
id: filesize_lbl
anchors.top: parent.top
anchors.left: parent.left
anchors.margins: 2*Devices.density
anchors.margins: units.gu(0.25)
font.weight: Font.DemiBold
fontSize: "small"
color: "white"
Expand Down Expand Up @@ -88,7 +88,7 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: pbar.top
anchors.margins: 2*Devices.density
anchors.margins: units.gu(0.25)
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
elide: Text.ElideRight
Expand All @@ -104,7 +104,7 @@ Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 4*Devices.density
anchors.margins: units.gu(0.5)
height: units.dp(3)
radius: 0
percent: 100*message.upload.uploaded/message.upload.totalSize
Expand Down
2 changes: 1 addition & 1 deletion telegram/app/qml/ClickableContactImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ContactImage {
anchors.fill: parent
light: true
modern: true
indicatorSize: 22*Devices.density
indicatorSize: units.gu(2.75)
property bool active: user_photo_marea.loadingPhoto

onActiveChanged: {
Expand Down
4 changes: 2 additions & 2 deletions telegram/app/qml/FramedContactImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Item {
width: parent.width*2
height: parent.height*2
visible: false
radius: 10*Devices.density
radius: units.gu(1.25)
scale: 2

ContactImage {
Expand All @@ -37,7 +37,7 @@ Item {
Rectangle {
radius: item.radius
anchors.fill: parent
anchors.margins: 1*Devices.density
anchors.margins: units.dp(1)
}
}

Expand Down
12 changes: 6 additions & 6 deletions telegram/app/qml/MediaPlayerItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "js/time.js" as Time

Item {
width: 100
height: 62*Devices.density
height: units.gu(8)

property alias filePath: player.source
property bool isInsideBar: false
Expand Down Expand Up @@ -42,7 +42,7 @@ Item {
Rectangle {
id: play_btn
anchors.fill: parent
anchors.margins: 3*Devices.density
anchors.margins: units.gu(0.5)
radius: width/2
color: "#ffffff"
visible: !parent.isInsideBar
Expand Down Expand Up @@ -128,9 +128,9 @@ Item {
anchors.left: play_btn_scene.right
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 4*Devices.density
height: 6*Devices.density
radius: 2*Devices.density
anchors.margins: units.gu(0.5)
height: units.gu(0.75)
radius: units.gu(0.25)
color: "#555555"

Rectangle {
Expand All @@ -149,7 +149,7 @@ Item {
radius: width/2
color: "#ffffff"
border.color: "#aaaaaa"
border.width: 1*Devices.density
border.width: units.dp(1)
x: (seeker_scene.width-seeker.width)*player.position/player.duration
}
}
Expand Down
8 changes: 4 additions & 4 deletions telegram/app/qml/MessageReplyItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import "js/colors.js" as Colors

Item {
id: msg_reply
width: row.width + 12*Devices.density
height: row.height + 4*Devices.density
width: row.width + units.gu(1.5)
height: row.height + units.gu(0.5)
visible: realMessage

property Telegram telegram
Expand Down Expand Up @@ -37,7 +37,7 @@ Item {
Column {
id: column
anchors.verticalCenter: parent.verticalCenter
spacing: 2*Devices.density
spacing: units.gu(0.25)

Label {
id: name_text
Expand All @@ -55,7 +55,7 @@ Item {
Image {
id: media_img
width: height*imageSize.width/imageSize.height
height: 48*Devices.density
height: units.gu(6)
fillMode: Image.PreserveAspectFit
asynchronous: true
sourceSize: Qt.size(width,height)
Expand Down
22 changes: 11 additions & 11 deletions telegram/app/qml/TagSuggestionMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "js/colors.js" as Colors
Item {
id: root
width: parent.width
height: 3 * 32*Devices.density + back_frame.anchors.topMargin
height: 3 * units.gu(4) + back_frame.anchors.topMargin
visible: fmodel.count != 0
clip: true

Expand All @@ -25,10 +25,10 @@ Item {
DropShadow {
anchors.fill: source
source: back
radius: 8*Devices.density
radius: units.gu(1)
samples: 16
horizontalOffset: 1*Devices.density
verticalOffset: 1*Devices.density
horizontalOffset: units.dp(1)
verticalOffset: units.dp(1)
color: "#66111111"
}

Expand All @@ -39,7 +39,7 @@ Item {
Rectangle {
id: back_frame
anchors.fill: parent
anchors.topMargin: 8*Devices.density
anchors.topMargin: units.gu(1)
color: Colors.white

Rectangle {
Expand All @@ -53,8 +53,8 @@ Item {

ListView {
id: listv
width: back_frame.width-8*Devices.density
height: back_frame.height-4*Devices.density
width: back_frame.width-units.gu(1)
height: back_frame.height-units.gu(0.5)
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
clip: true
Expand All @@ -64,20 +64,20 @@ Item {
/*highlightMoveDuration: 0
highlight: Rectangle {
width: listv.width
height: 32*Devices.density
height: units.gu(4)
color: Colors.list_pressed
radius: 2*Devices.density
radius: units.gu(0.25)
}*/

delegate: Item {
width: listv.width
height: 32*Devices.density
height: units.gu(4)

Text {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 4*Devices.density
anchors.margins: units.gu(0.5)
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
elide: Text.ElideRight
maximumLineCount: 1
Expand Down
Loading

0 comments on commit 6c405ed

Please sign in to comment.