txtcord/mainwindow.cpp

36 lines
998 B
C++
Raw Normal View History

2024-08-14 13:48:27 -04:00
#include "mainwindow.h"
#include <QApplication>
2024-08-14 14:54:24 -04:00
#include <QHBoxLayout>
2024-08-14 13:48:27 -04:00
#include <QVBoxLayout>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QWidget *centralWidget = new QWidget(this);
m_layout = new QVBoxLayout(centralWidget);
setCentralWidget(centralWidget);
2024-08-14 14:54:24 -04:00
// init chatlog
m_chatlog = new QTextEdit();
m_chatlog->setReadOnly(true);
m_chatlog->append("<b style=\"color:#00FFE5;\">Welcome to txtcord, the minimal Discord client.");
m_layout->addWidget(m_chatlog);
// init chatbox
QWidget *chatboxWidget = new QWidget();
QHBoxLayout *chatboxLayout = new QHBoxLayout();
m_box = new QLineEdit();
m_box->setPlaceholderText("Message (or /command)");
chatboxLayout->addWidget(m_box);
m_send = new QPushButton();
m_send->setText("Send");
chatboxLayout->addWidget(m_send);
chatboxWidget->setLayout(chatboxLayout);
m_layout->addWidget(chatboxWidget);
// init chatlog
2024-08-14 13:48:27 -04:00
}
MainWindow::~MainWindow() {
}