Skip to content

Commit

Permalink
Console
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro-Beirao committed Dec 28, 2021
1 parent c37904c commit 4ad97dc
Show file tree
Hide file tree
Showing 11 changed files with 337 additions and 277 deletions.
25 changes: 25 additions & 0 deletions dsda-launcher/console.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "console.h"
#include "ui_console.h"

Console::Console(QWidget *parent) :
QWidget(parent),
ui(new Ui::Console)
{
ui->setupUi(this);
}

Console::~Console()
{
delete ui;
}

void Console::changeText(std::string s)
{
QString previousText = ui->text->toPlainText();
ui->text->setPlainText(previousText + s.c_str());
}

void Console::clearText()
{
ui->text->setPlainText("");
}
24 changes: 24 additions & 0 deletions dsda-launcher/console.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef CONSOLE_H
#define CONSOLE_H

#include <QWidget>

namespace Ui {
class Console;
}

class Console : public QWidget
{
Q_OBJECT

public:
explicit Console(QWidget *parent = nullptr);
~Console();
Ui::Console *ui;

public slots:
void changeText(std::string s);
void clearText();
};

#endif // CONSOLE_H
47 changes: 47 additions & 0 deletions dsda-launcher/console.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Console</class>
<widget class="QWidget" name="Console">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>437</width>
<height>356</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>437</width>
<height>356</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>437</width>
<height>356</height>
</size>
</property>
<property name="windowTitle">
<string>Console</string>
</property>
<widget class="QPlainTextEdit" name="text">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>441</width>
<height>361</height>
</rect>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="plainText">
<string/>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
3 changes: 3 additions & 0 deletions dsda-launcher/dsda-launcher.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ DEFINES += "APP_NAME=dsda-launcher"
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
console.cpp \
main.cpp \
mainwindow.cpp \
settings.cpp

HEADERS += \
console.h \
mainwindow.h \
settings.h

FORMS += \
console.ui \
mainwindow.ui \
settings.ui

Expand Down
8 changes: 4 additions & 4 deletions dsda-launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(int argc, char *argv[])


if(os=="Linux" || os=="Windows")
{
{/*
// QApplication::setStyle("Fusion");
qApp->setStyle(QStyleFactory::create("Fusion"));
Expand All @@ -42,7 +42,7 @@ int main(int argc, char *argv[])
darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
darkPalette.setColor(QPalette::HighlightedText, Qt::black);
/*
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette newPalette;
Expand All @@ -69,9 +69,9 @@ int main(int argc, char *argv[])
qApp->setPalette(newPalette);
*/

qApp->setPalette(darkPalette);
//qApp->setPalette(darkPalette);

qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }");
//qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }");
}


Expand Down
Loading

0 comments on commit 4ad97dc

Please sign in to comment.