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