summary refs log tree commit diff
path: root/src/ui/TextField.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2020-02-28 19:10:39 -0500
committerGitHub <noreply@github.com>2020-02-28 19:10:39 -0500
commit30cb7c5b02bb8a21a8d7257cfe5a8bd3db891606 (patch)
treeddadd16c86600ce937b47798a9b3d5ff2fdec998 /src/ui/TextField.cpp
parentMerge pull request #129 from nico202/master (diff)
parentMerge branch 'master' into 0.7.0-dev (diff)
downloadnheko-30cb7c5b02bb8a21a8d7257cfe5a8bd3db891606.tar.xz
Merge pull request #130 from Nheko-Reborn/0.7.0-dev
0.7.0 dev merge to master
Diffstat (limited to 'src/ui/TextField.cpp')
-rw-r--r--src/ui/TextField.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/src/ui/TextField.cpp b/src/ui/TextField.cpp

index c4582085..4bb7596a 100644 --- a/src/ui/TextField.cpp +++ b/src/ui/TextField.cpp
@@ -1,6 +1,6 @@ #include "TextField.h" -#include <QApplication> +#include <QCoreApplication> #include <QEventTransition> #include <QFontDatabase> #include <QPaintEvent> @@ -16,7 +16,7 @@ TextField::TextField(QWidget *parent) QPalette pal; state_machine_ = new TextFieldStateMachine(this); - label_ = 0; + label_ = nullptr; label_font_size_ = 15; show_label_ = false; background_color_ = pal.color(QPalette::Window); @@ -103,23 +103,6 @@ TextField::label() const } void -TextField::setTextColor(const QColor &color) -{ - text_color_ = color; - setStyleSheet(QString("QLineEdit { color: %1; }").arg(color.name())); -} - -QColor -TextField::textColor() const -{ - if (!text_color_.isValid()) { - return QPalette().color(QPalette::Text); - } - - return text_color_; -} - -void TextField::setLabelColor(const QColor &color) { label_color_ = color; @@ -230,9 +213,9 @@ TextFieldStateMachine::TextFieldStateMachine(TextField *parent) normal_state_ = new QState; focused_state_ = new QState; - label_ = 0; - offset_anim_ = 0; - color_anim_ = 0; + label_ = nullptr; + offset_anim_ = nullptr; + color_anim_ = nullptr; progress_ = 0.0; addState(normal_state_);