From 81145e509cdba68c94c4173e16ddd492cd813db8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Dec 2017 19:34:40 +0300 Subject: Remove default parameters from textfield. --- src/gui/widgets/chatinput.h | 3 ++- src/gui/widgets/inttextfield.cpp | 3 ++- src/gui/widgets/passwordfield.cpp | 6 +++--- src/gui/widgets/setupitem.cpp | 3 ++- src/gui/widgets/tabs/setup_colors.cpp | 12 ++++++++---- src/gui/widgets/textfield.h | 14 ++++++-------- 6 files changed, 23 insertions(+), 18 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/chatinput.h b/src/gui/widgets/chatinput.h index 92c7dc341..286589ade 100644 --- a/src/gui/widgets/chatinput.h +++ b/src/gui/widgets/chatinput.h @@ -40,7 +40,8 @@ class ChatInput final : public TextField { public: explicit ChatInput(ChatWindow *const window) : - TextField(window, "", LoseFocusOnTab_false), + TextField(window, std::string(), + LoseFocusOnTab_false, nullptr, std::string(), false), mWindow(window), mFocusGaining(false) { diff --git a/src/gui/widgets/inttextfield.cpp b/src/gui/widgets/inttextfield.cpp index 41436d310..d67520c2b 100644 --- a/src/gui/widgets/inttextfield.cpp +++ b/src/gui/widgets/inttextfield.cpp @@ -38,7 +38,8 @@ IntTextField::IntTextField(const Widget2 *const widget, const int max, const Enable enabled, const int width) : - TextField(widget, toString(def)), + TextField(widget, toString(def), + LoseFocusOnTab_true, nullptr, std::string(), false), mMin(0), mMax(0), mDefault(def), diff --git a/src/gui/widgets/passwordfield.cpp b/src/gui/widgets/passwordfield.cpp index bc2ca4827..faa5bb876 100644 --- a/src/gui/widgets/passwordfield.cpp +++ b/src/gui/widgets/passwordfield.cpp @@ -28,10 +28,10 @@ PasswordField::PasswordField(const Widget2 *const widget, const std::string &text) : - TextField(widget, text), + TextField(widget, text, + LoseFocusOnTab_true, nullptr, std::string(), false), mPasswordChar(mSkin != nullptr ? CAST_8( - mSkin->getOption("passwordChar", 42)) - : CAST_8(42)) + mSkin->getOption("passwordChar", 42)) : CAST_8(42)) { } diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 9a2bb663f..06f895f83 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -371,7 +371,8 @@ void SetupItemTextField::createControls() mValue, LoseFocusOnTab_true, mParent, - mEventName); + mEventName, + false); // TRANSLATORS: setup item button mButton = new Button(this, _("Edit"), mEventName + "_EDIT", mParent); mWidget = mTextField; diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index cdbda9415..d15fdc1b1 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -68,19 +68,23 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) : // TRANSLATORS: colors tab. label. mGradDelayLabel(new Label(this, _("Delay:"))), mGradDelaySlider(new Slider(this, 20.0, 100.0, 1.0)), - mGradDelayText(new TextField(this)), + mGradDelayText(new TextField(this, std::string(), LoseFocusOnTab_true, + nullptr, std::string(), false)), // TRANSLATORS: colors tab. label. mRedLabel(new Label(this, _("Red:"))), mRedSlider(new Slider(this, 0.0, 255.0, 1.0)), - mRedText(new TextField(this)), + mRedText(new TextField(this, std::string(), LoseFocusOnTab_true, + nullptr, std::string(), false)), // TRANSLATORS: colors tab. label. mGreenLabel(new Label(this, _("Green:"))), mGreenSlider(new Slider(this, 0.0, 255.0, 1.0)), - mGreenText(new TextField(this)), + mGreenText(new TextField(this, std::string(), LoseFocusOnTab_true, + nullptr, std::string(), false)), // TRANSLATORS: colors tab. label. mBlueLabel(new Label(this, _("Blue:"))), mBlueSlider(new Slider(this, 0.0, 255.0, 1.0)), - mBlueText(new TextField(this)) + mBlueText(new TextField(this, std::string(), LoseFocusOnTab_true, + nullptr, std::string(), false)) { // TRANSLATORS: settings colors tab name setName(_("Colors")); diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 8001008a1..73ce0c525 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -94,14 +94,12 @@ class TextField notfinal : public Widget, /** * Constructor, initializes the text field with the given string. */ - explicit TextField(const Widget2 *restrict const widget, - const std::string &restrict text = "", - const LoseFocusOnTab loseFocusOnTab = - LoseFocusOnTab_true, - ActionListener *restrict - const listener = nullptr, - const std::string &restrict eventId = "", - const bool sendAlwaysEvents = false); + TextField(const Widget2 *restrict const widget, + const std::string &restrict text, + const LoseFocusOnTab loseFocusOnTab, + ActionListener *restrict const listener, + const std::string &restrict eventId, + const bool sendAlwaysEvents); A_DELETE_COPY(TextField) -- cgit v1.2.3-70-g09d2