| 101 | } |
| 102 | |
| 103 | DatapickerImageWidget::DatapickerImageWidget(QWidget* parent) |
| 104 | : BaseDock(parent) |
| 105 | , m_image(nullptr) { |
| 106 | ui.setupUi(this); |
| 107 | setBaseWidgets(ui.leName, ui.teComment); |
| 108 | |
| 109 | //"General"-tab |
| 110 | ui.leFileName->setClearButtonEnabled(true); |
| 111 | ui.bOpen->setIcon(QIcon::fromTheme(QStringLiteral("document-open"))); |
| 112 | ui.leFileName->setCompleter(new QCompleter(new QFileSystemModel, this)); |
| 113 | |
| 114 | //"Symbol"-tab |
| 115 | symbolWidget = new SymbolWidget(ui.tSymbol); |
| 116 | auto* gridLayout = dynamic_cast<QGridLayout*>(ui.tSymbol->layout()); |
| 117 | if (gridLayout) |
| 118 | gridLayout->addWidget(symbolWidget, 0, 0, 1, 1); |
| 119 | |
| 120 | //"Edit Image"-tab |
| 121 | auto* editTabLayout = static_cast<QGridLayout*>(ui.tEdit->layout()); |
| 122 | editTabLayout->setContentsMargins(2, 2, 2, 2); |
| 123 | editTabLayout->setHorizontalSpacing(2); |
| 124 | editTabLayout->setVerticalSpacing(4); |
| 125 | |
| 126 | ssHue = new SpanSlider(Qt::Horizontal, ui.tEdit); |
| 127 | ssHue->setRange(0, 360); |
| 128 | editTabLayout->addWidget(ssHue, 3, 2); |
| 129 | |
| 130 | ssSaturation = new SpanSlider(Qt::Horizontal, ui.tEdit); |
| 131 | ssSaturation->setRange(0, 100); |
| 132 | editTabLayout->addWidget(ssSaturation, 5, 2); |
| 133 | |
| 134 | ssValue = new SpanSlider(Qt::Horizontal, ui.tEdit); |
| 135 | ssValue->setRange(0, 100); |
| 136 | editTabLayout->addWidget(ssValue, 7, 2); |
| 137 | |
| 138 | ssIntensity = new SpanSlider(Qt::Horizontal, ui.tEdit); |
| 139 | ssIntensity->setRange(0, 100); |
| 140 | editTabLayout->addWidget(ssIntensity, 9, 2); |
| 141 | |
| 142 | ssForeground = new SpanSlider(Qt::Horizontal, ui.tEdit); |
| 143 | ssForeground->setRange(0, 100); |
| 144 | editTabLayout->addWidget(ssForeground, 11, 2); |
| 145 | |
| 146 | ui.lTernaryScale->setHidden(true); |
| 147 | ui.sbTernaryScale->setHidden(true); |
| 148 | ui.lPositionZ1->setHidden(true); |
| 149 | ui.lPositionZ2->setHidden(true); |
| 150 | ui.lPositionZ3->setHidden(true); |
| 151 | ui.sbPositionZ1->setHidden(true); |
| 152 | ui.sbPositionZ2->setHidden(true); |
| 153 | ui.sbPositionZ3->setHidden(true); |
| 154 | |
| 155 | QString valueFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("pics/colorchooser/colorchooser_value.xpm")); |
| 156 | QString hueFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("pics/colorchooser/colorchooser_hue.xpm")); |
| 157 | QString saturationFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("pics/colorchooser/colorchooser_saturation.xpm")); |
| 158 | |
| 159 | gvHue = new HistogramView(ui.tEdit, ImageEditor::colorAttributeMax(DatapickerImage::ColorAttributes::Hue)); |
| 160 | editTabLayout->addWidget(gvHue, 2, 2); |
nothing calls this directly
no test coverage detected