mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Refactoring
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -4,8 +4,12 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QListWidgetItem>
|
#include <QListWidgetItem>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
#include <QLineEdit>
|
||||||
#include "../../../../DesktopEditor/graphics/structures.h"
|
#include "../../../../DesktopEditor/graphics/structures.h"
|
||||||
|
|
||||||
|
#define COORD_SIZE_MM 100
|
||||||
|
#define MM_TO_COORD(size) (size / COORD_SIZE_MM)
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@ -13,6 +17,30 @@ namespace Ui
|
|||||||
}
|
}
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
class CustomLineEdit : public QLineEdit
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CustomLineEdit(QWidget *parent = nullptr) : QLineEdit(parent)
|
||||||
|
{
|
||||||
|
connect(this, &QLineEdit::editingFinished, this, &CustomLineEdit::onEditingFinished);
|
||||||
|
}
|
||||||
|
~CustomLineEdit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public slots:
|
||||||
|
void onEditingFinished()
|
||||||
|
{
|
||||||
|
if (this->text() == "")
|
||||||
|
this->setText(this->placeholderText());
|
||||||
|
if (this->text().toInt() < 0)
|
||||||
|
this->setText("0");
|
||||||
|
if (this->text().toInt() > COORD_SIZE_MM)
|
||||||
|
this->setText(QString::number(COORD_SIZE_MM));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
Linear,
|
Linear,
|
||||||
@ -26,15 +54,6 @@ typedef enum
|
|||||||
Functional
|
Functional
|
||||||
} GradientType;
|
} GradientType;
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
NoColorspaceType,
|
|
||||||
Rainbow,
|
|
||||||
BlackAndWhite,
|
|
||||||
RedAndBlue,
|
|
||||||
Pastel
|
|
||||||
} ColorspaceType;
|
|
||||||
|
|
||||||
struct Point
|
struct Point
|
||||||
{
|
{
|
||||||
Point(double _x = 0, double _y = 0) : x(_x), y(_y)
|
Point(double _x = 0, double _y = 0) : x(_x), y(_y)
|
||||||
@ -42,6 +61,7 @@ struct Point
|
|||||||
}
|
}
|
||||||
double x, y;
|
double x, y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Color
|
struct Color
|
||||||
{
|
{
|
||||||
uint r, g, b;
|
uint r, g, b;
|
||||||
@ -63,7 +83,6 @@ struct Color
|
|||||||
|
|
||||||
struct Info
|
struct Info
|
||||||
{
|
{
|
||||||
ColorspaceType colorspace = NoColorspaceType;
|
|
||||||
GradientType gradient = Linear;
|
GradientType gradient = Linear;
|
||||||
|
|
||||||
float r0, r1;
|
float r0, r1;
|
||||||
@ -122,58 +141,10 @@ private slots:
|
|||||||
|
|
||||||
void on_actionRadial_Gradient_triggered();
|
void on_actionRadial_Gradient_triggered();
|
||||||
|
|
||||||
void on_BAW_Colorspace_Radio_Button_clicked();
|
|
||||||
|
|
||||||
void on_RAB_Colorspace_Radio_Button_clicked();
|
|
||||||
|
|
||||||
void on_Pastel_Colorspace_Radio_Button_clicked();
|
|
||||||
|
|
||||||
void on_Rainbow_Colorspace_Radio_Button_clicked();
|
|
||||||
|
|
||||||
void on_pushButton_clicked();
|
void on_pushButton_clicked();
|
||||||
|
|
||||||
void on_Continue_Shading_Forward_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_checkBox_2_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_Continue_Shading_Forward_2_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_Continue_Shading_Backward_2_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Center_X_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Center_Y_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Center_X_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Center_Y_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Radius_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Radius_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_actionTriangle_Gradient_triggered();
|
void on_actionTriangle_Gradient_triggered();
|
||||||
|
|
||||||
void on_First_Vertex_X_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Vertex_Y_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Vertex_X_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Vertex_Y_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Vertex_X_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Vertex_Y_Coordinate_Input_editingFinished();
|
|
||||||
|
|
||||||
void on_actionTriangle_Parametric_Gradient_triggered();
|
void on_actionTriangle_Parametric_Gradient_triggered();
|
||||||
|
|
||||||
void on_actionCoons_Patch_Gradient_triggered();
|
void on_actionCoons_Patch_Gradient_triggered();
|
||||||
@ -184,118 +155,6 @@ private slots:
|
|||||||
|
|
||||||
void on_actionTensor_Coons_Patch_Parametric_triggered();
|
void on_actionTensor_Coons_Patch_Parametric_triggered();
|
||||||
|
|
||||||
void on_First_Vertex_X_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Vertex_Y_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Vertex_X_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Vertex_Y_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Vertex_X_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Vertex_Y_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_Vertex_X_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_Vertex_Y_Coordinate_Input_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_First_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_First_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_First_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_First_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_Second_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_Second_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_Second_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_Second_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_Third_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_Third_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_Third_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_Third_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_Fourth_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_Fourth_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_Fourth_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_Fourth_Edge_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_X_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Y_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_X_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_Y_Coordinate_First_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_X_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Y_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_X_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_Y_Coordinate_Second_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_X_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Y_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_X_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_Y_Coordinate_Third_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_X_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_First_Y_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_X_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Second_Y_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_X_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Third_Y_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_X_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
void on_Fourth_Y_Coordinate_Fourth_Edge_3_editingFinished();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user