Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root /home/djszapi/Projects/kde/gluon_mobile/player/touch # cat LineEdit.qml
- import Qt 4.7
- /**
- * A LineEdit in Mana style
- */
- FocusScope {
- property alias text: textInput.text
- property alias labelText: label.text
- property alias echoMode: textInput.echoMode
- property variant tabTarget: KeyNavigation.down;
- property variant backtabTarget: KeyNavigation.up;
- height: 50;
- anchors.margins: 5;
- Keys.onTabPressed: if (tabTarget) tabTarget.focus = true;
- Keys.onBacktabPressed: if (backtabTarget) backtabTarget.focus = true;
- onActiveFocusChanged: {
- if (activeFocus)
- textInput.selectAll();
- }
- BorderImage {
- anchors.fill: parent
- source: "icons/lineedit.png"
- border.bottom: 20;
- border.top: 20;
- border.right: 20;
- border.left: 20;
- }
- Text {
- id: label;
- x: textInput.x;
- y: textInput.y;
- color: "darkGray";
- font: textInput.font;
- states: [
- State {
- name: "labelHidden";
- when: textInput.text != "";
- PropertyChanges { target: label; opacity: 0; }
- }
- ]
- transitions: [
- Transition {
- from: "labelHidden";
- NumberAnimation {
- property: "opacity";
- easing.type: Easing.InOutQuad;
- }
- }
- ]
- }
- TextInput {
- id: textInput
- y: 5
- anchors.verticalCenter: parent.verticalCenter;
- anchors.verticalCenterOffset: 2;
- anchors.right: parent.right
- anchors.rightMargin: 12
- anchors.left: parent.left
- anchors.leftMargin: 12
- focus: true
- selectByMouse: true
- passwordCharacter: "*"
- font.pixelSize: 24;
- }
- }
- root /home/djszapi/Projects/kde/gluon_mobile/player/touch # cat Login.qml
- import Qt 4.7
- Rectangle {
- x: 0
- y: 0
- signal clicked
- border.color: "black"
- color: "darkGrey"
- property alias username: usernameLineEdit.text;
- property alias password: passwordLineEdit.text;
- Text {
- id: usernameText
- text: "Username"
- color: "white"
- font.pixelSize: 24
- }
- LineEdit {
- id: usernameLineEdit
- x: 15
- width: usernameText.width * 3
- anchors.top: usernameText.bottom
- }
- Text {
- id: passwordText
- text: "Password"
- color: "white"
- width: usernameText.width
- font.pixelSize: usernameText.font.pixelSize
- anchors.top: usernameLineEdit.bottom
- }
- LineEdit {
- id: passwordLineEdit
- x: 15
- width: usernameText.width * 3
- anchors.top: passwordText.bottom
- echoMode: TextInput.Password
- }
- // MouseArea {
- // id: mr
- // anchors.fill: parent
- // onClicked: {
- // parent.focus = true
- // lgn.clicked()
- // }
- // }
- states: State {
- name: "pressed"; when: mr.pressed
- // PropertyChanges { target: textelement; x: 5 }
- // PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 }
- }
- transitions: Transition {
- NumberAnimation {
- // properties: "x,left"
- easing.type: Easing.InOutQuad
- duration: 200
- }
- }
- }
- root /home/djszapi/Projects/kde/gluon_mobile/player/touch # cat Startup.qml
- import Qt 4.7
- Rectangle {
- id: gluon_player
- color: "black"
- x: 0
- y: 0
- width: 490
- height: 720
- SystemPalette {
- id: activePalette
- }
- Image {
- id: gluon_logo
- // anchors.fill: parent
- source: "icons/hi256-app-gluon.png"
- width: parent.width/2 * 4/5
- height: parent.height * 3/5
- fillMode: Image.PreserveAspectFit
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.horizontalCenterOffset: -parent.width/4
- anchors.verticalCenter: parent.verticalCenter
- anchors.margins: 10
- }
- Login {
- id: lgn
- width: parent.width / 2
- height: parent.height * 2 / 5
- anchors.left: gluon_logo.right
- anchors.margins: 10
- }
- Button {
- id: new_user
- width: parent.width / 4
- height: parent.height * 1 / 5
- icon: "icons/user-group-new.png"
- text: "New User"
- onClicked: console.log("this doesn't do anything yet...")
- anchors.top: lgn.bottom
- anchors.left: gluon_logo.right
- anchors.margins: 10
- }
- Button {
- id: log_on
- width: parent.width / 4
- height: parent.height * 1 / 5
- icon: "icons/im-user.png"
- text: "Log On"
- onClicked: {
- authentication.login(lgn.username, "test");
- }
- anchors.top: lgn.bottom
- anchors.left: new_user.right
- anchors.margins: 10
- }
- Button {
- id: forgotten_details
- width: parent.width / 2
- height: parent.height * 1 / 5
- icon: "icons/help-hint.png"
- text: "Forgotten Your Details?"
- subtext: "Send new password to your email address"
- onClicked: console.log("this doesn't do anything yet...")
- anchors.top: log_on.bottom
- anchors.left: gluon_logo.right
- anchors.margins: 10
- }
- Button {
- id: play
- width: parent.width / 2
- height: parent.height * 1 / 5
- icon: "icons/media-playback-start.png"
- text: "Play Without Logging On"
- subtext: "3 games available"
- onClicked: console.log("this doesn't do anything yet...")
- anchors.top: forgotten_details.bottom
- anchors.left: gluon_logo.right
- anchors.margins: 10
- }
- }
- root /home/djszapi/Projects/kde/gluon_mobile/player/touch #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement