2017-10-25 07:20:47 +02:00
|
|
|
// For license of this file, see <project-root-folder>/LICENSE.md.
|
2017-07-21 06:53:23 +02:00
|
|
|
|
2021-04-14 11:00:25 +02:00
|
|
|
#include "gui/reusable/lineeditwithstatus.h"
|
2017-07-21 06:53:23 +02:00
|
|
|
|
2021-04-14 11:00:25 +02:00
|
|
|
#include "gui/reusable/baselineedit.h"
|
|
|
|
#include "gui/reusable/plaintoolbutton.h"
|
2017-07-21 06:53:23 +02:00
|
|
|
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
2024-03-19 10:31:49 +01:00
|
|
|
LineEditWithStatus::LineEditWithStatus(QWidget* parent) : WidgetWithStatus(parent) {
|
2017-09-19 10:18:21 +02:00
|
|
|
m_wdgInput = new BaseLineEdit(this);
|
|
|
|
setFocusProxy(m_wdgInput);
|
|
|
|
|
|
|
|
// Set correct size for the tool button.
|
|
|
|
const int txt_input_height = m_wdgInput->sizeHint().height();
|
2017-07-21 06:53:23 +02:00
|
|
|
|
2017-09-19 10:18:21 +02:00
|
|
|
m_btnStatus->setFixedSize(txt_input_height, txt_input_height);
|
|
|
|
|
|
|
|
// Compose the layout.
|
|
|
|
m_layout->addWidget(m_wdgInput);
|
|
|
|
m_layout->addWidget(m_btnStatus);
|
2017-07-21 06:53:23 +02:00
|
|
|
}
|
2021-02-04 09:15:41 +01:00
|
|
|
|
2024-03-19 10:31:49 +01:00
|
|
|
TextEditWithStatus::TextEditWithStatus(QWidget* parent) : WidgetWithStatus(parent) {
|
2021-02-04 09:15:41 +01:00
|
|
|
m_wdgInput = new QPlainTextEdit(this);
|
|
|
|
setFocusProxy(m_wdgInput);
|
|
|
|
|
|
|
|
// Set correct size for the tool button.
|
|
|
|
const int txt_input_height = QLineEdit().sizeHint().height();
|
|
|
|
|
|
|
|
m_btnStatus->setFixedSize(txt_input_height, txt_input_height);
|
|
|
|
|
|
|
|
// Compose the layout.
|
|
|
|
m_layout->addWidget(m_wdgInput);
|
|
|
|
m_layout->addWidget(m_btnStatus);
|
|
|
|
}
|