Commit 8252da0b authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

[bugfix] Label default font size as 24. Fixes NEMO#705.

parent a8f19eb4
......@@ -35,4 +35,5 @@ Text {
renderType: Text.NativeRendering
font.family: Theme.fontFamily
color: Theme.label.color
font.pointSize: Theme.label.pointSize
}
......@@ -25,7 +25,7 @@ TextFieldStyle {
selectedTextColor: Theme.textField.selectedTextColor
selectionColor: Theme.textField.selectionColor
textColor: Theme.textField.selectedTextColor
font.pixelSize: 24
font.pixelSize: Theme.textField.pointSize
background: Item {
implicitHeight: 40
implicitWidth: 320
......
......@@ -339,6 +339,9 @@ void NemoTheme::loadFromFile(const QString &fileName)
QJsonObject stylesTextField = styles.value("textField").toObject();
m_textField->setSelectedTextColor(jsonToColor(jsonValue(stylesTextField, "selectedTextColor", "textField"), defines));
m_textField->setSelectionColor(jsonToColor(jsonValue(stylesTextField, "selectionColor", "textField"), defines));
if (stylesTextField.contains("pointSize")) {
m_textField->setPointSize(jsonToInt(styles.value("textField"), defines));
}
// Setting properties for toolBar
QJsonObject stylesToolBar = styles.value("toolBar").toObject();
m_toolBar->setBackground(jsonToColor(jsonValue(stylesToolBar, "background", "toolBar"), defines));
......@@ -383,6 +386,9 @@ void NemoTheme::loadFromFile(const QString &fileName)
// Setting properties for label
QJsonObject stylesLabel = styles.value("label").toObject();
m_label->setColor(jsonToColor(jsonValue(stylesLabel, "color", "label"), defines));
if (stylesLabel.contains("pointSize")) {
m_label->setPointSize(jsonToInt(styles.value("label"), defines));
}
// Setting properties for checkbox
QJsonObject stylesCheckbox = styles.value("checkbox").toObject();
m_checkbox->setBack1(jsonToColor(jsonValue(stylesCheckbox, "back1", "checkbox"), defines));
......
......@@ -24,6 +24,7 @@
NemoThemeLabel::NemoThemeLabel(QObject *parent)
: QObject(parent)
, m_pointSize(24)
{
}
......@@ -39,3 +40,16 @@ void NemoThemeLabel::setColor(const QColor &color)
emit colorChanged();
}
}
int NemoThemeLabel::pointSize() const
{
return m_pointSize;
}
void NemoThemeLabel::setPointSize(int pointSize)
{
if (m_pointSize != pointSize) {
m_pointSize = pointSize;
emit pointSizeChanged();
}
}
......@@ -30,14 +30,19 @@ class NemoThemeLabel: public QObject
{
Q_OBJECT
Q_PROPERTY(QColor color READ color NOTIFY colorChanged)
Q_PROPERTY(int pointSize READ pointSize NOTIFY pointSizeChanged)
public:
explicit NemoThemeLabel(QObject *parent = 0);
QColor color() const;
void setColor(const QColor &color);
int pointSize() const;
void setPointSize(int pointSize);
Q_SIGNALS:
void colorChanged();
void pointSizeChanged();
private:
QColor m_color;
int m_pointSize;
};
#endif //NEMOTHEMELABEL_H
......@@ -24,6 +24,7 @@
NemoThemeTextField::NemoThemeTextField(QObject *parent)
: QObject(parent)
, m_pointSize(24)
{
}
......@@ -52,3 +53,16 @@ void NemoThemeTextField::setSelectionColor(const QColor &selectionColor)
emit selectionColorChanged();
}
}
int NemoThemeTextField::pointSize() const
{
return m_pointSize;
}
void NemoThemeTextField::setPointSize(int pointSize)
{
if (m_pointSize != pointSize) {
m_pointSize = pointSize;
emit pointSizeChanged();
}
}
......@@ -31,18 +31,23 @@ class NemoThemeTextField: public QObject
Q_OBJECT
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor NOTIFY selectedTextColorChanged)
Q_PROPERTY(QColor selectionColor READ selectionColor NOTIFY selectionColorChanged)
Q_PROPERTY(int pointSize READ pointSize NOTIFY pointSizeChanged)
public:
explicit NemoThemeTextField(QObject *parent = 0);
QColor selectedTextColor() const;
void setSelectedTextColor(const QColor &selectedTextColor);
QColor selectionColor() const;
void setSelectionColor(const QColor &selectionColor);
int pointSize() const;
void setPointSize(int pointSize);
Q_SIGNALS:
void selectedTextColorChanged();
void selectionColorChanged();
void pointSizeChanged();
private:
QColor m_selectedTextColor;
QColor m_selectionColor;
int m_pointSize;
};
#endif //NEMOTHEMETEXTFIELD_H
......@@ -41,6 +41,11 @@
{
"name": "selectionColor",
"type": "QColor"
},
{
"name": "pointSize",
"type": "int",
"default": 24
}
]
},
......@@ -208,6 +213,11 @@
{
"name":"color",
"type":"QColor"
},
{
"name": "pointSize",
"type": "int",
"default": 24
}
]
},
......
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