Wed, 26 Dec 2018 16:38:38 +0200
Refactored the color toolbar editing into a new model/view system
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
1326 | 3 | * Copyright (C) 2013 - 2018 Teemu Piippo |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #include <QComboBox> |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #include <QPainter> |
1297
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
21 | #include <QPushButton> |
1300 | 22 | #include <QInputDialog> |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include "colors.h" |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | #include "guiutilities.h" |
1145
02264bf0108d
Renamed ldDocument.cpp → lddocument.cpp
Teemu Piippo <teemu@hecknology.net>
parents:
1072
diff
changeset
|
25 | #include "lddocument.h" |
1297
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
26 | #include "dialogs/colorselector.h" |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | #include "mainwindow.h" |
1298
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
28 | #include "linetypes/modelobject.h" |
1300 | 29 | #include "linetypes/comment.h" |
1406
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
30 | #include "linetypes/circularprimitive.h" |
1298
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
31 | #include "dialogs/subfilereferenceeditor.h" |
1406
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
32 | #include "dialogs/circularprimitiveeditor.h" |
1298
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
33 | #include "widgets/vertexobjecteditor.h" |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | GuiUtilities::GuiUtilities (QObject* parent) : |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | QObject (parent), |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | HierarchyElement (parent) {} |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | |
1043 | 39 | /* |
40 | * makeColorIcon | |
41 | * | |
42 | * Creates an icon to represent an LDraw color. | |
43 | */ | |
1252 | 44 | QIcon makeColorIcon(LDColor color, int size) |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | { |
1043 | 46 | QImage image {size, size, QImage::Format_ARGB32}; |
47 | QPainter painter {&image}; | |
1252 | 48 | QColor truecolor; |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
49 | |
1252 | 50 | if (color == MainColor) |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | { |
1043 | 52 | // Use the user preferences for the main color. |
1323
05b3e173c900
Config is now a namespace
Teemu Piippo <teemu@hecknology.net>
parents:
1319
diff
changeset
|
53 | truecolor = config::mainColor(); |
05b3e173c900
Config is now a namespace
Teemu Piippo <teemu@hecknology.net>
parents:
1319
diff
changeset
|
54 | truecolor.setAlphaF(config::mainColorAlpha()); |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | } |
1043 | 56 | else |
1252 | 57 | { |
58 | truecolor = color.faceColor(); | |
59 | } | |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
60 | |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
61 | // Paint the icon border |
1252 | 62 | painter.fillRect(QRect {0, 0, size, size}, color.edgeColor()); |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
63 | |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
64 | // Paint the checkerboard background, visible with translucent icons |
1252 | 65 | painter.drawPixmap( |
66 | QRect {1, 1, size - 2, size - 2}, | |
67 | MainWindow::getIcon("checkerboard"), | |
68 | QRect {0, 0, 8, 8} | |
69 | ); | |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
70 | |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
71 | // Paint the color above the checkerboard |
1252 | 72 | painter.fillRect(QRect {1, 1, size - 2, size - 2}, truecolor); |
73 | return {QPixmap::fromImage(image)}; | |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | } |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
75 | |
1043 | 76 | /* |
77 | * fillUsedColorsToComboBox | |
78 | * | |
79 | * Fills the provided combo box with the colors used in the current document. | |
80 | */ | |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
81 | void GuiUtilities::fillUsedColorsToComboBox (QComboBox* box) |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
82 | { |
1043 | 83 | QMap<LDColor, int> frequencies; |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
84 | |
1043 | 85 | for (LDObject* object : currentDocument()->objects()) |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
86 | { |
1043 | 87 | if (object->isColored() and object->color().isValid()) |
88 | { | |
89 | if (not frequencies.contains(object->color())) | |
90 | frequencies[object->color()] = 1; | |
91 | else | |
92 | frequencies[object->color()] += 1; | |
93 | } | |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
94 | } |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
95 | |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
96 | box->clear(); |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
97 | int row = 0; |
1043 | 98 | QMapIterator<LDColor, int> iterator {frequencies}; |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
99 | |
1043 | 100 | while (iterator.hasNext()) |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
101 | { |
1043 | 102 | iterator.next(); |
103 | LDColor color = iterator.key(); | |
104 | int frequency = iterator.value(); | |
105 | QIcon icon = makeColorIcon(color, 16); | |
1319 | 106 | box->addItem(icon, format("[%1] %2 (%3 object(s))", color.index(), color.name(), frequency)); |
1043 | 107 | box->setItemData(row, color.index()); |
974
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
108 | ++row; |
b2fa5f89798a
Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
109 | } |
986
525921eae58c
Refactor GLRenderer and GLCompiler
Teemu Piippo <crimsondusk64@gmail.com>
parents:
978
diff
changeset
|
110 | } |
525921eae58c
Refactor GLRenderer and GLCompiler
Teemu Piippo <crimsondusk64@gmail.com>
parents:
978
diff
changeset
|
111 | |
1043 | 112 | /* |
113 | * mainColorRepresentation | |
114 | * | |
115 | * Returns the user-preferred appearance for the main color. | |
116 | */ | |
986
525921eae58c
Refactor GLRenderer and GLCompiler
Teemu Piippo <crimsondusk64@gmail.com>
parents:
978
diff
changeset
|
117 | QColor GuiUtilities::mainColorRepresentation() |
525921eae58c
Refactor GLRenderer and GLCompiler
Teemu Piippo <crimsondusk64@gmail.com>
parents:
978
diff
changeset
|
118 | { |
1323
05b3e173c900
Config is now a namespace
Teemu Piippo <teemu@hecknology.net>
parents:
1319
diff
changeset
|
119 | QColor result = {config::mainColor()}; |
986
525921eae58c
Refactor GLRenderer and GLCompiler
Teemu Piippo <crimsondusk64@gmail.com>
parents:
978
diff
changeset
|
120 | |
1043 | 121 | if (result.isValid()) |
122 | { | |
1323
05b3e173c900
Config is now a namespace
Teemu Piippo <teemu@hecknology.net>
parents:
1319
diff
changeset
|
123 | result.setAlpha(config::mainColorAlpha() * 255.f); |
1043 | 124 | return result; |
125 | } | |
126 | else | |
127 | { | |
128 | return QColor {0, 0, 0}; | |
129 | } | |
986
525921eae58c
Refactor GLRenderer and GLCompiler
Teemu Piippo <crimsondusk64@gmail.com>
parents:
978
diff
changeset
|
130 | } |
1017
fc1c13db9618
Renamed ConfigurationValueBag to Configuration and added a pointer to it into HierarchyElement. This helps with the fight against global variables.
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
131 | |
1043 | 132 | /* |
133 | * loadQuickColorList | |
134 | * | |
135 | * Returns a list of contents for the color toolbar, based on configuration. | |
136 | */ | |
1432
4cc687851fbb
Refactored the color toolbar editing into a new model/view system
Teemu Piippo <teemu@hecknology.net>
parents:
1406
diff
changeset
|
137 | QVector<LDColor> GuiUtilities::loadQuickColorList() |
1017
fc1c13db9618
Renamed ConfigurationValueBag to Configuration and added a pointer to it into HierarchyElement. This helps with the fight against global variables.
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
138 | { |
1432
4cc687851fbb
Refactored the color toolbar editing into a new model/view system
Teemu Piippo <teemu@hecknology.net>
parents:
1406
diff
changeset
|
139 | return config::quickColorToolbar(); |
1043 | 140 | } |
1297
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
141 | |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
142 | |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
143 | void setColorButton(QPushButton* button, LDColor color) |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
144 | { |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
145 | if (color.isValid()) |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
146 | { |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
147 | button->setFlat(true); |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
148 | button->setText(color.name()); |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
149 | button->setStyleSheet(format("background-color: %1", color.hexcode())); |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
150 | button->setStyleSheet(format("color: %1", color.edgeColor().name())); |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
151 | } |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
152 | else |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
153 | { |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
154 | button->setFlat(false); |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
155 | button->setText(""); |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
156 | button->setStyleSheet(""); |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
157 | } |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
158 | } |
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
159 | |
1298
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
160 | void editObject(MainWindow* parent, LDObject* object) |
1297
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
161 | { |
1298
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
162 | if (object->type() == LDObjectType::SubfileReference) |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
163 | { |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
164 | LDSubfileReference* reference = static_cast<LDSubfileReference*>(object); |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
165 | SubfileReferenceEditor editor {reference, parent}; |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
166 | editor.setPrimitivesTree(parent->primitives()); |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
167 | editor.exec(); |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
168 | } |
1406
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
169 | else if (object->type() == LDObjectType::CircularPrimitive) |
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
170 | { |
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
171 | LDCircularPrimitive* primitive = static_cast<LDCircularPrimitive*>(object); |
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
172 | CircularPrimitiveEditor editor {primitive, parent}; |
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
173 | editor.exec(); |
37fffb682d2f
Circular primitive editor complete
Teemu Piippo <teemu@hecknology.net>
parents:
1397
diff
changeset
|
174 | } |
1300 | 175 | else if (object->type() == LDObjectType::Comment) |
176 | { | |
177 | LDComment* comment = static_cast<LDComment*>(object); | |
178 | comment->setText(QInputDialog::getText( | |
179 | parent, | |
180 | QObject::tr("Edit comment"), | |
181 | QObject::tr("Comment text:"), | |
182 | QLineEdit::Normal, | |
183 | comment->text() | |
184 | )); | |
185 | } | |
1298
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
186 | else |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
187 | { |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
188 | VertexObjectEditor editor {object, parent}; |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
189 | editor.exec(); |
dbc8bb2a4d84
fixed infinite recursion and integrated the subfilereference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1297
diff
changeset
|
190 | } |
1297
389516787a4c
added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
1252
diff
changeset
|
191 | } |