Skip to content

Commit

Permalink
Change font to TakaoMincho #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal-Szczepaniak committed May 2, 2018
1 parent 8e1a8a2 commit ef0e1ee
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 13 deletions.
Binary file added .README.md.swp
Binary file not shown.
117 changes: 117 additions & 0 deletions IPA_Font_License_Agreement_v1.0.txt

Large diffs are not rendered by default.

31 changes: 18 additions & 13 deletions Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import QtQuick 2.0
import SddmComponents 2.0
import "./components"
import QtQuick.VirtualKeyboard 2.1

Rectangle {
Expand All @@ -22,8 +23,8 @@ Rectangle {
}

FontLoader {
id: opensans_cond_light
source: "fonts/OpenSans_CondLight.ttf"
id: takao_mincho
source: "fonts/TakaoMincho.ttf"
}

TextConstants { id: textConstants }
Expand Down Expand Up @@ -72,10 +73,10 @@ Rectangle {
TextBox {
id: amadeus_username

x: 677/amadeus_root.scalingX + diffX
y: 630/amadeus_root.scalingY + diffY
x: 683/amadeus_root.scalingX + diffX
y: 633/amadeus_root.scalingY + diffY

width: 571/amadeus_root.scalingX
width: 565/amadeus_root.scalingX
height: 46/amadeus_root.scalingY

color: "black"
Expand All @@ -84,29 +85,33 @@ Rectangle {
hoverColor: "#000"
textColor: "#f7d65d"

font.family: opensans_cond_light.name
font.pixelSize: 20
font.family: takao_mincho.name
font.pixelSize: 27
font.letterSpacing: 1.4
font.bold: true

KeyNavigation.tab: amadeus_password
}

PasswordBox {
SpTextBox {
id: amadeus_password

x: 677/amadeus_root.scalingX + diffX
y: 698/amadeus_root.scalingY + diffY
x: 688/amadeus_root.scalingX + diffX
y: 699/amadeus_root.scalingY + diffY

width: 571/amadeus_root.scalingX
width: 560/amadeus_root.scalingX
height: 46/amadeus_root.scalingY

echoMode: TextInput.Password

color: "black"
borderColor: "black"
focusColor: "#000"
hoverColor: "#000"
textColor: "#f7d65d"

font.family: opensans_cond_light.name
font.pixelSize: 20
font.family: takao_mincho.name
font.pixelSize: 27

KeyNavigation.tab: amadeus_login
KeyNavigation.backtab: amadeus_username
Expand Down
89 changes: 89 additions & 0 deletions components/SpTextBox.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/***************************************************************************
* Copyright (c) 2013 Abdurrahman AVCI <[email protected]>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
* OR OTHER DEALINGS IN THE SOFTWARE.
*
***************************************************************************/

import QtQuick 2.0

FocusScope {
id: container
width: 80; height: 30

property color color: "white"
property color borderColor: "#ababab"
property color focusColor: "#266294"
property color hoverColor: "#5692c4"
property alias radius: main.radius
property alias font: txtMain.font
property alias textColor: txtMain.color
property alias echoMode: txtMain.echoMode
property alias text: txtMain.text

Rectangle {
id: main

anchors.fill: parent

color: container.color
border.color: container.borderColor
border.width: 1

Behavior on border.color { ColorAnimation { duration: 100 } }

states: [
State {
name: "hover"; when: mouseArea.containsMouse
PropertyChanges { target: main; border.width: 1; border.color: container.hoverColor }
},
State {
name: "focus"; when: container.activeFocus && !mouseArea.containsMouse
PropertyChanges { target: main; border.width: 1; border.color: container.focusColor }
}
]
}

MouseArea {
id: mouseArea
anchors.fill: container

cursorShape: Qt.IBeamCursor

hoverEnabled: true

onEntered: if (main.state == "") main.state = "hover";
onExited: if (main.state == "hover") main.state = "";
onClicked: container.focus = true;
}

TextInput {
id: txtMain
width: parent.width - 16
anchors.centerIn: parent

color: "black"

clip: true
focus: true

passwordCharacter: "*"//"\u25cf"
}
}
Binary file removed fonts/OpenSans_CondLight.ttf
Binary file not shown.
Binary file added fonts/TakaoMincho.ttf
Binary file not shown.

0 comments on commit ef0e1ee

Please sign in to comment.