Commit 21e4efa0 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen Committed by GitHub

Merge pull request #49 from eekkelund/fontScaling

[Scaling] Request to change fontSize to font.pixelSize and recalculate Theme.fontSizes
parents c9dc0c37 4d857b53
...@@ -60,6 +60,10 @@ Page { ...@@ -60,6 +60,10 @@ Page {
anchors.margins: 20 anchors.margins: 20
showValue: true showValue: true
value: 0.5 value: 0.5
minimumValue: 1
maximumValue: 100
stepSize: 1
} }
Slider { Slider {
anchors.margins: 20 anchors.margins: 20
......
...@@ -3,5 +3,6 @@ import QtQuick.Controls 1.0 ...@@ -3,5 +3,6 @@ import QtQuick.Controls 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
CheckBox { CheckBox {
property int fontSize: Theme.fontSizeSmall
style: CheckBoxStyle{} style: CheckBoxStyle{}
} }
...@@ -64,7 +64,7 @@ Item { ...@@ -64,7 +64,7 @@ Item {
clip: true clip: true
font.family: Theme.fontFamily font.family: Theme.fontFamily
color: Theme.textColor color: Theme.textColor
font.pointSize: Theme.fontSizeLarge font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Bold font.weight: Font.Bold
LinearGradient { LinearGradient {
anchors.right: parent.right anchors.right: parent.right
......
...@@ -35,5 +35,5 @@ Text { ...@@ -35,5 +35,5 @@ Text {
renderType: Text.NativeRendering renderType: Text.NativeRendering
font.family: Theme.fontFamily font.family: Theme.fontFamily
color: Theme.textColor color: Theme.textColor
font.pointSize: Theme.fontSizeLarge font.pixelSize: Theme.fontSizeMedium
} }
...@@ -9,6 +9,9 @@ ListView { ...@@ -9,6 +9,9 @@ ListView {
signal hideAllActions(int hideIndex) signal hideAllActions(int hideIndex)
property bool showDecorator: false property bool showDecorator: false
property color delegateColor: Theme.backgroundColor
property color bottomGradientColor: Theme.backgroundColor
property color scrollerDecoratorColor: Theme.accentColor
section.criteria: ViewSection.FullString section.criteria: ViewSection.FullString
section.delegate: Component{ section.delegate: Component{
...@@ -16,13 +19,13 @@ ListView { ...@@ -16,13 +19,13 @@ ListView {
Rectangle { Rectangle {
width: listView.width width: listView.width
height: size.dp(44) height: size.dp(44)
color: Theme.backgroundColor color: delegateColor
Text { Text {
id: sectionText id: sectionText
text: section text: section
font.capitalization: Font.AllUppercase font.capitalization: Font.AllUppercase
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeSmall
color: Theme.textColor color: Theme.textColor
anchors{ anchors{
left: parent.left left: parent.left
...@@ -59,7 +62,7 @@ ListView { ...@@ -59,7 +62,7 @@ ListView {
end: Qt.point(0, size.dp(30)) end: Qt.point(0, size.dp(30))
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" } GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 1.0; color: Theme.backgroundColor } GradientStop { position: 1.0; color: bottomGradientColor }
} }
} }
...@@ -68,7 +71,7 @@ ListView { ...@@ -68,7 +71,7 @@ ListView {
Rectangle{ Rectangle{
id: scrollerDecorator id: scrollerDecorator
visible: (listView.showDecorator && listView.contentHeight > listView.height) visible: (listView.showDecorator && listView.contentHeight > listView.height)
color: Theme.accentColor color: scrollerDecoratorColor
width: size.dp(5) width: size.dp(5)
height: listView.height*listView.height/listView.contentHeight height: listView.height*listView.height/listView.contentHeight
......
...@@ -7,6 +7,7 @@ import QtQuick.Controls.Styles.Nemo 1.0 ...@@ -7,6 +7,7 @@ import QtQuick.Controls.Styles.Nemo 1.0
Slider { Slider {
id: slider id: slider
property bool showValue: false property bool showValue: false
property int valueFontSize: Theme.fontSizeTiny
style: SliderStyle{} style: SliderStyle{}
} }
...@@ -30,11 +30,11 @@ Theme::Theme(QObject *parent) : QObject(parent) ...@@ -30,11 +30,11 @@ Theme::Theme(QObject *parent) : QObject(parent)
m_itemSpacingSmall = 10*m_dp; m_itemSpacingSmall = 10*m_dp;
m_itemSpacingExtraSmall = 8*m_dp; m_itemSpacingExtraSmall = 8*m_dp;
m_fontSizeExtraLarge = 30*m_dp; m_fontSizeExtraLarge = 50*m_dp;
m_fontSizeLarge = 24*m_dp; m_fontSizeLarge = 40*m_dp;
m_fontSizeMedium = 20*m_dp; m_fontSizeMedium = 32*m_dp;
m_fontSizeSmall = 18*m_dp; m_fontSizeSmall = 26*m_dp;
m_fontSizeTiny = 16*m_dp; m_fontSizeTiny = 18*m_dp;
m_fontWeightLarge = 63*m_dp; m_fontWeightLarge = 63*m_dp;
m_fontWeightMedium = 25*m_dp; m_fontWeightMedium = 25*m_dp;
m_fontFamily = "/usr/share/fonts/google-opensans/OpenSans-Regular.ttf"; m_fontFamily = "/usr/share/fonts/google-opensans/OpenSans-Regular.ttf";
......
...@@ -147,11 +147,11 @@ private: ...@@ -147,11 +147,11 @@ private:
qreal m_itemSpacingSmall; //10 qreal m_itemSpacingSmall; //10
qreal m_itemSpacingExtraSmall; //8 qreal m_itemSpacingExtraSmall; //8
int m_fontSizeExtraLarge; //30 int m_fontSizeExtraLarge; //50
int m_fontSizeLarge; //24 int m_fontSizeLarge; //40
int m_fontSizeMedium; //20 int m_fontSizeMedium; //32
int m_fontSizeSmall; //18 int m_fontSizeSmall; //26
int m_fontSizeTiny; //16 int m_fontSizeTiny; //18
int m_fontWeightLarge; //63 int m_fontWeightLarge; //63
int m_fontWeightMedium; //25 int m_fontWeightMedium; //25
QString m_fontFamily; //??? QString m_fontFamily; //???
......
...@@ -73,7 +73,7 @@ ButtonStyle { ...@@ -73,7 +73,7 @@ ButtonStyle {
text: control.text text: control.text
color: Theme.textColor color: Theme.textColor
font.family: Theme.fontFamily font.family: Theme.fontFamily
font.pointSize: Theme.fontSizeLarge font.pixelSize: Theme.fontSizeMedium
font.weight: control.primary ? Theme.fontWeightLarge : Theme.fontWeightMedium font.weight: control.primary ? Theme.fontWeightLarge : Theme.fontWeightMedium
opacity: control.enabled ? 1.0 : 0.3 opacity: control.enabled ? 1.0 : 0.3
} }
......
...@@ -130,6 +130,7 @@ CheckBoxStyle { ...@@ -130,6 +130,7 @@ CheckBoxStyle {
} }
label: Label { label: Label {
text: control.text text: control.text
font.pixelSize:control.fontSize
} }
spacing: 10 spacing: 10
} }
...@@ -37,9 +37,10 @@ SliderStyle{ ...@@ -37,9 +37,10 @@ SliderStyle{
Text{ Text{
id: valueLabel id: valueLabel
anchors.centerIn: parent anchors.centerIn: parent
text: parseInt(control.value*100) text: parseInt(control.value)
visible: control.showValue visible: control.showValue
color: Theme.textColor color: Theme.textColor
font.pixelSize: control.valueFontSize
} }
} }
......
...@@ -25,8 +25,9 @@ TextFieldStyle { ...@@ -25,8 +25,9 @@ TextFieldStyle {
selectedTextColor: Theme.textColor selectedTextColor: Theme.textColor
selectionColor: Theme.accentColor selectionColor: Theme.accentColor
textColor: Theme.textColor textColor: Theme.textColor
font.pointSize: Theme.fontSizeTiny font.pixelSize: Theme.fontSizeMedium
font.family: Theme.fontFamily font.family: Theme.fontFamily
placeholderTextColor: Theme.textColor
background: Item { background: Item {
anchors{ anchors{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment