Skip to content
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "actions/OE_actionsStitchs.h" #include "actions/OE_actionsStitchs.h"
#include "actions/OE_actionsLineStitchs.h" #include "actions/OE_actionsLineStitchs.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "actions/OE_actionsThreads.h" #include "actions/OE_actionsThreads.h"
#include "OE_document.h" #include "OE_document.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "curves/OE_curve.h" #include "curves/OE_curve.h"
#include "OE_utils.h" #include "OE_utils.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "curves/OE_joincurve.h" #include "curves/OE_joincurve.h"
#include <iostream> #include <iostream>
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "curves/OE_pointcurve.h" #include "curves/OE_pointcurve.h"
#include "OE_utils.h" #include "OE_utils.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "curves/OE_subcurve.h" #include "curves/OE_subcurve.h"
#include "Archive.h" #include "Archive.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "instructions/OE_instruction.h" #include "instructions/OE_instruction.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "instructions/OE_start.h" #include "instructions/OE_start.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "instructions/OE_waitcolor.h" #include "instructions/OE_waitcolor.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "OE_io.h" #include "OE_io.h"
#include "OE_document.h" #include "OE_document.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "OE_io.h" #include "OE_io.h"
#include "OE_document.h" #include "OE_document.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "OE_io.h" #include "OE_io.h"
#include "OE_document.h" #include "OE_document.h"
......
/* /*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr * This file is part of project OpenEmbroidery. It's copyrighted by
* * the contributors recorded in the version control history of the file.
* This software is provided 'as-is', without any express or implied * Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
* warranty. In no event will the authors be held liable for any damages *
* arising from the use of this software. * SPDX-License-Identifier: CECILL-2.1
* * License-Filename: Licence_CeCILL_V2.1-en.txt
* Permission is granted to anyone to use this software for any purpose, */
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "OE_io.h" #include "OE_io.h"
#include "OE_utils.h" #include "OE_utils.h"
......
/*
* This file is part of project OpenEmbroidery. It's copyrighted by
* the contributors recorded in the version control history of the file.
* Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
*
* SPDX-License-Identifier: CECILL-2.1
* License-Filename: Licence_CeCILL_V2.1-en.txt
*/
#include "machine.h" #include "machine.h"
#include <QMetaEnum> #include <QMetaEnum>
#include <QDebug> #include <QDebug>
......
...@@ -10,7 +10,7 @@ OE_ui_toolBox::OE_ui_toolBox(MainWindow* window, OE_root* root) ...@@ -10,7 +10,7 @@ OE_ui_toolBox::OE_ui_toolBox(MainWindow* window, OE_root* root)
buttonFont = QFont("Roboto", 8, QFont::Medium); buttonFont = QFont("Roboto", 8, QFont::Medium);
setFixedWidth(150); setFixedWidth(150);
setSizePolicy(QSizePolicy ::Fixed , QSizePolicy ::Expanding ); setSizePolicy(QSizePolicy ::Fixed , QSizePolicy ::Expanding );
QVBoxLayout *drawerLeftLayout = new QVBoxLayout; QVBoxLayout *drawerLeftLayout = new QVBoxLayout;
setLayout(drawerLeftLayout); setLayout(drawerLeftLayout);
...@@ -47,9 +47,9 @@ OE_ui_toolBox::OE_ui_toolBox(MainWindow* window, OE_root* root) ...@@ -47,9 +47,9 @@ OE_ui_toolBox::OE_ui_toolBox(MainWindow* window, OE_root* root)
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);
} }
QtMaterialFlatButton* OE_ui_toolBox::setButton(QString name, const QObject *receiver = NULL, const char * method = NULL) QtMaterialButton* OE_ui_toolBox::setButton(QString name, const QObject *receiver = NULL, const char * method = NULL)
{ {
QtMaterialFlatButton* button = new QtMaterialFlatButton(name); QtMaterialButton* button = new QtMaterialButton(name);
button->setFont(buttonFont); button->setFont(buttonFont);
button->setUseThemeColors(true); button->setUseThemeColors(true);
...@@ -57,19 +57,37 @@ QtMaterialFlatButton* OE_ui_toolBox::setButton(QString name, const QObject *rece ...@@ -57,19 +57,37 @@ QtMaterialFlatButton* OE_ui_toolBox::setButton(QString name, const QObject *rece
button->setTextAlignment(Qt::AlignLeft); button->setTextAlignment(Qt::AlignLeft);
button->setMinimumHeight(0); button->setMinimumHeight(0);
button->setFixedHeight(30);
if (method) if (method)
connect(button, SIGNAL(clicked(bool)), receiver, method); connect(button, SIGNAL(clicked(bool)), receiver, method);
return button; return button;
} }
QtMaterialFlatButton* OE_ui_toolBox::setButton(QString name,QString iconFile, const QObject *receiver = NULL, const char * method = NULL) QtMaterialButton* OE_ui_toolBox::setButton(QString name,QString iconFile, const QObject *receiver = NULL, const char * method = NULL)
{ {
QtMaterialFlatButton* newButton = setButton(name, receiver, method); QtMaterialButton* button = setButton(name, receiver, method);
QIcon icon; QIcon icon;
icon.addFile(iconFile, QSize(), QIcon::Normal, QIcon::Off); icon.addFile(iconFile, QSize(), QIcon::Normal, QIcon::Off);
newButton->setIcon(icon); button->setIcon(icon);
button->setFixedHeight(30);
button->setIconSize(QSize(20,20));
//newButton->setIconPlacement(Material::ButtonIconPlacement::RightIcon); //newButton->setIconPlacement(Material::ButtonIconPlacement::RightIcon);
return newButton; return button;
}
QtMaterialIconButton* OE_ui_toolBox::setIconButton(QString iconFile, const QObject *receiver = NULL, const char * method = NULL)
{
QIcon icon;
icon.addFile(iconFile, QSize(), QIcon::Normal, QIcon::Off);
QtMaterialIconButton* button = new QtMaterialIconButton(icon);
button->setUseThemeColors(false);
button->setIconSize(QSize(30,30));
button->setRole(Material::Primary);
if (method)
connect(button, SIGNAL(clicked()), receiver, method);
return button;
} }
void OE_ui_toolBox::addFilesTools(QtMaterialToolTabs *tabs) void OE_ui_toolBox::addFilesTools(QtMaterialToolTabs *tabs)
...@@ -106,10 +124,10 @@ void OE_ui_toolBox::addGuidesTools(QtMaterialToolTabs *tabs) ...@@ -106,10 +124,10 @@ void OE_ui_toolBox::addGuidesTools(QtMaterialToolTabs *tabs)
label->setAlignment(Qt::AlignCenter); label->setAlignment(Qt::AlignCenter);
toolLayout->addWidget(label); toolLayout->addWidget(label);
QHBoxLayout *turnLayout = new QHBoxLayout();//curTab->content()); QHBoxLayout *turnLayout = new QHBoxLayout();//curTab->content());
toolLayout->addLayout(turnLayout); toolLayout->addLayout(turnLayout);
turnLayout->addWidget(setButton("Right")); turnLayout->addWidget(setIconButton(":/resources/turn_left.svg"));
turnLayout->addWidget(setButton("Left")); turnLayout->addWidget(setIconButton(":/resources/turn_180.svg"));
turnLayout->addWidget(setButton("360°")); turnLayout->addWidget(setIconButton(":/resources/turn_right.svg"));
toolLayout->addWidget(setButton("Add curve")); toolLayout->addWidget(setButton("Add curve"));
...@@ -126,9 +144,9 @@ void OE_ui_toolBox::addStitchTools(QtMaterialToolTabs *tabs) ...@@ -126,9 +144,9 @@ void OE_ui_toolBox::addStitchTools(QtMaterialToolTabs *tabs)
toolLayout->setSpacing(0); toolLayout->setSpacing(0);
toolLayout->setContentsMargins(0,0,0,0); toolLayout->setContentsMargins(0,0,0,0);
toolLayout->addWidget(setButton("New line", getInterfaceDisplay(), SLOT(newLinestitch()))); toolLayout->addWidget(setButton("New line",":/resources/line_stitch.svg", getInterfaceDisplay(), SLOT(newLinestitch())));
toolLayout->addWidget(setButton("New birail", getInterfaceDisplay(), SLOT(newBirailstitch()))); toolLayout->addWidget(setButton("New birail",":/resources/birail_stitch.svg", getInterfaceDisplay(), SLOT(newBirailstitch())));
toolLayout->addWidget(setButton("New fill", getInterfaceDisplay(), SLOT(newFillstitch()))); toolLayout->addWidget(setButton("New fill",":/resources/fill_stitch.svg", getInterfaceDisplay(), SLOT(newFillstitch())));
//toolLayout->addWidget(setButton("Reverse selected", SLOT(on_actionReverse_curve_R_triggered()))); //toolLayout->addWidget(setButton("Reverse selected", SLOT(on_actionReverse_curve_R_triggered())));
toolLayout->addStretch(); toolLayout->addStretch();
...@@ -142,7 +160,7 @@ void OE_ui_toolBox::addStitchTools(QtMaterialToolTabs *tabs) ...@@ -142,7 +160,7 @@ void OE_ui_toolBox::addStitchTools(QtMaterialToolTabs *tabs)
paternLayout->addWidget(setButton("2", this, SLOT(on_actionPattern2_triggered())),0,1,1,1); paternLayout->addWidget(setButton("2", this, SLOT(on_actionPattern2_triggered())),0,1,1,1);
paternLayout->addWidget(setButton("3", this, SLOT(on_actionPattern3_triggered())),0,2,1,1); paternLayout->addWidget(setButton("3", this, SLOT(on_actionPattern3_triggered())),0,2,1,1);
/*paternLayout->addWidget(setButton("3",SLOT(on_actionPattern3_triggered())),0,2,1,1); /*paternLayout->addWidget(setButton("3",SLOT(on_actionPattern3_triggered())),0,2,1,1);
QtMaterialFlatButton* button = new QtMaterialFlatButton("3"); QtMaterialButton* button = new QtMaterialButton("3");
button->setFont(buttonFont); button->setFont(buttonFont);
button->setUseThemeColors(true); button->setUseThemeColors(true);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "mainwindow.h" #include "mainwindow.h"
#include <QtWidgets/qlabel.h> #include <QtWidgets/qlabel.h>
#include <qtmaterialtooltabs.h> #include <qtmaterialtooltabs.h>
#include <qtmaterialflatbutton.h> #include <qtmaterialbutton.h>
class MainWindow; class MainWindow;
...@@ -23,9 +23,10 @@ private: ...@@ -23,9 +23,10 @@ private:
OE_root* root; OE_root* root;
MainWindow* window; MainWindow* window;
QFont buttonFont; QFont buttonFont;
QtMaterialFlatButton* setButton(QString name, const QObject *receiver, const char * method); QtMaterialButton* setButton(QString name, const QObject *receiver, const char * method);
QtMaterialFlatButton* setButton(QString name,QString iconFile, const QObject *receiver, const char * method); QtMaterialButton* setButton(QString name,QString iconFile, const QObject *receiver, const char * method);
void addFilesTools(QtMaterialToolTabs *tabs); QtMaterialIconButton* setIconButton(QString iconFile, const QObject *receiver, const char * method);
void addFilesTools(QtMaterialToolTabs *tabs);
void addGuidesTools(QtMaterialToolTabs *tabs); void addGuidesTools(QtMaterialToolTabs *tabs);
void addStitchTools(QtMaterialToolTabs *tabs); void addStitchTools(QtMaterialToolTabs *tabs);
void addThreadTools(QtMaterialToolTabs *tabs); void addThreadTools(QtMaterialToolTabs *tabs);
......
...@@ -22,6 +22,7 @@ QtMaterialIconButton* OE_ui_viewportOptions::setIconButton(QString iconFile, con ...@@ -22,6 +22,7 @@ QtMaterialIconButton* OE_ui_viewportOptions::setIconButton(QString iconFile, con
button->setUseThemeColors(false); button->setUseThemeColors(false);
button->setIconSize(QSize(25,25)); button->setIconSize(QSize(25,25));
button->setRole(Material::Primary); button->setRole(Material::Primary);
button->setToolTip("test");
if (method) if (method)
connect(button, SIGNAL(clicked()), receiver, method); connect(button, SIGNAL(clicked()), receiver, method);
return button; return button;
...@@ -41,6 +42,11 @@ void OE_ui_viewportOptions::topGlWindowBar() ...@@ -41,6 +42,11 @@ void OE_ui_viewportOptions::topGlWindowBar()
gridButton->setCheckable( true ); gridButton->setCheckable( true );
addWidget(gridButton); addWidget(gridButton);
hoopButton = setIconButton(":/resources/hoop.svg", this, SLOT(onToggleHoop()));
hoopButton->setCheckable( true );
addWidget(hoopButton);
addSpacing(8);
showCurvesButton = setIconButton(":/resources/show_curve.svg", this, SLOT(onToggleShowCurve())); showCurvesButton = setIconButton(":/resources/show_curve.svg", this, SLOT(onToggleShowCurve()));
showCurvesButton->setCheckable( true ); showCurvesButton->setCheckable( true );
addWidget(showCurvesButton); addWidget(showCurvesButton);
...@@ -79,6 +85,7 @@ OE_document* OE_ui_viewportOptions::getDocument() ...@@ -79,6 +85,7 @@ OE_document* OE_ui_viewportOptions::getDocument()
void OE_ui_viewportOptions::onRefresh() void OE_ui_viewportOptions::onRefresh()
{ {
gridButton->setChecked(getInterfaceDisplay()->style->drawGrid); gridButton->setChecked(getInterfaceDisplay()->style->drawGrid);
hoopButton->setChecked(getInterfaceDisplay()->style->drawHoop);
showCurvesButton->setChecked(getInterfaceDisplay()->style->drawCurves); showCurvesButton->setChecked(getInterfaceDisplay()->style->drawCurves);
showStitchButton->setChecked(getInterfaceDisplay()->style->drawStitches); showStitchButton->setChecked(getInterfaceDisplay()->style->drawStitches);
selectCurvesButton->setChecked(getInterfaceDisplay()->style->selectCurves); selectCurvesButton->setChecked(getInterfaceDisplay()->style->selectCurves);
...@@ -91,6 +98,12 @@ void OE_ui_viewportOptions::onToggleGrid() ...@@ -91,6 +98,12 @@ void OE_ui_viewportOptions::onToggleGrid()
getInterfaceDisplay()->update(); getInterfaceDisplay()->update();
} }
void OE_ui_viewportOptions::onToggleHoop()
{
getInterfaceDisplay()->style->drawHoop = !getInterfaceDisplay()->style->drawHoop;
getInterfaceDisplay()->update();
}
void OE_ui_viewportOptions::onToggleShowCurve() void OE_ui_viewportOptions::onToggleShowCurve()
{ {
getInterfaceDisplay()->style->drawCurves = !getInterfaceDisplay()->style->drawCurves; getInterfaceDisplay()->style->drawCurves = !getInterfaceDisplay()->style->drawCurves;
......
...@@ -23,6 +23,7 @@ private: ...@@ -23,6 +23,7 @@ private:
MainWindow* window; MainWindow* window;
QtMaterialIconButton* gridButton; QtMaterialIconButton* gridButton;
QtMaterialIconButton* hoopButton;
QtMaterialIconButton* showCurvesButton; QtMaterialIconButton* showCurvesButton;
QtMaterialIconButton* showStitchButton; QtMaterialIconButton* showStitchButton;
QtMaterialIconButton* selectCurvesButton; QtMaterialIconButton* selectCurvesButton;
...@@ -33,6 +34,7 @@ public slots: ...@@ -33,6 +34,7 @@ public slots:
void onRefresh(); void onRefresh();
void onToggleGrid(); void onToggleGrid();
void onToggleHoop();
void onToggleShowCurve(); void onToggleShowCurve();
void onToggleShowStitch(); void onToggleShowStitch();
void onToggleSelectCurve(); void onToggleSelectCurve();
......
/*
* This file is part of project OpenEmbroidery. It's copyrighted by
* the contributors recorded in the version control history of the file.
* Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
*
* SPDX-License-Identifier: CECILL-2.1
* License-Filename: Licence_CeCILL_V2.1-en.txt
*/
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "main.h" #include "main.h"
...@@ -143,7 +152,7 @@ QBoxLayout* MainWindow::stitchParam() ...@@ -143,7 +152,7 @@ QBoxLayout* MainWindow::stitchParam()
m_checkBox->setIconSize(QSize(5,5)); m_checkBox->setIconSize(QSize(5,5));
topGlWindowLayout->addWidget(m_checkBox); topGlWindowLayout->addWidget(m_checkBox);
topGlWindowLayout->setAlignment(m_checkBox, Qt::AlignCenter); topGlWindowLayout->setAlignment(m_checkBox, Qt::AlignCenter);
topGlWindowLayout->addWidget(new QtMaterialFlatButton("param3")); topGlWindowLayout->addWidget(new QtMaterialButton("param3"));
return topGlWindowLayout; return topGlWindowLayout;
} }
......
/*
* This file is part of project OpenEmbroidery. It's copyrighted by
* the contributors recorded in the version control history of the file.
* Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
*
* SPDX-License-Identifier: CECILL-2.1
* License-Filename: Licence_CeCILL_V2.1-en.txt
*/
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
...@@ -17,7 +26,7 @@ ...@@ -17,7 +26,7 @@
#include <QtWidgets/QPushButton> #include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
#include <QtWidgets/qlabel.h> #include <QtWidgets/qlabel.h>
#include <qtmaterialflatbutton.h> #include <qtmaterialbutton.h>
#include <qtmaterialiconbutton.h> #include <qtmaterialiconbutton.h>
class Machine; class Machine;
......