ButtonsPanel::ButtonsPanel(QWidget *parent) : QWidget(parent) { TImageButton *editButton = new TImageButton(QPixmap(kAppProp->themeDir() + "/" + "icons/tweening.png"), 22); editButton->setToolTip(tr("Edit Tween")); connect(editButton, SIGNAL(clicked()), this, SIGNAL(clickedEditTween())); TImageButton *removeButton = new TImageButton(QPixmap(kAppProp->themeDir() + "/" + "icons/minus_sign.png"), 22); removeButton->setToolTip(tr("Remove Tween")); connect(removeButton, SIGNAL(clicked()), this, SIGNAL(clickedRemoveTween())); QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); layout->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); QHBoxLayout *controlLayout = new QHBoxLayout; controlLayout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); controlLayout->setMargin(1); controlLayout->setSpacing(5); controlLayout->addWidget(editButton); controlLayout->addWidget(removeButton); layout->addLayout(controlLayout); }
TupCanvas::TupCanvas(QWidget *parent, Qt::WindowFlags flags, TupGraphicsScene *scene, const QPointF centerPoint, const QSize &screenSize, TupProject *project, double scaleFactor, int angle, TupBrushManager *brushManager) : QFrame(parent, flags), k(new Private) { setWindowTitle(tr("Tupi: 2D Magic")); setWindowIcon(QIcon(QPixmap(THEME_DIR + "icons/animation_mode.png"))); k->scene = scene; k->size = project->dimension(); k->currentColor = brushManager->penColor(); k->brushManager = brushManager; k->project = project; graphicsView = new TupCanvasView(this, screenSize, k->size, project->bgColor()); graphicsView->setScene(scene); graphicsView->centerOn(centerPoint); graphicsView->scale(scaleFactor, scaleFactor); graphicsView->rotate(angle); TImageButton *pencil = new TImageButton(QPixmap(THEME_DIR + "icons/pencil_big.png"), 40, this, true); pencil->setToolTip(tr("Pencil")); connect(pencil, SIGNAL(clicked()), this, SLOT(wakeUpPencil())); TImageButton *ink = new TImageButton(QPixmap(THEME_DIR + "icons/ink_big.png"), 40, this, true); ink->setToolTip(tr("Ink")); connect(ink, SIGNAL(clicked()), this, SLOT(wakeUpInk())); /* TImageButton *polyline = new TImageButton(QPixmap(THEME_DIR + "icons/polyline_big.png"), 40, this, true); polyline->setToolTip(tr("Polyline")); connect(polyline, SIGNAL(clicked()), this, SLOT(wakeUpPolyline())); */ TImageButton *ellipse = new TImageButton(QPixmap(THEME_DIR + "icons/ellipse_big.png"), 40, this, true); ellipse->setToolTip(tr("Ellipse")); connect(ellipse, SIGNAL(clicked()), this, SLOT(wakeUpEllipse())); TImageButton *rectangle = new TImageButton(QPixmap(THEME_DIR + "icons/square_big.png"), 40, this, true); rectangle->setToolTip(tr("Rectangle")); connect(rectangle, SIGNAL(clicked()), this, SLOT(wakeUpRectangle())); TImageButton *images = new TImageButton(QPixmap(THEME_DIR + "icons/bitmap_big.png"), 40, this, true); images->setToolTip(tr("Images")); connect(images, SIGNAL(clicked()), this, SLOT(wakeUpLibrary())); TImageButton *objects = new TImageButton(QPixmap(THEME_DIR + "icons/selection_big.png"), 40, this, true); objects->setToolTip(tr("Object Selection")); connect(objects, SIGNAL(clicked()), this, SLOT(wakeUpObjectSelection())); TImageButton *nodes = new TImageButton(QPixmap(THEME_DIR + "icons/nodes_big.png"), 40, this, true); nodes->setToolTip(tr("Line Selection")); connect(nodes, SIGNAL(clicked()), this, SLOT(wakeUpNodeSelection())); TImageButton *trash = new TImageButton(QPixmap(THEME_DIR + "icons/delete_big.png"), 40, this, true); trash->setToolTip(tr("Delete Selection")); connect(trash, SIGNAL(clicked()), this, SLOT(wakeUpDeleteSelection())); TImageButton *zoomIn = new TImageButton(QPixmap(THEME_DIR + "icons/zoom_in_big.png"), 40, this, true); zoomIn->setToolTip(tr("Zoom In")); connect(zoomIn, SIGNAL(clicked()), this, SLOT(wakeUpZoomIn())); TImageButton *zoomOut = new TImageButton(QPixmap(THEME_DIR + "icons/zoom_out_big.png"), 40, this, true); zoomOut->setToolTip(tr("Zoom Out")); connect(zoomOut, SIGNAL(clicked()), this, SLOT(wakeUpZoomOut())); TImageButton *hand = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 40, this, true); hand->setToolTip(tr("Hand")); connect(hand, SIGNAL(clicked()), this, SLOT(wakeUpHand())); TImageButton *undo = new TImageButton(QPixmap(THEME_DIR + "icons/undo_big.png"), 40, this, true); undo->setToolTip(tr("Undo")); connect(undo, SIGNAL(clicked()), this, SLOT(undo())); TImageButton *redo = new TImageButton(QPixmap(THEME_DIR + "icons/redo_big.png"), 40, this, true); redo->setToolTip(tr("Redo")); connect(redo, SIGNAL(clicked()), this, SLOT(redo())); TImageButton *colors = new TImageButton(QPixmap(THEME_DIR + "icons/color_palette_big.png"), 40, this, true); colors->setToolTip(tr("Color Palette")); connect(colors, SIGNAL(clicked()), this, SLOT(colorDialog())); TImageButton *pen = new TImageButton(QPixmap(THEME_DIR + "icons/pen_properties.png"), 40, this, true); pen->setToolTip(tr("Pen Size")); connect(pen, SIGNAL(clicked()), this, SLOT(penDialog())); TImageButton *exposure = new TImageButton(QPixmap(THEME_DIR + "icons/exposure_sheet_big.png"), 40, this, true); exposure->setToolTip(tr("Exposure Sheet")); connect(exposure, SIGNAL(clicked()), this, SLOT(exposureDialog())); QBoxLayout *controls = new QBoxLayout(QBoxLayout::TopToBottom); controls->setAlignment(Qt::AlignHCenter | Qt::AlignTop); controls->setContentsMargins(3, 3, 3, 3); controls->setSpacing(7); controls->addWidget(pencil); controls->addWidget(ink); // controls->addWidget(polyline); controls->addWidget(ellipse); controls->addWidget(rectangle); controls->addWidget(images); controls->addWidget(objects); controls->addWidget(nodes); controls->addWidget(trash); controls->addWidget(zoomIn); controls->addWidget(zoomOut); controls->addWidget(hand); controls->addWidget(undo); controls->addWidget(redo); controls->addWidget(colors); controls->addWidget(pen); controls->addWidget(exposure); QHBoxLayout *layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(2); layout->addLayout(controls); layout->addWidget(graphicsView); setLayout(layout); }
void Settings::setInnerForm() { k->innerPanel = new QWidget; QBoxLayout *innerLayout = new QBoxLayout(QBoxLayout::TopToBottom, k->innerPanel); innerLayout->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); QLabel *nameLabel = new QLabel(tr("Editing") + ": "); k->lipSyncName = new QLabel; QHBoxLayout *nameLayout = new QHBoxLayout; nameLayout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); nameLayout->setMargin(0); nameLayout->setSpacing(0); nameLayout->addWidget(nameLabel); nameLayout->addWidget(k->lipSyncName); k->fpsLabel = new QLabel; QHBoxLayout *fpsLayout = new QHBoxLayout; fpsLayout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); fpsLayout->setMargin(0); fpsLayout->setSpacing(0); fpsLayout->addWidget(k->fpsLabel); QLabel *startingLabel = new QLabel(tr("Starting at frame") + ": "); startingLabel->setAlignment(Qt::AlignVCenter); k->comboInit = new QSpinBox(); k->comboInit->setEnabled(false); k->comboInit->setMinimum(1); k->comboInit->setMaximum(999); connect(k->comboInit, SIGNAL(valueChanged(int)), this, SLOT(updateInitFrame(int))); k->endingLabel = new QLabel; k->endingLabel->setAlignment(Qt::AlignVCenter); QHBoxLayout *startLayout = new QHBoxLayout; startLayout->setAlignment(Qt::AlignHCenter); startLayout->setMargin(0); startLayout->setSpacing(0); startLayout->addWidget(startingLabel); startLayout->addWidget(k->comboInit); QHBoxLayout *endLayout = new QHBoxLayout; endLayout->setAlignment(Qt::AlignHCenter); endLayout->setMargin(0); endLayout->setSpacing(0); endLayout->addWidget(k->endingLabel); k->totalLabel = new QLabel; k->totalLabel->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); QHBoxLayout *totalLayout = new QHBoxLayout; totalLayout->setAlignment(Qt::AlignHCenter); totalLayout->setMargin(0); totalLayout->setSpacing(0); totalLayout->addWidget(k->totalLabel); QBoxLayout *listLayout = new QBoxLayout(QBoxLayout::TopToBottom); listLayout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); QLabel *mouthsLabel = new QLabel(tr("Mouths") + ": "); mouthsLabel->setAlignment(Qt::AlignHCenter); k->mouthsList = new QListWidget; k->mouthsList->setContextMenuPolicy(Qt::CustomContextMenu); k->mouthsList->setViewMode(QListView::ListMode); k->mouthsList->setFlow(QListView::TopToBottom); k->mouthsList->setMovement(QListView::Static); k->mouthsList->setFixedHeight(68); listLayout->addWidget(mouthsLabel); listLayout->addWidget(k->mouthsList); QLabel *textLabel = new QLabel(tr("Text") + ": "); textLabel->setAlignment(Qt::AlignHCenter); k->textArea = new QTextEdit; k->textArea->setReadOnly(true); // k->phonemeLabel = new QLabel(tr("Current Phoneme") + ": " + k->phoneme); k->phonemeLabel = new QLabel; k->phonemeLabel->setAlignment(Qt::AlignHCenter); QLabel *mouthPosLabel = new QLabel(tr("Current Mouth Position") + ": "); mouthPosLabel->setAlignment(Qt::AlignHCenter); QLabel *xLabel = new QLabel(tr("X") + ": "); xLabel->setMaximumWidth(20); k->xPosField = new QSpinBox; k->xPosField->setMinimum(-5000); k->xPosField->setMaximum(5000); connect(k->xPosField, SIGNAL(valueChanged(int)), this, SIGNAL(xPosChanged(int))); QLabel *yLabel = new QLabel(tr("Y") + ": "); yLabel->setMaximumWidth(20); k->yPosField = new QSpinBox; k->yPosField->setMinimum(-5000); k->yPosField->setMaximum(5000); connect(k->yPosField, SIGNAL(valueChanged(int)), this, SIGNAL(yPosChanged(int))); QBoxLayout *xLayout = new QBoxLayout(QBoxLayout::LeftToRight); xLayout->setMargin(0); xLayout->setSpacing(0); xLayout->addWidget(xLabel); xLayout->addWidget(k->xPosField); QBoxLayout *yLayout = new QBoxLayout(QBoxLayout::LeftToRight); yLayout->setMargin(0); yLayout->setSpacing(0); yLayout->addWidget(yLabel); yLayout->addWidget(k->yPosField); TImageButton *remove = new TImageButton(QPixmap(kAppProp->themeDir() + "icons/close_properties.png"), 22); remove->setToolTip(tr("Close properties")); connect(remove, SIGNAL(clicked()), this, SIGNAL(closeLipSyncProperties())); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); buttonsLayout->setMargin(0); buttonsLayout->setSpacing(10); buttonsLayout->addWidget(remove); innerLayout->addLayout(nameLayout); innerLayout->addLayout(fpsLayout); innerLayout->addLayout(startLayout); innerLayout->addLayout(endLayout); innerLayout->addLayout(totalLayout); innerLayout->addLayout(listLayout); innerLayout->addWidget(textLabel); innerLayout->addWidget(k->textArea); innerLayout->addWidget(k->phonemeLabel); innerLayout->addWidget(mouthPosLabel); innerLayout->addLayout(xLayout); innerLayout->addLayout(yLayout); innerLayout->addSpacing(10); innerLayout->addLayout(buttonsLayout); innerLayout->addSpacing(5); k->layout->addWidget(k->innerPanel); }