Merge branch 'dev-rework' into dev

This commit is contained in:
2020-01-16 12:11:08 +01:00
314 changed files with 5777 additions and 4797 deletions

View File

@@ -4,83 +4,83 @@
IntelliInputDialog::IntelliInputDialog(QString Title, QString Label, int value, int minValue, int maxValue, int step, bool* ok)
{
this->valueInt = value;
this->notClosed = ok;
if(notClosed != nullptr){
*notClosed = false;
}
this->valueInt = value;
this->notClosed = ok;
if(notClosed != nullptr) {
*notClosed = false;
}
createInputBox(Title, Label, value, minValue, maxValue, step);
createConnections();
createConnections();
setInputBoxStyle();
this->exec();
this->exec();
}
int IntelliInputDialog::getInt(QString Title, QString Label, int value, int minValue, int maxValue, int step, bool* ok){
IntelliInputDialog dialog(Title, Label, value, minValue, maxValue, step, ok);
return dialog.valueInt;
IntelliInputDialog dialog(Title, Label, value, minValue, maxValue, step, ok);
return dialog.valueInt;
}
void IntelliInputDialog::createInputBox(QString Title, QString Label, int value, int minValue, int maxValue, int step){
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
if(Title == nullptr) {
this->setWindowTitle("Input Box");
this->setWindowTitle("Input Box");
}
else{
this->setWindowTitle(Title);
this->setWindowTitle(Title);
}
this->Layout = new QGridLayout();
this->ButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
this->Layout = new QGridLayout();
this->ButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
this->InputLabel = new QLabel();
this->InputLabel = new QLabel();
if(Label == nullptr) {
this->InputLabel->setText("Width:");
this->InputLabel->setText("Width:");
}
else{
this->InputLabel->setText(Label);
this->InputLabel->setText(Label);
}
this->InputLabel->setFixedSize(Linesize);
this->InputLabel->setFixedSize(Linesize);
this->Input = new QSpinBox();
this->Input->setFixedSize(Linesize);
this->Input->setRange(minValue,maxValue);
this->Input->setSingleStep(step);
this->Input->setValue(value);
this->Input = new QSpinBox();
this->Input->setFixedSize(Linesize);
this->Input->setRange(minValue,maxValue);
this->Input->setSingleStep(step);
this->Input->setValue(value);
this->okButton = ButtonBox->button(QDialogButtonBox::Ok);
this->okButton->setFixedSize(Buttonsize);
this->okButton->setAutoDefault(false);
this->okButton->setDefault(false);
this->okButton = ButtonBox->button(QDialogButtonBox::Ok);
this->okButton->setFixedSize(Buttonsize);
this->okButton->setAutoDefault(false);
this->okButton->setDefault(false);
this->cancelButton = ButtonBox->button(QDialogButtonBox::Cancel);
this->cancelButton->setFixedSize(Buttonsize);
this->cancelButton->setAutoDefault(false);
this->cancelButton->setDefault(false);
this->cancelButton = ButtonBox->button(QDialogButtonBox::Cancel);
this->cancelButton->setFixedSize(Buttonsize);
this->cancelButton->setAutoDefault(false);
this->cancelButton->setDefault(false);
Layout->addWidget(InputLabel,1,1,1,1);
Layout->addWidget(Input,2,1,1,1);
Layout->addWidget(ButtonBox,3,1,1,1);
this->setLayout(Layout);
this->resize(172,94);
this->show();
this->setLayout(Layout);
this->resize(172,94);
this->show();
}
void IntelliInputDialog::createConnections(){
connect(okButton, SIGNAL(clicked()), this, SLOT(slotEingabe()));
connect(okButton, SIGNAL(clicked()), this, SLOT(slotEingabe()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(slotCloseEvent()));
}
void IntelliInputDialog::setInputBoxStyle(){
this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
}
void IntelliInputDialog::slotCloseEvent(){
this->close();
this->close();
}
void IntelliInputDialog::slotEingabe(){
valueInt = QString("%1").arg(Input->value()).toInt();
if(notClosed != nullptr){
*notClosed = true;
}
this->close();
valueInt = QString("%1").arg(Input->value()).toInt();
if(notClosed != nullptr) {
*notClosed = true;
}
this->close();
}

View File

@@ -16,13 +16,13 @@ int IntelliToolsettings::getLineWidth(){
}
void IntelliToolsettings::setLineWidth(int LineWidth){
if(LineWidth < 1){
LineWidth = 1;
}
else if(LineWidth > 50){
LineWidth = 50;
}
lineWidth = LineWidth;
if(LineWidth < 1) {
LineWidth = 1;
}
else if(LineWidth > 50) {
LineWidth = 50;
}
lineWidth = LineWidth;
}
int IntelliToolsettings::getInnerAlpha(){
@@ -30,11 +30,11 @@ int IntelliToolsettings::getInnerAlpha(){
}
void IntelliToolsettings::setInnerAlpha(int innerAlpha){
if(innerAlpha < 0){
innerAlpha = 0;
}
else if(innerAlpha > 255){
innerAlpha = 255;
}
this->innerAlpha = innerAlpha;
if(innerAlpha < 0) {
innerAlpha = 0;
}
else if(innerAlpha > 255) {
innerAlpha = 255;
}
this->innerAlpha = innerAlpha;
}

View File

@@ -32,15 +32,15 @@ PaintingArea::~PaintingArea(){
}
void PaintingArea::setRenderSettings(bool isFastRenderingOn){
bool ToolIsActive;
bool ToolIsActive;
if(Tool!=nullptr){
ToolIsActive = Tool->getIsDrawing();
}
else{
ToolIsActive = false;
}
if(isFastRenderingOn != renderSettings.isFastRenderering() && !ToolIsActive) {
if(Tool!=nullptr) {
ToolIsActive = Tool->getIsDrawing();
}
else{
ToolIsActive = false;
}
if(isFastRenderingOn != renderSettings.isFastRenderering() && !ToolIsActive) {
renderSettings.setFastRendering(isFastRenderingOn);
for(auto& layer : layerBundle) {
layer.image->updateRendererSetting(isFastRenderingOn);
@@ -118,7 +118,7 @@ void PaintingArea::setPolygon(int idx){
delete this->Tool;
this->Tool = new IntelliToolPolygon(this,&colorPicker,&Toolsettings, true);
isSettingPolygon = true;
this->DummyGui->setToolWidth(5);
this->DummyGui->setToolWidth(5);
}
}
}
@@ -172,7 +172,7 @@ void PaintingArea::moveActiveLayer(int idx){
}else if(idx==-1) {
this->selectLayerDown();
}
DummyGui->UpdateGui();
DummyGui->UpdateGui();
}
void PaintingArea::slotActivateLayer(int a){
@@ -239,11 +239,11 @@ int PaintingArea::getHeightOfActive(){
}
int PaintingArea::getMaxWidth(){
return this->maxWidth;
return this->maxWidth;
}
int PaintingArea::getMaxHeight(){
return this->maxHeight;
return this->maxHeight;
}
IntelliImage::ImageType PaintingArea::getTypeOfImageRealLayer(){

View File

@@ -47,7 +47,7 @@ void IntelliTool::onMouseMoved(int x, int y){
void IntelliTool::onWheelScrolled(int value){
//if needed for future general tasks implement in here
Area->DummyGui->setToolWidth(value+Toolsettings->getLineWidth());
Area->DummyGui->setToolWidth(value + Toolsettings->getLineWidth());
}
bool IntelliTool::createToolLayer(){

View File

@@ -10,9 +10,9 @@ IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* c
isDrawing = false;
isInside = false;
this->isSettingPolygon = isSettingPolygon;
if(isSettingPolygon){
Toolsettings->setLineWidth(5);
}
if(isSettingPolygon) {
Toolsettings->setLineWidth(5);
}
this->ActiveType = Tooltype::POLYGON;
}
@@ -124,18 +124,18 @@ void IntelliToolPolygon::onMouseRightReleased(int x, int y){
}
void IntelliToolPolygon::onWheelScrolled(int value){
if(!isSettingPolygon){
IntelliTool::onWheelScrolled(value);
if(!isDrawing) {
Toolsettings->setLineWidth(Toolsettings->getLineWidth() + value);
}
}
if(!isSettingPolygon) {
IntelliTool::onWheelScrolled(value);
if(!isDrawing) {
Toolsettings->setLineWidth(Toolsettings->getLineWidth() + value);
}
}
}
void IntelliToolPolygon::onMouseMoved(int x, int y){
if(!isSettingPolygon){
IntelliTool::onMouseMoved(x,y);
}
if(!isSettingPolygon) {
IntelliTool::onMouseMoved(x,y);
}
}
bool IntelliToolPolygon::isNearStart(int x, int y, QPoint Startpoint){

View File

@@ -8,7 +8,7 @@ int main(int argc, char*argv[]){
QApplication app(argc, argv);
// Create and open the main window
IntelliPhotoGui window;
IntelliPhotoGui window;
window.show();
return app.exec();