started reworking evidence description
This commit is contained in:
parent
3f97df6174
commit
48f0440872
@ -45,7 +45,8 @@ SOURCES += main.cpp\
|
||||
aoevidencebutton.cpp \
|
||||
charselect.cpp \
|
||||
aotextarea.cpp \
|
||||
aolineedit.cpp
|
||||
aolineedit.cpp \
|
||||
aotextedit.cpp
|
||||
|
||||
HEADERS += lobby.h \
|
||||
aoimage.h \
|
||||
@ -72,7 +73,8 @@ HEADERS += lobby.h \
|
||||
aoblipplayer.h \
|
||||
aoevidencebutton.h \
|
||||
aotextarea.h \
|
||||
aolineedit.h
|
||||
aolineedit.h \
|
||||
aotextedit.h
|
||||
|
||||
unix:LIBS += -L$$PWD -lbass
|
||||
win32:LIBS += "$$PWD/bass.dll"
|
||||
|
21
aotextedit.cpp
Normal file
21
aotextedit.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include "aotextedit.h"
|
||||
|
||||
AOTextEdit::AOTextEdit(QWidget *parent) : QPlainTextEdit(parent)
|
||||
{
|
||||
this->setReadOnly(true);
|
||||
|
||||
connect(this, SIGNAL(returnPressed()), this, SLOT(on_enter_pressed()));
|
||||
}
|
||||
|
||||
void AOTextEdit::mouseDoubleClickEvent(QMouseEvent *e)
|
||||
{
|
||||
QPlainTextEdit::mouseDoubleClickEvent(e);
|
||||
|
||||
this->setReadOnly(false);
|
||||
}
|
||||
|
||||
void AOTextEdit::on_enter_pressed()
|
||||
{
|
||||
this->setReadOnly(true);
|
||||
}
|
||||
|
23
aotextedit.h
Normal file
23
aotextedit.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef AOTEXTEDIT_H
|
||||
#define AOTEXTEDIT_H
|
||||
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
class AOTextEdit : public QPlainTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AOTextEdit(QWidget *parent);
|
||||
|
||||
protected:
|
||||
void mouseDoubleClickEvent(QMouseEvent *e);
|
||||
|
||||
signals:
|
||||
void double_clicked();
|
||||
|
||||
private slots:
|
||||
void on_enter_pressed();
|
||||
|
||||
};
|
||||
|
||||
#endif // AOTEXTEDIT_H
|
@ -15,6 +15,7 @@
|
||||
#include "aoevidencebutton.h"
|
||||
#include "aotextarea.h"
|
||||
#include "aolineedit.h"
|
||||
#include "aotextedit.h"
|
||||
#include "datatypes.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
@ -303,7 +304,7 @@ private:
|
||||
AOButton *ui_evidence_right;
|
||||
AOImage *ui_evidence_overlay;
|
||||
AOButton *ui_evidence_x;
|
||||
QPlainTextEdit *ui_evidence_description;
|
||||
AOTextEdit *ui_evidence_description;
|
||||
|
||||
AOImage *ui_char_select_background;
|
||||
|
||||
|
@ -23,8 +23,7 @@ void Courtroom::construct_evidence()
|
||||
ui_evidence_x = new AOButton(ui_evidence_overlay, ao_app);
|
||||
ui_evidence_x->setText("X");
|
||||
|
||||
ui_evidence_description = new QPlainTextEdit(ui_evidence_overlay);
|
||||
ui_evidence_description->setReadOnly(true);
|
||||
ui_evidence_description = new AOTextEdit(ui_evidence_overlay);
|
||||
ui_evidence_description->setStyleSheet("background-color: rgba(0, 0, 0, 0);"
|
||||
"color: white;");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user