X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flayerwidget.cpp;h=b45eed6a6da6a2f167ed0d2f3f7914331e4b3e3f;hb=a7a9909f617d5dbcebfc6d4baa7053dbe3961751;hp=227225374b30f0e24cb31af833009be4af9293a4;hpb=14fee18e7a8ebfccfc1ebe203fe049f268efb40a;p=architektonas diff --git a/src/layerwidget.cpp b/src/layerwidget.cpp index 2272253..b45eed6 100644 --- a/src/layerwidget.cpp +++ b/src/layerwidget.cpp @@ -12,3 +12,82 @@ // #include "layerwidget.h" +#include "layeritemwidget.h" + + +#if 0 +OK, what it seems like we should do here, is instead of deriving from QDockWidget, +we should derive from QWidget (or QScrollArea or somesuch). Then, when creating +the dockwidget in the main window, we add the LayerWidget as the QDockWidget's +main widget. +#endif + +LayerWidget::LayerWidget(void): QWidget() +{ + + // Make a QScrollArea, put in a QVBoxLayout. + // Use line widget (two checkboxes, one label), use setIcon() on the + // checkboxes to change their look (eye open/closed for visibility, + // lock open/closed for layer lock). + + QIcon visible(":/res/eye-open.png"); + visible.addFile(":/res/eye-closed.png", QSize(16, 16), QIcon::Normal, QIcon::On); + QIcon locked(":/res/lock-open.png"); + locked.addFile(":/res/lock-closed.png", QSize(16, 16), QIcon::Normal, QIcon::On); + + QVBoxLayout * mainLayout = new QVBoxLayout; + QHBoxLayout * line1 = new QHBoxLayout; + QHBoxLayout * line2 = new QHBoxLayout; + +// QCheckBox * box1 = new QCheckBox("bleah"); +// box1->setIcon(visible); +// mainLayout->addWidget(box1); + + QPushButton * button1 = new QPushButton; + button1->setFlat(true); + button1->setIcon(visible); + button1->setCheckable(true); + button1->setMaximumSize(QSize(20, 20)); + QPushButton * button2 = new QPushButton; + button2->setFlat(true); + button2->setIcon(locked); + button2->setCheckable(true); + button2->setMaximumSize(QSize(20, 20)); + QLabel * label1 = new QLabel("Background"); + + QPushButton * button3 = new QPushButton; + button3->setFlat(true); + button3->setIcon(visible); + button3->setCheckable(true); + button3->setMaximumSize(QSize(20, 20)); + QPushButton * button4 = new QPushButton; + button4->setFlat(true); + button4->setIcon(locked); + button4->setCheckable(true); + button4->setMaximumSize(QSize(20, 20)); + QLabel * label2 = new QLabel("Guides"); + + line1->addWidget(button1); + line1->addWidget(button2); + line1->addWidget(label1); + + line2->addWidget(button3); + line2->addWidget(button4); + line2->addWidget(label2); + + LayerItemWidget * liw1 = new LayerItemWidget("Floor #1"); + LayerItemWidget * liw2 = new LayerItemWidget("Mechanical"); + + mainLayout->addLayout(line1); + mainLayout->addLayout(line2); + mainLayout->addWidget(liw1); + mainLayout->addWidget(liw2); + mainLayout->addStretch(); + setLayout(mainLayout); +} + + +LayerWidget::~LayerWidget() +{ +} +