From f46146993b50ca5afc802288deeb5bd72a176d9a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 11 Mar 2012 10:25:06 +0000 Subject: Added zone properties button. --- src/editorwindow.cc | 6 ++++++ src/editorwindow.h | 5 +++++ src/sidebar.cc | 18 ++++++++++++++++-- src/sidebar.h | 9 ++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/editorwindow.cc b/src/editorwindow.cc index 37d4f69..fc183c6 100644 --- a/src/editorwindow.cc +++ b/src/editorwindow.cc @@ -32,6 +32,7 @@ EditorWindow::EditorWindow(QWidget *parent) : QWidget(parent) connect(editorwindow_mapwidget, SIGNAL(propertiesChanged(EntityProperties *)), editorwindow_sidebar, SLOT(setProperties(EntityProperties *))); connect(editorwindow_sidebar, SIGNAL(entityChanged()), editorwindow_mapwidget, SLOT(resizeChildren())); + connect(editorwindow_sidebar, SIGNAL(zonePropertiesClicked()), this, SLOT(showZoneProperties())); } QSize EditorWindow::sizeHint () const @@ -251,4 +252,9 @@ void EditorWindow::deleteSelected() editorwindow_mapwidget->deleteSelected(); } +void EditorWindow::showZoneProperties() +{ + QMessageBox::information(this, tr("Zone properties"), tr("Not yet iplemented")); +} + } diff --git a/src/editorwindow.h b/src/editorwindow.h index 12aec59..3916292 100644 --- a/src/editorwindow.h +++ b/src/editorwindow.h @@ -59,6 +59,11 @@ public slots: * */ void duplicateSelected(); + /** + * @brief open the zone properties window + * */ + void showZoneProperties(); + protected: virtual void resizeEvent (QResizeEvent *event); diff --git a/src/sidebar.cc b/src/sidebar.cc index 9299f40..3093fc1 100644 --- a/src/sidebar.cc +++ b/src/sidebar.cc @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -23,13 +24,22 @@ SideBar::SideBar(QWidget *parent) : QWidget(parent) // global vertical layout QVBoxLayout *box_global = new QVBoxLayout(); - // zone name + // zone name and properties button + QHBoxLayout *box_zone = new QHBoxLayout(); + label_zone = new QLabel(tr("Zone Name")); label_zone->setAlignment(Qt::AlignHCenter); - box_global->addWidget(label_zone); + button_zone = new QPushButton(tr("...")); + + box_zone->addWidget(label_zone, 1); + box_zone->addWidget(button_zone); + + box_global->addLayout(box_zone); box_global->addSpacing(16); + connect(button_zone, SIGNAL(clicked()), this, SLOT(zonePropertiesButtonClicked())); + // entity type QHBoxLayout *box_entitytype = new QHBoxLayout(); QLabel *label_entitytype = new QLabel(tr("type")); @@ -194,6 +204,10 @@ SideBar::SideBar(QWidget *parent) : QWidget(parent) setProperties(0); } +void SideBar::zonePropertiesButtonClicked() +{ + emit(zonePropertiesClicked()); +} void SideBar::updateEntityType(const QString &value) { diff --git a/src/sidebar.h b/src/sidebar.h index 5448482..34a4d78 100644 --- a/src/sidebar.h +++ b/src/sidebar.h @@ -12,10 +12,11 @@ #include +class QComboBox; class QLabel; class QLineEdit; +class QPushButton; class QTextEdit; -class QComboBox; namespace editor { @@ -77,12 +78,18 @@ private slots: void updateEntitySubSections(); void updateEntityInfo(); + + void zonePropertiesButtonClicked(); signals: void entityChanged(); + void zonePropertiesClicked(); + private: QLabel *label_zone; + QPushButton *button_zone; + QComboBox *combo_entitytype; QLineEdit *edit_entitylabel; QLineEdit *edit_entityname; -- cgit v1.2.3