Skip to content

Commit

Permalink
GUI: Panel preview text code
Browse files Browse the repository at this point in the history
  • Loading branch information
fdde authored and DrMcCoy committed Dec 29, 2017
1 parent f9edcf1 commit 26b891e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 55 deletions.
17 changes: 11 additions & 6 deletions src/gui/panelpreviewtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ namespace GUI {

W_OBJECT_IMPL(PanelPreviewText)

PanelPreviewText::PanelPreviewText(QWidget *UNUSED(parent))
{
_ui.setupUi(this);
PanelPreviewText::PanelPreviewText(QWidget *UNUSED(parent)) {
_layoutHorizontal = new QHBoxLayout(this);

_textEdit = new QTextEdit();

_textEdit->setFrameShape(QFrame::NoFrame);

_layoutHorizontal->addWidget(_textEdit);
_layoutHorizontal->setContentsMargins(0, 0, 0, 0);
}

void PanelPreviewText::setText(const QString &text)
{
_ui.textEdit->setText(text);
void PanelPreviewText::setText(const QString &text) {
_textEdit->setText(text);
}

void PanelPreviewText::setItem(const ResourceTreeItem *item) {
Expand Down
9 changes: 4 additions & 5 deletions src/gui/panelpreviewtext.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@

#include "verdigris/wobjectdefs.h"

#include "ui/ui_previewtext.h"

namespace GUI {

class ResourceTreeItem;

class PanelPreviewText : public QFrame
{
class PanelPreviewText : public QFrame {
W_OBJECT(PanelPreviewText)

private:
QHBoxLayout *_layoutHorizontal;
QTextEdit *_textEdit;

const ResourceTreeItem *_currentItem;
Ui::PreviewText _ui;

public:
PanelPreviewText(QWidget *parent = 0);
Expand Down
1 change: 0 additions & 1 deletion src/gui/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ noinst_LTLIBRARIES += src/gui/libgui.la
QT_UI_FORMS_BUILT = \
ui/ui_mainwindow.h \
ui/ui_resourceinfo.h \
ui/ui_previewtext.h \
$(EMPTY)

BUILT_SOURCES += $(QT_UI_FORMS_BUILT)
Expand Down
43 changes: 0 additions & 43 deletions ui/previewtext.ui

This file was deleted.

0 comments on commit 26b891e

Please sign in to comment.