Merge branch 'feature/manual-layout' into 'feature/manual-layout'

Feature manual layout #9

Basic structure of Puzzle (menu, properties and piece carrousel).

See merge request smart-pattern/valentina!1
This commit is contained in:
Roman Telezhynskyi 2020-04-13 11:54:31 +00:00
commit 2f02e7cdc0
37 changed files with 2951 additions and 18 deletions

View File

@ -53,3 +53,6 @@ unix {
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = src SUBDIRS = src
RESOURCES += \
src/app/puzzle/share/resources/puzzleicon.qrc

View File

@ -0,0 +1,141 @@
/************************************************************************
**
** @file dialogaboutpuzzle.cpp
** @author Ronan Le Tiec
** @date 11 4, 2020
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2015 Valentina project
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "dialogaboutpuzzle.h"
#include "ui_dialogaboutpuzzle.h"
#include "../version.h"
#include "../vmisc/def.h"
#include "../fervor/fvupdater.h"
#include <QDate>
#include <QDesktopServices>
#include <QMessageBox>
#include <QShowEvent>
#include <QUrl>
#include <QtDebug>
//---------------------------------------------------------------------------------------------------------------------
DialogAboutPuzzle::DialogAboutPuzzle(QWidget *parent)
:QDialog(parent),
ui(new Ui::DialogAboutPuzzle),
isInitialized(false)
{
ui->setupUi(this);
//mApp->Settings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c());
RetranslateUi();
connect(ui->pushButton_Web_Site, &QPushButton::clicked, this, []()
{
if ( not QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)))
{
qWarning() << tr("Cannot open your default browser");
}
});
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &DialogAboutPuzzle::close);
connect(ui->pushButtonCheckUpdate, &QPushButton::clicked, []()
{
// Set feed URL before doing anything else
FvUpdater::sharedUpdater()->SetFeedURL(FvUpdater::CurrentFeedURL());
FvUpdater::sharedUpdater()->CheckForUpdatesNotSilent();
});
// By default on Windows font point size 8 points we need 11 like on Linux.
FontPointSize(ui->label_Legal_Stuff, 11);
FontPointSize(ui->label_Puzzle_Built, 11);
FontPointSize(ui->label_QT_Version, 11);
}
//---------------------------------------------------------------------------------------------------------------------
DialogAboutPuzzle::~DialogAboutPuzzle()
{
delete ui;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutPuzzle::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
// retranslate designer form (single inheritance approach)
ui->retranslateUi(this);
RetranslateUi();
}
// remember to call base class implementation
QDialog::changeEvent(event);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutPuzzle::showEvent(QShowEvent *event)
{
QDialog::showEvent( event );
if ( event->spontaneous() )
{
return;
}
if (isInitialized)
{
return;
}
// do your init stuff here
setMaximumSize(size());
setMinimumSize(size());
isInitialized = true;//first show windows are held
}
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutPuzzle::FontPointSize(QWidget *w, int pointSize)
{
SCASSERT(w != nullptr)
QFont font = w->font();
font.setPointSize(pointSize);
w->setFont(font);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutPuzzle::RetranslateUi()
{
ui->label_Puzzle_Version->setText(QString("Puzzle %1").arg(APP_VERSION_STR));
ui->labelBuildRevision->setText(tr("Build revision: %1").arg(BUILD_REVISION));
ui->label_QT_Version->setText(buildCompatibilityString());
const QDate date = QLocale::c().toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
ui->label_Puzzle_Built->setText(tr("Built on %1 at %2").arg(date.toString(), __TIME__));
ui->label_Legal_Stuff->setText(QApplication::translate("InternalStrings",
"The program is provided AS IS with NO WARRANTY OF ANY "
"KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY "
"AND FITNESS FOR A PARTICULAR PURPOSE."));
ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
}

View File

@ -0,0 +1,61 @@
/************************************************************************
**
** @file dialogaboutpuzzle.h
** @author Ronan Le Tiec
** @date 11 4, 2020
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2015 Valentina project
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef DIALOGABOUTPUZZLE_H
#define DIALOGABOUTPUZZLE_H
#include <QDialog>
namespace Ui
{
class DialogAboutPuzzle;
}
class DialogAboutPuzzle : public QDialog
{
Q_OBJECT
public:
explicit DialogAboutPuzzle(QWidget *parent = nullptr);
virtual ~DialogAboutPuzzle();
protected:
virtual void changeEvent(QEvent* event) override;
virtual void showEvent(QShowEvent *event) override;
private:
Q_DISABLE_COPY(DialogAboutPuzzle)
Ui::DialogAboutPuzzle *ui;
bool isInitialized;
void FontPointSize(QWidget *w, int pointSize);
void RetranslateUi();
};
#endif // DIALOGABOUTPUZZLE_H

View File

@ -0,0 +1,301 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogAboutPuzzle</class>
<widget class="QDialog" name="DialogAboutPuzzle">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>462</width>
<height>338</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>About Puzzle</string>
</property>
<property name="windowIcon">
<iconset resource="../share/resources/puzzleicon.qrc">
<normaloff>:/puzzleicon/64x64/logo.png</normaloff>:/puzzleicon/64x64/logo.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>16</number>
</property>
<item>
<widget class="QLabel" name="label_appIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../share/resources/puzzleicon.qrc">:/puzzleicon/64x64/logo.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_Puzzle_Version">
<property name="font">
<font>
<pointsize>15</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Puzzle version</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="labelBuildRevision">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Build revision:</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="label">
<property name="text">
<string>This program is part of Valentina project.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_Web_Site">
<property name="palette">
<palette>
<active>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<underline>true</underline>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string notr="true">pushButton_Web_Site</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Puzzle_Built">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">label_Tape_Built</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_QT_Version">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">label_QT_Version</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_Legal_Stuff">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">label_Legal_Stuff</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonCheckUpdate">
<property name="text">
<string>Check For Updates</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../share/resources/puzzleicon.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -4,14 +4,19 @@
SOURCES += \ SOURCES += \
$$PWD/main.cpp \ $$PWD/main.cpp \
$$PWD/puzzlemainwindow.cpp \ $$PWD/puzzlemainwindow.cpp \
$$PWD/puzzleapplication.cpp $$PWD/puzzleapplication.cpp \
$$PWD/dialogs/dialogaboutpuzzle.cpp \
$$PWD/vpiececarrousel.cpp
*msvc*:SOURCES += $$PWD/stable.cpp *msvc*:SOURCES += $$PWD/stable.cpp
HEADERS += \ HEADERS += \
$$PWD/puzzlemainwindow.h \ $$PWD/puzzlemainwindow.h \
$$PWD/stable.h \ $$PWD/stable.h \
$$PWD/puzzleapplication.h $$PWD/puzzleapplication.h \
$$PWD/dialogs/dialogaboutpuzzle.h \
$$PWD/vpiececarrousel.h
FORMS += \ FORMS += \
$$PWD/puzzlemainwindow.ui $$PWD/puzzlemainwindow.ui \
$$PWD/dialogs/dialogaboutpuzzle.ui

View File

@ -27,19 +27,26 @@
*************************************************************************/ *************************************************************************/
#include "puzzlemainwindow.h" #include "puzzlemainwindow.h"
#include "ui_puzzlemainwindow.h" #include "ui_puzzlemainwindow.h"
#include "dialogs/dialogaboutpuzzle.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
PuzzleMainWindow::PuzzleMainWindow(QWidget *parent) : PuzzleMainWindow::PuzzleMainWindow(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::PuzzleMainWindow) ui(new Ui::PuzzleMainWindow),
pieceCarrousel(new VPieceCarrousel)
{ {
ui->setupUi(this); ui->setupUi(this);
InitMenuBar();
InitProperties();
InitPieceCarrousel();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
PuzzleMainWindow::~PuzzleMainWindow() PuzzleMainWindow::~PuzzleMainWindow()
{ {
delete ui; delete ui;
delete pieceCarrousel;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -48,3 +55,508 @@ bool PuzzleMainWindow::LoadFile(const QString &path)
Q_UNUSED(path) Q_UNUSED(path)
return true; return true;
} }
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitMenuBar()
{
// -------------------- connects the actions for the file menu
connect(ui->actionNew, &QAction::triggered, this, &PuzzleMainWindow::New);
connect(ui->actionOpen, &QAction::triggered, this, &PuzzleMainWindow::Open);
connect(ui->actionSave, &QAction::triggered, this, &PuzzleMainWindow::Save);
connect(ui->actionSaveAs, &QAction::triggered, this, &PuzzleMainWindow::SaveAs);
connect(ui->actionImportRawLayout, &QAction::triggered, this, &PuzzleMainWindow::ImportRawLayout);
connect(ui->actionExit, &QAction::triggered, this, &PuzzleMainWindow::close);
// -------------------- connects the actions for the edit menu
// TODO : initialise the undo / redo
// -------------------- connects the actions for the windows menu
// TODO : initialise the entries for the different windows
connect(ui->actionCloseLayout, &QAction::triggered, this, &PuzzleMainWindow::CloseLayout);
// Add dock properties action
QAction* actionDockWidgetToolOptions = ui->dockWidgetProperties->toggleViewAction();
ui->menuWindows->addAction(actionDockWidgetToolOptions);
// connects the action for the Help Menu
connect(ui->actionAboutQt, &QAction::triggered, this, &PuzzleMainWindow::AboutQt);
connect(ui->actionAboutPuzzle, &QAction::triggered, this, &PuzzleMainWindow::AboutPuzzle);
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitProperties()
{
InitPropertyTabCurrentPiece();
InitPropertyTabLayout();
InitPropertyTabLayers();
InitPropertyTabTiles();
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabCurrentPiece()
{
// ------------------------------ seamline ------------------------------------
connect(ui->checkBoxCurrentPieceShowSeamline, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::CurrentPieceShowSeamlineChanged);
// ------------------------------ geometry ------------------------------------
connect(ui->checkBoxCurrentPieceMirrorPiece, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::CurrentPieceMirrorPieceChanged);
// ------------------------------ rotation ------------------------------------
connect(ui->doubleSpinBoxCurrentPieceAngle, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::CurrentPieceAngleChanged);
// ------------------------------ placement -----------------------------------
connect(ui->doubleSpinBoxCurrentPieceBoxPositionX, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::CurrentPiecePositionChanged);
connect(ui->doubleSpinBoxCurrentPieceBoxPositionY, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::CurrentPiecePositionChanged);
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabLayout()
{
// -------------------- init the unit combobox ---------------------
ui->comboBoxLayoutUnit->addItem(tr("Centimeters"), QVariant(UnitsToStr(Unit::Cm)));
ui->comboBoxLayoutUnit->addItem(tr("Millimiters"), QVariant(UnitsToStr(Unit::Mm)));
ui->comboBoxLayoutUnit->addItem(tr("Inches"), QVariant(UnitsToStr(Unit::Inch)));
// set default unit - TODO when we have the setting for the unit
const qint32 indexUnit = -1;//ui->comboBoxLayoutUnit->findData(qApp->ValentinaSettings()->GetUnit());
if (indexUnit != -1)
{
ui->comboBoxLayoutUnit->setCurrentIndex(indexUnit);
}
connect(ui->comboBoxLayoutUnit, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&PuzzleMainWindow::LayoutUnitChanged);
// -------------------- init the template combobox ---------------------
// TODO
connect(ui->comboBoxLayoutTemplate, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&PuzzleMainWindow::LayoutTemplateChanged);
// -------------------- layout width, length, orientation ------------------------
connect(ui->doubleSpinBoxLayoutWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutSizeChanged);
connect(ui->doubleSpinBoxLayoutLength, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutSizeChanged);
connect(ui->radioButtonLayoutPortrait, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutOrientationChanged);
connect(ui->radioButtonLayoutLandscape, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutOrientationChanged);
connect(ui->pushButtonLayoutRemoveUnusedLength, QOverload<bool>::of(&QPushButton::clicked), this,
&PuzzleMainWindow::LayoutRemoveUnusedLength);
// -------------------- margins ------------------------
connect(ui->doubleSpinBoxLayoutMarginTop, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
connect(ui->doubleSpinBoxLayoutMarginRight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
connect(ui->doubleSpinBoxLayoutMarginBottom, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
connect(ui->doubleSpinBoxLayoutMarginLeft, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
// ------------------- follow grainline -----------------------
connect(ui->radioButtonLayoutFollowGrainlineNo, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutFollowGrainlineChanged);
connect(ui->radioButtonLayoutFollowGrainlineVertical, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutFollowGrainlineChanged);
connect(ui->radioButtonLayoutFollowGrainlineHorizontal, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutFollowGrainlineChanged);
// -------------------- pieces gap and checkboxes ---------------
connect(ui->doubleSpinBoxLayoutPiecesGap, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutPiecesGapChanged);
connect(ui->checkBoxLayoutWarningPiecesSuperposition, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::LayoutWarningPiecesSuperpositionChanged);
connect(ui->checkBoxLayoutWarningPiecesOutOfBound, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::LayoutWarningPiecesOutOfBoundChanged);
connect(ui->checkBoxLayoutStickyEdges, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::LayoutStickyEdgesChanged);
// -------------------- export ---------------------------
// TODO init the file format export combobox
connect(ui->pushButtonLayoutExport, QOverload<bool>::of(&QPushButton::clicked), this,
&PuzzleMainWindow::LayoutExport);
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabTiles()
{
// for the MVP we don't want the tiles tab.
// we remove it. As soon as we need it, update this code
ui->tabWidgetProperties->removeTab(2); // remove tiles
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabLayers()
{
// for the MVP we don't want the layers tab.
// we remove it. As soon as we need it, update this code
ui->tabWidgetProperties->removeTab(3); // remove layers
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPieceCarrousel()
{
ui->dockWidgetPieceCarrousel->setWidget(pieceCarrousel);
connect(ui->dockWidgetPieceCarrousel, QOverload<Qt::DockWidgetArea>::of(&QDockWidget::dockLocationChanged), this,
&PuzzleMainWindow::PieceCarrouselLocationChanged);
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::New()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::New");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::Open()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::Open");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::Save()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::Save");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::SaveAs()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::SaveAs");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::ImportRawLayout()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::ImportRawLayout");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CloseLayout()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CloseLayout");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::AboutQt()
{
QMessageBox::aboutQt(this, tr("About Qt"));
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::AboutPuzzle()
{
auto *aboutDialog = new DialogAboutPuzzle(this);
aboutDialog->setAttribute(Qt::WA_DeleteOnClose, true);
aboutDialog->show();
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutUnitChanged(int index)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutUnitChanged");
int ret = msgBox.exec();
Q_UNUSED(index);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutTemplateChanged(int index)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutTemplateChanged");
int ret = msgBox.exec();
Q_UNUSED(index);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutSizeChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutSizeChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutOrientationChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutOrientationChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutRemoveUnusedLength()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutRemoveUnusedLength");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutMarginChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutMarginChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutFollowGrainlineChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutFollowGrainlineChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutPiecesGapChanged(double value)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutPieceGapChanged");
int ret = msgBox.exec();
Q_UNUSED(value);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutWarningPiecesSuperpositionChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutWarningPiecesSuperpositionChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutWarningPiecesOutOfBoundChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutWarningPiecesOutOfBoundChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutStickyEdgesChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutStickyEdgesChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutExport()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutExport");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPieceShowSeamlineChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPieceShowSeamlineChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPieceMirrorPieceChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPieceMirrorPieceChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPieceAngleChanged(double value)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPieceAngleChanged");
int ret = msgBox.exec();
Q_UNUSED(value);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPiecePositionChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPiecePositionChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::PieceCarrouselLocationChanged(Qt::DockWidgetArea area)
{
if(area == Qt::BottomDockWidgetArea || area == Qt::TopDockWidgetArea)
{
pieceCarrousel->setOrientation(Qt::Horizontal);
ui->dockWidgetPieceCarrousel->setMaximumHeight(208);
ui->dockWidgetPieceCarrousel->setMaximumWidth(10000);
}
else if (area == Qt::LeftDockWidgetArea || area == Qt::RightDockWidgetArea)
{
pieceCarrousel->setOrientation(Qt::Vertical);
ui->dockWidgetPieceCarrousel->setMaximumHeight(10000);
ui->dockWidgetPieceCarrousel->setMaximumWidth(160);
}
}

View File

@ -28,7 +28,11 @@
#ifndef PUZZLEMAINWINDOW_H #ifndef PUZZLEMAINWINDOW_H
#define PUZZLEMAINWINDOW_H #define PUZZLEMAINWINDOW_H
#include "../vmisc/def.h"
#include <QMainWindow> #include <QMainWindow>
#include <QMessageBox>
#include "vpiececarrousel.h"
namespace Ui { namespace Ui {
class PuzzleMainWindow; class PuzzleMainWindow;
@ -47,6 +51,47 @@ public:
private: private:
Q_DISABLE_COPY(PuzzleMainWindow) Q_DISABLE_COPY(PuzzleMainWindow)
Ui::PuzzleMainWindow *ui; Ui::PuzzleMainWindow *ui;
VPieceCarrousel *pieceCarrousel;
void InitMenuBar();
void InitProperties();
void InitPropertyTabCurrentPiece();
void InitPropertyTabLayout();
void InitPropertyTabTiles();
void InitPropertyTabLayers();
void InitPieceCarrousel();
private slots:
void New();
void Open();
void Save();
void SaveAs();
void ImportRawLayout();
void CloseLayout();
void AboutQt();
void AboutPuzzle();
void LayoutUnitChanged(int index);
void LayoutTemplateChanged(int index);
void LayoutSizeChanged();
void LayoutOrientationChanged();
void LayoutRemoveUnusedLength();
void LayoutMarginChanged();
void LayoutFollowGrainlineChanged();
void LayoutPiecesGapChanged(double value);
void LayoutWarningPiecesSuperpositionChanged(bool checked);
void LayoutWarningPiecesOutOfBoundChanged(bool checked);
void LayoutStickyEdgesChanged(bool checked);
void LayoutExport();
void CurrentPieceShowSeamlineChanged(bool checked);
void CurrentPieceMirrorPieceChanged(bool checked);
void CurrentPieceAngleChanged(double value);
void CurrentPiecePositionChanged();
void PieceCarrouselLocationChanged(Qt::DockWidgetArea area);
}; };
#endif // PUZZLEMAINWINDOW_H #endif // PUZZLEMAINWINDOW_H

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,13 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>puzzleicon/64x64/logo.png</file> <file>puzzleicon/64x64/logo.png</file>
<file>puzzleicon/64x64/iconLayout.png</file>
<file>puzzleicon/64x64/iconCurrentPiece.png</file>
<file>puzzleicon/64x64/iconLayers.png</file>
<file>puzzleicon/64x64/iconTiles.png</file>
<file>puzzleicon/64x64/iconLandscape.png</file>
<file>puzzleicon/64x64/iconPortrait.png</file>
<file>puzzleicon/64x64/iconGrainlineVertical.png</file>
<file>puzzleicon/64x64/iconGrainlineHorizontal.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 B

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg2509"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="icon_current_piece.svg">
<defs
id="defs2503" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="-253.40813"
inkscape:cy="-61.561841"
inkscape:document-units="px"
inkscape:current-layer="g2570"
showgrid="false"
units="px"
inkscape:window-width="2492"
inkscape:window-height="1376"
inkscape:window-x="68"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata2506">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<g
transform="matrix(0.26453414,0,0,0.26453414,63.37226,-244.46879)"
font-size="14.6667"
font-weight="400"
font-style="normal"
id="g2570"
style="font-style:normal;font-weight:400;font-size:14.66670036px;font-family:Ubuntu;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1">
<path
d="m -140.95302,1932.7404 0.69118,112.062 h -69.00486 l -0.19139,-25.9137 0.22275,-27.7193 1.69724,-0.6159 1.52048,-0.7014 0.70479,-0.4067 1.0218,-0.6852 1.26935,-1.0451 1.16075,-1.1592 1.06104,-1.2554 0.96326,-1.3272 0.86777,-1.3738 0.77496,-1.3924 0.68291,-1.3795 0.8777,-2.0097 1.26386,-3.522 0.55623,-1.7804 0.21606,-0.9228 0.19427,-1.1523 0.16148,-1.3687 0.11878,-1.5657 0.0676,-1.7466 0.0104,-1.913 -0.058,-2.0662 -0.1324,-2.205 -0.21343,-2.3325 -0.30178,-2.446 -0.39726,-2.5483 -0.49959,-2.6371 -0.60908,-2.7146 -0.72542,-2.7795 -0.84877,-2.8318 -0.97525,-2.8616 -1.05725,-2.761 -0.93355,-2.1985 34.72106,-11.6806 2.50212,3.437 1.09172,1.3233 1.06182,1.1453 1.04965,0.9815 1.05753,0.8335 1.08979,0.7051 1.15089,0.594 1.2433,0.4976 1.36638,0.4114 1.51656,0.3326 1.68999,0.2582 1.88344,0.1898 2.09146,0.1299 3.55478,0.1052 2.77287,0.021"
id="path2568"
inkscape:connector-curvature="0"
style="vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4.14862871;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="icon_grainline_horizontal.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="131.4404"
inkscape:cy="23.984595"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="2492"
inkscape:window-height="1376"
inkscape:window-x="68"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13333)">
<path
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.08413111px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 5.5252585,275.18217 0.051298,3.99382 22.7141635,-0.0537 0.01533,-3.8659 5.496769,4.82839 -5.511316,4.79342 -0.03376,-3.83055 -22.7010593,-0.0398 0.042982,3.95521 -5.53642339,-4.9772 z"
id="path815"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="icon_grainline_vertical.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="10.587649"
inkscape:cy="31.675878"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="2492"
inkscape:window-height="1376"
inkscape:window-x="68"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13333)">
<path
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.08413111px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 21.94176,268.65855 -3.993828,0.0513 0.05369,22.71416 3.865904,0.0153 -4.828397,5.49677 -4.79342,-5.51132 3.830552,-0.0338 0.03977,-22.70106 -3.955217,0.043 4.977207,-5.53642 z"
id="path815"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
sodipodi:docname="icon_landscape.svg"
inkscape:export-filename="/home/ronan/Desktop/icon_layout.png"
inkscape:export-xdpi="48"
inkscape:export-ydpi="48"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="129.97931"
inkscape:cy="45.737629"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="2492"
inkscape:window-height="1376"
inkscape:window-x="68"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<path
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.05013251;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 33.343664,293.0374 v -17.62724 l -4.39397,-4.25101 -4.14294,-4.06324 H 0.52713435 v 25.94149 z"
id="rect815"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.05799997;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:transform-center-x="-0.55548508"
inkscape:transform-center-y="0.97501237"
d="m 24.948494,267.23765 -0.0243,8.13814 8.41946,0.0344"
id="path848"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
sodipodi:docname="icon_layers.svg"
inkscape:export-filename="/home/ronan/Desktop/icon_layout.png"
inkscape:export-xdpi="48"
inkscape:export-ydpi="48"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="-330.80339"
inkscape:cy="-397.46436"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="2492"
inkscape:window-height="1376"
inkscape:window-x="68"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.19349599;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815"
width="17.856504"
height="17.856504"
x="0.59674788"
y="263.73007" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.19349599;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815-5"
width="17.856504"
height="17.856504"
x="8.4442673"
y="270.30368" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.19349599;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815-3"
width="17.856504"
height="17.856504"
x="15.413412"
y="278.54672" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
sodipodi:docname="icon_layout.svg"
inkscape:export-filename="/home/ronan/Desktop/icon_layout.png"
inkscape:export-xdpi="48"
inkscape:export-ydpi="48"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="96.514929"
inkscape:cy="54.111874"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1513"
inkscape:window-height="1106"
inkscape:window-x="596"
inkscape:window-y="129"
inkscape:window-maximized="0" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.05013251;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815"
width="25.9415"
height="32.816536"
x="3.9646497"
y="263.65839" />
<rect
style="fill:none;fill-opacity:1;stroke:#00eaff;stroke-width:1.04943001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815-3"
width="23.835947"
height="30.700571"
x="5.0226316"
y="264.71637" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
sodipodi:docname="icon_portrait.svg"
inkscape:export-filename="/home/ronan/Desktop/icon_layout.png"
inkscape:export-xdpi="48"
inkscape:export-ydpi="48"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="74.673459"
inkscape:cy="45.737629"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="2492"
inkscape:window-height="1376"
inkscape:window-x="68"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<path
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.05013251;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 3.9646542,263.65839 H 21.591894 l 4.25101,4.39397 4.06324,4.14294 v 24.27962 H 3.9646542 Z"
id="rect815"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:1.05799997;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:transform-center-x="0.97501255"
inkscape:transform-center-y="-0.55548525"
d="m 29.764404,272.05356 -8.13814,0.0243 -0.0344,-8.41946"
id="path848"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
sodipodi:docname="icon_tiles.svg"
inkscape:export-filename="/home/ronan/Desktop/icon_layout.png"
inkscape:export-xdpi="48"
inkscape:export-ydpi="48"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="-330.80339"
inkscape:cy="-397.46436"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1513"
inkscape:window-height="1106"
inkscape:window-x="596"
inkscape:window-y="129"
inkscape:window-maximized="0" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.05013251;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815"
width="25.9415"
height="32.816536"
x="3.9646497"
y="263.65839" />
<rect
style="fill:none;fill-opacity:1;stroke:#ff0000;stroke-width:0.98678774;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815-3"
width="0.071545608"
height="30.772118"
x="16.89756"
y="264.67615" />
<rect
style="fill:none;fill-opacity:1;stroke:#ff0000;stroke-width:0.9272486;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815-3-6"
width="0.081191778"
height="23.942709"
x="274.76807"
y="-28.642822"
transform="matrix(9.5379316e-4,0.99999955,-0.99999794,0.00202899,0,0)" />
<rect
style="fill:none;fill-opacity:1;stroke:#ff0000;stroke-width:0.9272486;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815-3-6-7"
width="0.081191778"
height="23.942709"
x="285.62363"
y="-28.632275"
transform="matrix(9.5379382e-4,0.99999955,-0.99999794,0.00202899,0,0)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -30,7 +30,7 @@
#define STABLE_H #define STABLE_H
/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ /* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */
#pragma message("Compiling precompiled headers for tape utility.\n") #pragma message("Compiling precompiled headers for puzzle utility.\n")
/* Add C includes here */ /* Add C includes here */

View File

@ -33,7 +33,7 @@
#define VER_INTERNALNAME_STR "Puzzle" #define VER_INTERNALNAME_STR "Puzzle"
#define VER_ORIGINALFILENAME_STR "puzzle.exe" #define VER_ORIGINALFILENAME_STR "puzzle.exe"
#define VER_PRODUCTNAME_STR "Tape" #define VER_PRODUCTNAME_STR "Puzzle"
#define VER_FILEDESCRIPTION_STR "Valentina's manual layout creator." #define VER_FILEDESCRIPTION_STR "Valentina's manual layout creator."
#endif // VERSION_H #endif // VERSION_H

View File

@ -0,0 +1,155 @@
/************************************************************************
**
** @file vpiececarrousel.cpp
** @author Ronan Le Tiec
** @date 13 4, 2020
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2020 Valentina project
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vpiececarrousel.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QMessageBox>
//---------------------------------------------------------------------------------------------------------------------
VPieceCarrousel::VPieceCarrousel(QWidget *parent) :
QWidget(parent),
comboBoxLayer(new QComboBox),
mainScrollArea(new QScrollArea(this)),
layers(QList<QWidget *>())
{
QVBoxLayout *mainLayout = new QVBoxLayout();
setLayout(mainLayout);
setMinimumSize(140,140);
mainLayout->addWidget(comboBoxLayer);
comboBoxLayer->addItem(tr("Unplaced pieces"));
comboBoxLayer->addItem(tr("Layout"));
comboBoxLayer->setCurrentIndex(0);
connect(comboBoxLayer, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&VPieceCarrousel::ActiveLayerChanged);
QWidget *widget = new QWidget();
QVBoxLayout *mainScrollAreaLayout = new QVBoxLayout();
mainScrollAreaLayout->setMargin(0);
widget->setLayout(mainScrollAreaLayout);
mainScrollArea->setWidget(widget);
mainLayout->addWidget(mainScrollArea);
// mainScrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
mainScrollArea->setWidgetResizable( true );
// this code is for test purpuses, it needs to be updated when we have proper data!
QWidget *unplacedPieces = new QWidget();
QVBoxLayout *unplacedPiecesLayout = new QVBoxLayout();
unplacedPiecesLayout->setMargin(0);
unplacedPieces->setLayout(unplacedPiecesLayout);
for(int i=0; i<=10; ++i)
{
QLabel *myLabel = new QLabel();
myLabel->setText(QString ("Element A.%1").arg(i));
myLabel->setFixedSize(120,120);
myLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
if(i%2 ==0)
{
myLabel->setStyleSheet("background-color:white");
}
else {
myLabel->setStyleSheet("background-color:red");
}
unplacedPiecesLayout->addWidget(myLabel);
}
mainScrollAreaLayout->addWidget(unplacedPieces);
layers.append(unplacedPieces);
QWidget *layoutPieces = new QWidget();
QVBoxLayout *layoutPiecesLayout = new QVBoxLayout();
layoutPiecesLayout->setMargin(0);
layoutPieces->setLayout(layoutPiecesLayout);
for(int i=0; i<=5; ++i)
{
QLabel *myLabel = new QLabel();
myLabel->setText(QString ("Element B.%1").arg(i));
myLabel->setFixedSize(120,120);
myLabel->sizePolicy();
myLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
myLabel->setStyleSheet("background-color:cornflowerblue");
layoutPiecesLayout->addWidget(myLabel);
}
mainScrollAreaLayout->addWidget(layoutPieces);
layers.append(layoutPieces);
QSpacerItem *spacer = new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Expanding);
mainScrollAreaLayout->addSpacerItem(spacer);
// -------------------- init the layers combobox ---------------------
ActiveLayerChanged(0);
}
//---------------------------------------------------------------------------------------------------------------------
VPieceCarrousel::~VPieceCarrousel()
{
delete comboBoxLayer;
delete mainScrollArea;
}
//---------------------------------------------------------------------------------------------------------------------
void VPieceCarrousel::ActiveLayerChanged(int index)
{
int j=0;
for (QWidget *widget: layers) {
widget->setVisible(j == index);
j++;
}
}
//---------------------------------------------------------------------------------------------------------------------
void VPieceCarrousel::setOrientation(Qt::Orientation orientation)
{
QBoxLayout::Direction direction = QBoxLayout::LeftToRight;
if(orientation == Qt::Horizontal)
{
comboBoxLayer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
}
else // Qt::Vertical
{
direction = QBoxLayout::TopToBottom;
comboBoxLayer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
}
QBoxLayout* mainScrollAreaLayout = qobject_cast<QBoxLayout*>(mainScrollArea->widget()->layout());
mainScrollAreaLayout->setDirection(direction);
for (QWidget *widget: layers) {
QBoxLayout* layerLayout = qobject_cast<QBoxLayout*>(widget->layout());
layerLayout->setDirection(direction);
}
}

View File

@ -0,0 +1,59 @@
/************************************************************************
**
** @file vpiececarrousel.h
** @author Ronan Le Tiec
** @date 13 04, 2020
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2020 Valentina project
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VPIECECARROUSEL_H
#define VPIECECARROUSEL_H
#include <QWidget>
#include <QComboBox>
#include <QScrollArea>
class VPieceCarrousel : public QWidget
{
Q_OBJECT
public:
explicit VPieceCarrousel(QWidget *parent = nullptr);
virtual ~VPieceCarrousel();
void setOrientation(Qt::Orientation orientation);
signals:
public slots:
private:
QComboBox *comboBoxLayer;
QScrollArea *mainScrollArea;
QList<QWidget *> layers;
private slots:
void ActiveLayerChanged(int index);
};
#endif // VPIECECARROUSEL_H