diff options
Diffstat (limited to 'Swift/QtUI/QtHistoryWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp new file mode 100644 index 0000000..a54fa03 --- /dev/null +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2012 Catalin Badea + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#include "QtHistoryWindow.h" +#include "QtTabbable.h" + +#include <QCloseEvent> +#include <QTextEdit> +#include <QVBoxLayout> +#include <QPushButton> +#include <QScrollBar> +#include <QCheckBox> + +#include "QtSwiftUtil.h" +#include <string> + +namespace Swift { + +QtHistoryWindow::QtHistoryWindow() { + QVBoxLayout* layout = new QVBoxLayout(this); + layout->setSpacing(0); + layout->setContentsMargins(0,0,0,0); + + QWidget* bottom = new QWidget(this); + layout->addWidget(bottom); + bottom->setAutoFillBackground(true); + + QHBoxLayout* buttonLayout = new QHBoxLayout(bottom); + buttonLayout->setContentsMargins(10,0,20,0); + buttonLayout->setSpacing(0); + + buttonLayout->addStretch(); + + setWindowTitle(tr("History")); + emit titleUpdated(); +} + +QtHistoryWindow::~QtHistoryWindow() { + // do nothing +} + +void QtHistoryWindow::show() { + QWidget::show(); + emit windowOpening(); +} + +void QtHistoryWindow::activate() { + emit wantsToActivate(); +} + +void QtHistoryWindow::showEvent(QShowEvent* event) { + emit windowOpening(); + emit titleUpdated(); + QWidget::showEvent(event); +} + +void QtHistoryWindow::closeEvent(QCloseEvent* event) { + emit windowClosing(); + event->accept(); +} + +} |