diff options
author | Stijn Buys <ingar@osirion.org> | 2012-03-11 10:25:06 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-03-11 10:25:06 +0000 |
commit | f46146993b50ca5afc802288deeb5bd72a176d9a (patch) | |
tree | 6b1cde69c854c18ec885562bd97f6c5908cdc0ad | |
parent | 7c17b396474fc3783664dbd4da86548389825ea3 (diff) |
Added zone properties button.
-rw-r--r-- | src/editorwindow.cc | 6 | ||||
-rw-r--r-- | src/editorwindow.h | 5 | ||||
-rw-r--r-- | src/sidebar.cc | 18 | ||||
-rw-r--r-- | 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 <QComboBox> #include <QLabel> #include <QLineEdit> +#include <QPushButton> #include <QTextEdit> #include <QVBoxLayout> #include <QSplitter> @@ -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 <QWidget> +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; |