| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #include "gui/reusable/lineeditwithstatus.h" |
| 4 | |
| 5 | #include "gui/reusable/baselineedit.h" |
| 6 | #include "gui/reusable/plaintoolbutton.h" |
| 7 | |
| 8 | #include <QHBoxLayout> |
| 9 | |
| 10 | LineEditWithStatus::LineEditWithStatus(QWidget* parent) : WidgetWithStatus(parent) { |
| 11 | m_wdgInput = new BaseLineEdit(this); |
| 12 | setFocusProxy(m_wdgInput); |
| 13 | |
| 14 | // Set correct size for the tool button. |
| 15 | const int txt_input_height = m_wdgInput->sizeHint().height(); |
| 16 | |
| 17 | m_btnStatus->setFixedSize(txt_input_height, txt_input_height); |
| 18 | |
| 19 | // Compose the layout. |
| 20 | m_layout->addWidget(m_wdgInput); |
| 21 | m_layout->addWidget(m_btnStatus); |
| 22 | } |
| 23 | |
| 24 | TextEditWithStatus::TextEditWithStatus(QWidget* parent) : WidgetWithStatus(parent) { |
| 25 | m_wdgInput = new QPlainTextEdit(this); |
| 26 | setFocusProxy(m_wdgInput); |
| 27 | |
| 28 | // Set correct size for the tool button. |
| 29 | const int txt_input_height = QLineEdit().sizeHint().height(); |
| 30 | |
| 31 | m_btnStatus->setFixedSize(txt_input_height, txt_input_height); |
| 32 | |
| 33 | // Compose the layout. |
| 34 | m_layout->addWidget(m_wdgInput); |
| 35 | m_layout->addWidget(m_btnStatus); |
| 36 | } |