forked from qt-creator/qt-creator
TextEditor: inline colorschemeedit.ui
Change-Id: I8a0d129fca74940eeb28860a0b69476f2b459e22 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -45,7 +45,7 @@ add_qtc_plugin(TextEditor
|
||||
codestyleselectorwidget.cpp codestyleselectorwidget.h
|
||||
colorpreviewhoverhandler.cpp colorpreviewhoverhandler.h
|
||||
colorscheme.cpp colorscheme.h
|
||||
colorschemeedit.cpp colorschemeedit.h colorschemeedit.ui
|
||||
colorschemeedit.cpp colorschemeedit.h
|
||||
command.cpp command.h
|
||||
commentssettings.cpp commentssettings.h
|
||||
completionsettings.cpp completionsettings.h
|
||||
|
@@ -24,33 +24,35 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "colorschemeedit.h"
|
||||
#include "ui_colorschemeedit.h"
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QColorDialog>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QGridLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QListView>
|
||||
#include <QSpacerItem>
|
||||
#include <QToolButton>
|
||||
|
||||
using namespace TextEditor;
|
||||
using namespace TextEditor::Internal;
|
||||
namespace TextEditor::Internal {
|
||||
|
||||
namespace {
|
||||
const int layoutSpacing = 6;
|
||||
} // namespace
|
||||
|
||||
static inline QString colorButtonStyleSheet(const QColor &bgColor)
|
||||
static QString colorButtonStyleSheet(const QColor &bgColor)
|
||||
{
|
||||
if (bgColor.isValid()) {
|
||||
QString rc = QLatin1String("border: 2px solid black; border-radius: 2px; background:");
|
||||
rc += bgColor.name();
|
||||
return rc;
|
||||
}
|
||||
return QLatin1String("border: 2px dotted black; border-radius: 2px;");
|
||||
QString rc("border-width: 2px; border-radius: 2px; border-color: black; ");
|
||||
rc += bgColor.isValid() ? "border-style: solid; background:" + bgColor.name() + ";"
|
||||
: QString("border-style: dotted;");
|
||||
return rc;
|
||||
}
|
||||
|
||||
namespace TextEditor {
|
||||
namespace Internal {
|
||||
|
||||
class FormatsModel : public QAbstractListModel
|
||||
{
|
||||
public:
|
||||
@@ -142,58 +144,158 @@ private:
|
||||
QFont m_baseFont;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace TextEditor
|
||||
|
||||
ColorSchemeEdit::ColorSchemeEdit(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
m_ui(new Ui::ColorSchemeEdit),
|
||||
m_formatsModel(new FormatsModel(this))
|
||||
{
|
||||
setContentsMargins(0, layoutSpacing, 0, 0);
|
||||
m_ui->setupUi(this);
|
||||
m_ui->detailsScrollArea->viewport()->setAutoFillBackground(false);
|
||||
m_ui->scrollAreaWidgetContents->setAutoFillBackground(false);
|
||||
m_ui->itemList->setModel(m_formatsModel);
|
||||
m_ui->builtinSchemeLabel->setVisible(m_readOnly);
|
||||
resize(513, 416);
|
||||
|
||||
auto colorButton = [] () {
|
||||
auto tb = new QToolButton;
|
||||
tb->setMinimumWidth(56);
|
||||
return tb;
|
||||
};
|
||||
|
||||
auto eraseButton = [] (const QString &toolTip) {
|
||||
auto tb = new QToolButton;
|
||||
tb->setText("x");
|
||||
tb->setToolTip(toolTip);
|
||||
tb->setArrowType(Qt::LeftArrow);
|
||||
return tb;
|
||||
};
|
||||
|
||||
auto headlineLabel = [] (const QString &text) {
|
||||
auto l = new QLabel(text);
|
||||
l->setContentsMargins(0, layoutSpacing * 2, 0, layoutSpacing / 2);
|
||||
QFont font = l->font();
|
||||
font.setBold(true);
|
||||
l->setFont(font);
|
||||
return l;
|
||||
};
|
||||
|
||||
auto spinBox = [] () {
|
||||
auto sb = new QDoubleSpinBox;
|
||||
sb->setMinimum(-1.);
|
||||
sb->setMaximum(1.);
|
||||
sb->setSingleStep(0.05);
|
||||
return sb;
|
||||
};
|
||||
|
||||
m_itemList = new QListView(this);
|
||||
m_itemList->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
m_itemList->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
m_itemList->setUniformItemSizes(true);
|
||||
|
||||
m_builtinSchemeLabel = new QLabel(
|
||||
tr("<p align='center'><b>Builtin color schemes need to be <a href=\"copy\">copied</a><br/>"
|
||||
" before they can be changed</b></p>"));
|
||||
m_builtinSchemeLabel->setScaledContents(false);
|
||||
|
||||
m_fontProperties = new QWidget;
|
||||
//m_fontProperties->setContentsMargins(0, 0, 0, 0);
|
||||
m_fontProperties->setMinimumWidth(212);
|
||||
|
||||
m_foregroundLabel = new QLabel(tr("Foreground:"));
|
||||
m_foregroundToolButton = colorButton();
|
||||
m_eraseForegroundToolButton = eraseButton(tr("Erase foreground."));
|
||||
m_backgroundLabel = new QLabel(tr("Background:"));
|
||||
m_backgroundToolButton = colorButton();
|
||||
m_eraseBackgroundToolButton = eraseButton(tr("Erase background."));
|
||||
|
||||
m_relativeForegroundHeadline = headlineLabel(tr("Relative Foreground"));
|
||||
m_foregroundSaturationLabel = new QLabel(tr("Saturation:"));
|
||||
m_foregroundSaturationSpinBox = spinBox();
|
||||
m_foregroundLightnessLabel = new QLabel(tr("Lightness:"));
|
||||
m_foregroundLightnessSpinBox = spinBox();
|
||||
|
||||
m_relativeBackgroundHeadline = headlineLabel(tr("Relative Background"));
|
||||
m_backgroundSaturationLabel = new QLabel(tr("Saturation:"));
|
||||
m_backgroundSaturationSpinBox = spinBox();
|
||||
m_backgroundLightnessLabel = new QLabel(tr("Lightness:"));
|
||||
m_backgroundLightnessSpinBox = spinBox();
|
||||
|
||||
m_fontHeadline = headlineLabel(tr("Font"));
|
||||
m_boldCheckBox = new QCheckBox(tr("Bold"));
|
||||
m_italicCheckBox = new QCheckBox(tr("Italic"));
|
||||
|
||||
m_underlineHeadline = headlineLabel(tr("Underline"));
|
||||
m_underlineLabel = new QLabel(tr("Color:"));
|
||||
m_underlineColorToolButton = colorButton();
|
||||
m_eraseUnderlineColorToolButton = eraseButton(tr("Erase background."));
|
||||
m_underlineComboBox = new QComboBox;
|
||||
|
||||
m_itemList->setModel(m_formatsModel);
|
||||
m_builtinSchemeLabel->setVisible(m_readOnly);
|
||||
|
||||
auto bottomSpacer = new QWidget;
|
||||
bottomSpacer->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding);
|
||||
|
||||
using namespace Utils::Layouting;
|
||||
|
||||
Row {
|
||||
m_itemList,
|
||||
m_builtinSchemeLabel,
|
||||
m_fontProperties,
|
||||
}.attachTo(this, false);
|
||||
|
||||
Grid {
|
||||
m_foregroundLabel, m_foregroundToolButton, m_eraseForegroundToolButton, br,
|
||||
m_backgroundLabel, m_backgroundToolButton, m_eraseBackgroundToolButton, br,
|
||||
|
||||
Span {3, m_relativeForegroundHeadline}, br,
|
||||
m_foregroundSaturationLabel, Span {2, m_foregroundSaturationSpinBox}, br,
|
||||
m_foregroundLightnessLabel, Span {2, m_foregroundLightnessSpinBox}, br,
|
||||
|
||||
Span {3, m_relativeBackgroundHeadline}, br,
|
||||
m_backgroundSaturationLabel, Span {2, m_backgroundSaturationSpinBox}, br,
|
||||
m_backgroundLightnessLabel, Span {2, m_backgroundLightnessSpinBox}, br,
|
||||
|
||||
Span {3, m_fontHeadline}, br,
|
||||
Span {3, Row {m_boldCheckBox, m_italicCheckBox, st}}, br,
|
||||
|
||||
Span {3, m_underlineHeadline}, br,
|
||||
m_underlineLabel, m_underlineColorToolButton, m_eraseUnderlineColorToolButton, br,
|
||||
|
||||
Span {3, m_underlineComboBox}, br,
|
||||
|
||||
bottomSpacer, br,
|
||||
}.attachTo(m_fontProperties);
|
||||
|
||||
populateUnderlineStyleComboBox();
|
||||
|
||||
connect(m_ui->itemList->selectionModel(), &QItemSelectionModel::currentRowChanged,
|
||||
connect(m_itemList->selectionModel(), &QItemSelectionModel::currentRowChanged,
|
||||
this, &ColorSchemeEdit::currentItemChanged);
|
||||
connect(m_ui->foregroundToolButton, &QAbstractButton::clicked,
|
||||
connect(m_foregroundToolButton, &QAbstractButton::clicked,
|
||||
this, &ColorSchemeEdit::changeForeColor);
|
||||
connect(m_ui->backgroundToolButton, &QAbstractButton::clicked,
|
||||
connect(m_backgroundToolButton, &QAbstractButton::clicked,
|
||||
this, &ColorSchemeEdit::changeBackColor);
|
||||
connect(m_ui->eraseBackgroundToolButton, &QAbstractButton::clicked,
|
||||
connect(m_eraseBackgroundToolButton, &QAbstractButton::clicked,
|
||||
this, &ColorSchemeEdit::eraseBackColor);
|
||||
connect(m_ui->eraseForegroundToolButton, &QAbstractButton::clicked,
|
||||
connect(m_eraseForegroundToolButton, &QAbstractButton::clicked,
|
||||
this, &ColorSchemeEdit::eraseForeColor);
|
||||
connect(m_ui->foregroundSaturationSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
connect(m_foregroundSaturationSpinBox, &QDoubleSpinBox::valueChanged,
|
||||
this, &ColorSchemeEdit::changeRelativeForeColor);
|
||||
connect(m_ui->foregroundLightnessSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
connect(m_foregroundLightnessSpinBox, &QDoubleSpinBox::valueChanged,
|
||||
this, &ColorSchemeEdit::changeRelativeForeColor);
|
||||
connect(m_ui->backgroundSaturationSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
connect(m_backgroundSaturationSpinBox, &QDoubleSpinBox::valueChanged,
|
||||
this, &ColorSchemeEdit::changeRelativeBackColor);
|
||||
connect(m_ui->backgroundLightnessSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
connect(m_backgroundLightnessSpinBox, &QDoubleSpinBox::valueChanged,
|
||||
this, &ColorSchemeEdit::changeRelativeBackColor);
|
||||
connect(m_ui->boldCheckBox, &QAbstractButton::toggled,
|
||||
connect(m_boldCheckBox, &QAbstractButton::toggled,
|
||||
this, &ColorSchemeEdit::checkCheckBoxes);
|
||||
connect(m_ui->italicCheckBox, &QAbstractButton::toggled,
|
||||
connect(m_italicCheckBox, &QAbstractButton::toggled,
|
||||
this, &ColorSchemeEdit::checkCheckBoxes);
|
||||
connect(m_ui->underlineColorToolButton, &QToolButton::clicked,
|
||||
connect(m_underlineColorToolButton, &QToolButton::clicked,
|
||||
this, &ColorSchemeEdit::changeUnderlineColor);
|
||||
connect(m_ui->eraseUnderlineColorToolButton, &QToolButton::clicked,
|
||||
connect(m_eraseUnderlineColorToolButton, &QToolButton::clicked,
|
||||
this, &ColorSchemeEdit::eraseUnderlineColor);
|
||||
connect(m_ui->underlineComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
connect(m_underlineComboBox, &QComboBox::currentIndexChanged,
|
||||
this, &ColorSchemeEdit::changeUnderlineStyle);
|
||||
connect(m_ui->builtinSchemeLabel, &QLabel::linkActivated, this, &ColorSchemeEdit::copyScheme);
|
||||
connect(m_builtinSchemeLabel, &QLabel::linkActivated, this, &ColorSchemeEdit::copyScheme);
|
||||
}
|
||||
|
||||
ColorSchemeEdit::~ColorSchemeEdit()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
ColorSchemeEdit::~ColorSchemeEdit() = default;
|
||||
|
||||
void ColorSchemeEdit::setFormatDescriptions(const FormatDescriptions &descriptions)
|
||||
{
|
||||
@@ -201,7 +303,7 @@ void ColorSchemeEdit::setFormatDescriptions(const FormatDescriptions &descriptio
|
||||
m_formatsModel->setFormatDescriptions(&m_descriptions);
|
||||
|
||||
if (!m_descriptions.empty())
|
||||
m_ui->itemList->setCurrentIndex(m_formatsModel->index(0));
|
||||
m_itemList->setCurrentIndex(m_formatsModel->index(0));
|
||||
}
|
||||
|
||||
void ColorSchemeEdit::setBaseFont(const QFont &font)
|
||||
@@ -216,8 +318,8 @@ void ColorSchemeEdit::setReadOnly(bool readOnly)
|
||||
|
||||
m_readOnly = readOnly;
|
||||
|
||||
m_ui->detailsScrollArea->setVisible(!readOnly);
|
||||
m_ui->builtinSchemeLabel->setVisible(readOnly);
|
||||
m_fontProperties->setVisible(!readOnly);
|
||||
m_builtinSchemeLabel->setVisible(readOnly);
|
||||
updateControls();
|
||||
}
|
||||
|
||||
@@ -261,14 +363,13 @@ void ColorSchemeEdit::updateForegroundControls()
|
||||
bool isVisible = !m_readOnly
|
||||
&& formatDescription.showControl(FormatDescription::ShowForegroundControl);
|
||||
|
||||
m_ui->relativeForegroundHeadline->setEnabled(isVisible);
|
||||
m_ui->foregroundLabel->setVisible(isVisible);
|
||||
m_ui->foregroundToolButton->setVisible(isVisible);
|
||||
m_ui->eraseForegroundToolButton->setVisible(isVisible);
|
||||
m_ui->foregroundSpacer->setVisible(isVisible);
|
||||
m_relativeForegroundHeadline->setEnabled(isVisible);
|
||||
m_foregroundLabel->setVisible(isVisible);
|
||||
m_foregroundToolButton->setVisible(isVisible);
|
||||
m_eraseForegroundToolButton->setVisible(isVisible);
|
||||
|
||||
m_ui->foregroundToolButton->setStyleSheet(colorButtonStyleSheet(format.foreground()));
|
||||
m_ui->eraseForegroundToolButton->setEnabled(!m_readOnly
|
||||
m_foregroundToolButton->setStyleSheet(colorButtonStyleSheet(format.foreground()));
|
||||
m_eraseForegroundToolButton->setEnabled(!m_readOnly
|
||||
&& m_curItem > 0
|
||||
&& format.foreground().isValid());
|
||||
}
|
||||
@@ -281,14 +382,13 @@ void ColorSchemeEdit::updateBackgroundControls()
|
||||
bool isVisible = !m_readOnly
|
||||
&& formatDescription.showControl(FormatDescription::ShowBackgroundControl);
|
||||
|
||||
m_ui->relativeBackgroundHeadline->setVisible(isVisible);
|
||||
m_ui->backgroundLabel->setVisible(isVisible);
|
||||
m_ui->backgroundToolButton->setVisible(isVisible);
|
||||
m_ui->eraseBackgroundToolButton->setVisible(isVisible);
|
||||
m_ui->backgroundSpacer->setVisible(isVisible);
|
||||
m_relativeBackgroundHeadline->setVisible(isVisible);
|
||||
m_backgroundLabel->setVisible(isVisible);
|
||||
m_backgroundToolButton->setVisible(isVisible);
|
||||
m_eraseBackgroundToolButton->setVisible(isVisible);
|
||||
|
||||
m_ui->backgroundToolButton->setStyleSheet(colorButtonStyleSheet(format.background()));
|
||||
m_ui->eraseBackgroundToolButton->setEnabled(!m_readOnly
|
||||
m_backgroundToolButton->setStyleSheet(colorButtonStyleSheet(format.background()));
|
||||
m_eraseBackgroundToolButton->setEnabled(!m_readOnly
|
||||
&& m_curItem > 0
|
||||
&& format.background().isValid());
|
||||
}
|
||||
@@ -298,31 +398,28 @@ void ColorSchemeEdit::updateRelativeForegroundControls()
|
||||
const auto &formatDescription = m_descriptions[m_curItem];
|
||||
const Format &format = m_scheme.formatFor(formatDescription.id());
|
||||
|
||||
QSignalBlocker saturationSignalBlocker(m_ui->foregroundSaturationSpinBox);
|
||||
QSignalBlocker lightnessSignalBlocker(m_ui->foregroundLightnessSpinBox);
|
||||
QSignalBlocker saturationSignalBlocker(m_foregroundSaturationSpinBox);
|
||||
QSignalBlocker lightnessSignalBlocker(m_foregroundLightnessSpinBox);
|
||||
|
||||
bool isVisible = !m_readOnly
|
||||
&& formatDescription.showControl(FormatDescription::ShowRelativeForegroundControl);
|
||||
|
||||
m_ui->relativeForegroundHeadline->setVisible(isVisible);
|
||||
m_ui->foregroundSaturationLabel->setVisible(isVisible);
|
||||
m_ui->foregroundLightnessLabel->setVisible(isVisible);
|
||||
m_ui->foregroundSaturationSpinBox->setVisible(isVisible);
|
||||
m_ui->foregroundLightnessSpinBox->setVisible(isVisible);
|
||||
m_ui->relativeForegroundSpacer1->setVisible(isVisible);
|
||||
m_ui->relativeForegroundSpacer2->setVisible(isVisible);
|
||||
m_ui->relativeForegroundSpacer3->setVisible(isVisible);
|
||||
m_relativeForegroundHeadline->setVisible(isVisible);
|
||||
m_foregroundSaturationLabel->setVisible(isVisible);
|
||||
m_foregroundLightnessLabel->setVisible(isVisible);
|
||||
m_foregroundSaturationSpinBox->setVisible(isVisible);
|
||||
m_foregroundLightnessSpinBox->setVisible(isVisible);
|
||||
|
||||
bool isEnabled = !m_readOnly && !format.foreground().isValid();
|
||||
|
||||
m_ui->relativeForegroundHeadline->setEnabled(isEnabled);
|
||||
m_ui->foregroundSaturationLabel->setEnabled(isEnabled);
|
||||
m_ui->foregroundLightnessLabel->setEnabled(isEnabled);
|
||||
m_ui->foregroundSaturationSpinBox->setEnabled(isEnabled);
|
||||
m_ui->foregroundLightnessSpinBox->setEnabled(isEnabled);
|
||||
m_relativeForegroundHeadline->setEnabled(isEnabled);
|
||||
m_foregroundSaturationLabel->setEnabled(isEnabled);
|
||||
m_foregroundLightnessLabel->setEnabled(isEnabled);
|
||||
m_foregroundSaturationSpinBox->setEnabled(isEnabled);
|
||||
m_foregroundLightnessSpinBox->setEnabled(isEnabled);
|
||||
|
||||
m_ui->foregroundSaturationSpinBox->setValue(format.relativeForegroundSaturation());
|
||||
m_ui->foregroundLightnessSpinBox->setValue(format.relativeForegroundLightness());
|
||||
m_foregroundSaturationSpinBox->setValue(format.relativeForegroundSaturation());
|
||||
m_foregroundLightnessSpinBox->setValue(format.relativeForegroundLightness());
|
||||
}
|
||||
|
||||
void ColorSchemeEdit::updateRelativeBackgroundControls()
|
||||
@@ -330,31 +427,28 @@ void ColorSchemeEdit::updateRelativeBackgroundControls()
|
||||
const auto &formatDescription = m_descriptions[m_curItem];
|
||||
const Format &format = m_scheme.formatFor(formatDescription.id());
|
||||
|
||||
QSignalBlocker saturationSignalBlocker(m_ui->backgroundSaturationSpinBox);
|
||||
QSignalBlocker lightnessSignalBlocker(m_ui->backgroundLightnessSpinBox);
|
||||
QSignalBlocker saturationSignalBlocker(m_backgroundSaturationSpinBox);
|
||||
QSignalBlocker lightnessSignalBlocker(m_backgroundLightnessSpinBox);
|
||||
|
||||
bool isVisible = !m_readOnly
|
||||
&& formatDescription.showControl(FormatDescription::ShowRelativeBackgroundControl);
|
||||
|
||||
m_ui->relativeBackgroundHeadline->setVisible(isVisible);
|
||||
m_ui->backgroundSaturationLabel->setVisible(isVisible);
|
||||
m_ui->backgroundLightnessLabel->setVisible(isVisible);
|
||||
m_ui->backgroundSaturationSpinBox->setVisible(isVisible);
|
||||
m_ui->backgroundLightnessSpinBox->setVisible(isVisible);
|
||||
m_ui->relativeBackgroundSpacer1->setVisible(isVisible);
|
||||
m_ui->relativeBackgroundSpacer2->setVisible(isVisible);
|
||||
m_ui->relativeBackgroundSpacer3->setVisible(isVisible);
|
||||
m_relativeBackgroundHeadline->setVisible(isVisible);
|
||||
m_backgroundSaturationLabel->setVisible(isVisible);
|
||||
m_backgroundLightnessLabel->setVisible(isVisible);
|
||||
m_backgroundSaturationSpinBox->setVisible(isVisible);
|
||||
m_backgroundLightnessSpinBox->setVisible(isVisible);
|
||||
|
||||
bool isEnabled = !m_readOnly && !format.background().isValid();
|
||||
|
||||
m_ui->relativeBackgroundHeadline->setEnabled(isEnabled);
|
||||
m_ui->backgroundSaturationLabel->setEnabled(isEnabled);
|
||||
m_ui->backgroundLightnessLabel->setEnabled(isEnabled);
|
||||
m_ui->backgroundSaturationSpinBox->setEnabled(isEnabled);
|
||||
m_ui->backgroundLightnessSpinBox->setEnabled(isEnabled);
|
||||
m_relativeBackgroundHeadline->setEnabled(isEnabled);
|
||||
m_backgroundSaturationLabel->setEnabled(isEnabled);
|
||||
m_backgroundLightnessLabel->setEnabled(isEnabled);
|
||||
m_backgroundSaturationSpinBox->setEnabled(isEnabled);
|
||||
m_backgroundLightnessSpinBox->setEnabled(isEnabled);
|
||||
|
||||
m_ui->backgroundSaturationSpinBox->setValue(format.relativeBackgroundSaturation());
|
||||
m_ui->backgroundLightnessSpinBox->setValue(format.relativeBackgroundLightness());
|
||||
m_backgroundSaturationSpinBox->setValue(format.relativeBackgroundSaturation());
|
||||
m_backgroundLightnessSpinBox->setValue(format.relativeBackgroundLightness());
|
||||
}
|
||||
|
||||
void ColorSchemeEdit::updateFontControls()
|
||||
@@ -362,20 +456,18 @@ void ColorSchemeEdit::updateFontControls()
|
||||
const auto formatDescription = m_descriptions[m_curItem];
|
||||
const Format &format = m_scheme.formatFor(formatDescription.id());
|
||||
|
||||
QSignalBlocker boldSignalBlocker(m_ui->boldCheckBox);
|
||||
QSignalBlocker italicSignalBlocker(m_ui->italicCheckBox);
|
||||
QSignalBlocker boldSignalBlocker(m_boldCheckBox);
|
||||
QSignalBlocker italicSignalBlocker(m_italicCheckBox);
|
||||
|
||||
bool isVisible = !m_readOnly
|
||||
&& formatDescription.showControl(FormatDescription::ShowFontControls);
|
||||
|
||||
m_ui->fontHeadline->setVisible(isVisible);
|
||||
m_ui->boldCheckBox->setVisible(isVisible);
|
||||
m_ui->italicCheckBox->setVisible(isVisible);
|
||||
m_ui->fontSpacer1->setVisible(isVisible);
|
||||
m_ui->fontSpacer2->setVisible(isVisible);
|
||||
m_fontHeadline->setVisible(isVisible);
|
||||
m_boldCheckBox->setVisible(isVisible);
|
||||
m_italicCheckBox->setVisible(isVisible);
|
||||
|
||||
m_ui->boldCheckBox->setChecked(format.bold());
|
||||
m_ui->italicCheckBox->setChecked(format.italic());
|
||||
m_boldCheckBox->setChecked(format.bold());
|
||||
m_italicCheckBox->setChecked(format.italic());
|
||||
|
||||
}
|
||||
|
||||
@@ -384,25 +476,23 @@ void ColorSchemeEdit::updateUnderlineControls()
|
||||
const auto formatDescription = m_descriptions[m_curItem];
|
||||
const Format &format = m_scheme.formatFor(formatDescription.id());
|
||||
|
||||
QSignalBlocker comboBoxSignalBlocker(m_ui->underlineComboBox);
|
||||
QSignalBlocker comboBoxSignalBlocker(m_underlineComboBox);
|
||||
|
||||
bool isVisible = !m_readOnly
|
||||
&& formatDescription.showControl(FormatDescription::ShowUnderlineControl);
|
||||
|
||||
m_ui->underlineHeadline->setVisible(isVisible);
|
||||
m_ui->underlineLabel->setVisible(isVisible);
|
||||
m_ui->underlineColorToolButton->setVisible(isVisible);
|
||||
m_ui->eraseUnderlineColorToolButton->setVisible(isVisible);
|
||||
m_ui->underlineComboBox->setVisible(isVisible);
|
||||
m_ui->underlineSpacer1->setVisible(isVisible);
|
||||
m_ui->underlineSpacer2->setVisible(isVisible);
|
||||
m_underlineHeadline->setVisible(isVisible);
|
||||
m_underlineLabel->setVisible(isVisible);
|
||||
m_underlineColorToolButton->setVisible(isVisible);
|
||||
m_eraseUnderlineColorToolButton->setVisible(isVisible);
|
||||
m_underlineComboBox->setVisible(isVisible);
|
||||
|
||||
m_ui->underlineColorToolButton->setStyleSheet(colorButtonStyleSheet(format.underlineColor()));
|
||||
m_ui->eraseUnderlineColorToolButton->setEnabled(!m_readOnly
|
||||
m_underlineColorToolButton->setStyleSheet(colorButtonStyleSheet(format.underlineColor()));
|
||||
m_eraseUnderlineColorToolButton->setEnabled(!m_readOnly
|
||||
&& m_curItem > 0
|
||||
&& format.underlineColor().isValid());
|
||||
int index = m_ui->underlineComboBox->findData(QVariant::fromValue(int(format.underlineStyle())));
|
||||
m_ui->underlineComboBox->setCurrentIndex(index);
|
||||
int index = m_underlineComboBox->findData(QVariant::fromValue(int(format.underlineStyle())));
|
||||
m_underlineComboBox->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
void ColorSchemeEdit::changeForeColor()
|
||||
@@ -410,13 +500,13 @@ void ColorSchemeEdit::changeForeColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
QColor color = m_scheme.formatFor(m_descriptions[m_curItem].id()).foreground();
|
||||
const QColor newColor = QColorDialog::getColor(color, m_ui->boldCheckBox->window());
|
||||
const QColor newColor = QColorDialog::getColor(color, m_boldCheckBox->window());
|
||||
if (!newColor.isValid())
|
||||
return;
|
||||
m_ui->foregroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_ui->eraseForegroundToolButton->setEnabled(true);
|
||||
m_foregroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_eraseForegroundToolButton->setEnabled(true);
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setForeground(newColor);
|
||||
m_formatsModel->emitDataChanged(index);
|
||||
@@ -430,13 +520,13 @@ void ColorSchemeEdit::changeBackColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
QColor color = m_scheme.formatFor(m_descriptions[m_curItem].id()).background();
|
||||
const QColor newColor = QColorDialog::getColor(color, m_ui->boldCheckBox->window());
|
||||
const QColor newColor = QColorDialog::getColor(color, m_boldCheckBox->window());
|
||||
if (!newColor.isValid())
|
||||
return;
|
||||
m_ui->backgroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_ui->eraseBackgroundToolButton->setEnabled(true);
|
||||
m_backgroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_eraseBackgroundToolButton->setEnabled(true);
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setBackground(newColor);
|
||||
m_formatsModel->emitDataChanged(index);
|
||||
@@ -453,10 +543,10 @@ void ColorSchemeEdit::eraseBackColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
QColor newColor;
|
||||
m_ui->backgroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_ui->eraseBackgroundToolButton->setEnabled(false);
|
||||
m_backgroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_eraseBackgroundToolButton->setEnabled(false);
|
||||
|
||||
const QList<QModelIndex> indexes = m_ui->itemList->selectionModel()->selectedRows();
|
||||
const QList<QModelIndex> indexes = m_itemList->selectionModel()->selectedRows();
|
||||
for (const QModelIndex &index : indexes) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setBackground(newColor);
|
||||
@@ -471,10 +561,10 @@ void ColorSchemeEdit::eraseForeColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
QColor newColor;
|
||||
m_ui->foregroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_ui->eraseForegroundToolButton->setEnabled(false);
|
||||
m_foregroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_eraseForegroundToolButton->setEnabled(false);
|
||||
|
||||
const QList<QModelIndex> indexes = m_ui->itemList->selectionModel()->selectedRows();
|
||||
const QList<QModelIndex> indexes = m_itemList->selectionModel()->selectedRows();
|
||||
for (const QModelIndex &index : indexes) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setForeground(newColor);
|
||||
@@ -489,10 +579,10 @@ void ColorSchemeEdit::changeRelativeForeColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
|
||||
double saturation = m_ui->foregroundSaturationSpinBox->value();
|
||||
double lightness = m_ui->foregroundLightnessSpinBox->value();
|
||||
double saturation = m_foregroundSaturationSpinBox->value();
|
||||
double lightness = m_foregroundLightnessSpinBox->value();
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setRelativeForegroundSaturation(saturation);
|
||||
m_scheme.formatFor(category).setRelativeForegroundLightness(lightness);
|
||||
@@ -505,10 +595,10 @@ void ColorSchemeEdit::changeRelativeBackColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
|
||||
double saturation = m_ui->backgroundSaturationSpinBox->value();
|
||||
double lightness = m_ui->backgroundLightnessSpinBox->value();
|
||||
double saturation = m_backgroundSaturationSpinBox->value();
|
||||
double lightness = m_backgroundLightnessSpinBox->value();
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setRelativeBackgroundSaturation(saturation);
|
||||
m_scheme.formatFor(category).setRelativeBackgroundLightness(lightness);
|
||||
@@ -521,10 +611,10 @@ void ColorSchemeEdit::eraseRelativeForeColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
|
||||
m_ui->foregroundSaturationSpinBox->setValue(0.0);
|
||||
m_ui->foregroundLightnessSpinBox->setValue(0.0);
|
||||
m_foregroundSaturationSpinBox->setValue(0.0);
|
||||
m_foregroundLightnessSpinBox->setValue(0.0);
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setRelativeForegroundSaturation(0.0);
|
||||
m_scheme.formatFor(category).setRelativeForegroundLightness(0.0);
|
||||
@@ -537,10 +627,10 @@ void ColorSchemeEdit::eraseRelativeBackColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
|
||||
m_ui->backgroundSaturationSpinBox->setValue(0.0);
|
||||
m_ui->backgroundLightnessSpinBox->setValue(0.0);
|
||||
m_backgroundSaturationSpinBox->setValue(0.0);
|
||||
m_backgroundLightnessSpinBox->setValue(0.0);
|
||||
|
||||
const QList<QModelIndex> indexes = m_ui->itemList->selectionModel()->selectedRows();
|
||||
const QList<QModelIndex> indexes = m_itemList->selectionModel()->selectedRows();
|
||||
for (const QModelIndex &index : indexes) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setRelativeBackgroundSaturation(0.0);
|
||||
@@ -554,10 +644,10 @@ void ColorSchemeEdit::checkCheckBoxes()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setBold(m_ui->boldCheckBox->isChecked());
|
||||
m_scheme.formatFor(category).setItalic(m_ui->italicCheckBox->isChecked());
|
||||
m_scheme.formatFor(category).setBold(m_boldCheckBox->isChecked());
|
||||
m_scheme.formatFor(category).setItalic(m_italicCheckBox->isChecked());
|
||||
m_formatsModel->emitDataChanged(index);
|
||||
}
|
||||
}
|
||||
@@ -567,13 +657,13 @@ void ColorSchemeEdit::changeUnderlineColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
QColor color = m_scheme.formatFor(m_descriptions[m_curItem].id()).underlineColor();
|
||||
const QColor newColor = QColorDialog::getColor(color, m_ui->boldCheckBox->window());
|
||||
const QColor newColor = QColorDialog::getColor(color, m_boldCheckBox->window());
|
||||
if (!newColor.isValid())
|
||||
return;
|
||||
m_ui->underlineColorToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_ui->eraseUnderlineColorToolButton->setEnabled(true);
|
||||
m_underlineColorToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_eraseUnderlineColorToolButton->setEnabled(true);
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setUnderlineColor(newColor);
|
||||
m_formatsModel->emitDataChanged(index);
|
||||
@@ -585,10 +675,10 @@ void ColorSchemeEdit::eraseUnderlineColor()
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
QColor newColor;
|
||||
m_ui->underlineColorToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_ui->eraseUnderlineColorToolButton->setEnabled(false);
|
||||
m_underlineColorToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
|
||||
m_eraseUnderlineColorToolButton->setEnabled(false);
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
m_scheme.formatFor(category).setUnderlineColor(newColor);
|
||||
m_formatsModel->emitDataChanged(index);
|
||||
@@ -600,9 +690,9 @@ void ColorSchemeEdit::changeUnderlineStyle(int comboBoxIndex)
|
||||
if (m_curItem == -1)
|
||||
return;
|
||||
|
||||
for (const QModelIndex &index : m_ui->itemList->selectionModel()->selectedRows()) {
|
||||
for (const QModelIndex &index : m_itemList->selectionModel()->selectedRows()) {
|
||||
const TextStyle category = m_descriptions[index.row()].id();
|
||||
auto value = m_ui->underlineComboBox->itemData(comboBoxIndex);
|
||||
const QVariant value = m_underlineComboBox->itemData(comboBoxIndex);
|
||||
auto enumeratorIndex = static_cast<QTextCharFormat::UnderlineStyle>(value.toInt());
|
||||
m_scheme.formatFor(category).setUnderlineStyle(enumeratorIndex);
|
||||
m_formatsModel->emitDataChanged(index);
|
||||
@@ -613,23 +703,25 @@ void ColorSchemeEdit::setItemListBackground(const QColor &color)
|
||||
{
|
||||
QPalette pal;
|
||||
pal.setColor(QPalette::Base, color);
|
||||
m_ui->itemList->setPalette(pal);
|
||||
m_itemList->setPalette(pal);
|
||||
}
|
||||
|
||||
void ColorSchemeEdit::populateUnderlineStyleComboBox()
|
||||
{
|
||||
m_ui->underlineComboBox->addItem(tr("No Underline"),
|
||||
m_underlineComboBox->addItem(tr("No Underline"),
|
||||
QVariant::fromValue(int(QTextCharFormat::NoUnderline)));
|
||||
m_ui->underlineComboBox->addItem(tr("Single Underline"),
|
||||
m_underlineComboBox->addItem(tr("Single Underline"),
|
||||
QVariant::fromValue(int(QTextCharFormat::SingleUnderline)));
|
||||
m_ui->underlineComboBox->addItem(tr("Wave Underline"),
|
||||
m_underlineComboBox->addItem(tr("Wave Underline"),
|
||||
QVariant::fromValue(int(QTextCharFormat::WaveUnderline)));
|
||||
m_ui->underlineComboBox->addItem(tr("Dot Underline"),
|
||||
m_underlineComboBox->addItem(tr("Dot Underline"),
|
||||
QVariant::fromValue(int(QTextCharFormat::DotLine)));
|
||||
m_ui->underlineComboBox->addItem(tr("Dash Underline"),
|
||||
m_underlineComboBox->addItem(tr("Dash Underline"),
|
||||
QVariant::fromValue(int(QTextCharFormat::DashUnderline)));
|
||||
m_ui->underlineComboBox->addItem(tr("Dash-Dot Underline"),
|
||||
m_underlineComboBox->addItem(tr("Dash-Dot Underline"),
|
||||
QVariant::fromValue(int(QTextCharFormat::DashDotLine)));
|
||||
m_ui->underlineComboBox->addItem(tr("Dash-Dot-Dot Underline"),
|
||||
m_underlineComboBox->addItem(tr("Dash-Dot-Dot Underline"),
|
||||
QVariant::fromValue(int(QTextCharFormat::DashDotDotLine)));
|
||||
}
|
||||
|
||||
} // TextEditor::Internal
|
||||
|
@@ -31,13 +31,17 @@
|
||||
#include <QDialog>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class QDoubleSpinBox;
|
||||
class QLabel;
|
||||
class QListView;
|
||||
class QModelIndex;
|
||||
class QScrollArea;
|
||||
class QToolButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace TextEditor {
|
||||
namespace Internal {
|
||||
|
||||
namespace Ui { class ColorSchemeEdit; }
|
||||
namespace TextEditor::Internal {
|
||||
|
||||
class FormatsModel;
|
||||
|
||||
@@ -91,11 +95,36 @@ private:
|
||||
FormatDescriptions m_descriptions;
|
||||
ColorScheme m_scheme;
|
||||
int m_curItem = -1;
|
||||
Ui::ColorSchemeEdit *m_ui;
|
||||
FormatsModel *m_formatsModel;
|
||||
bool m_readOnly = false;
|
||||
QListView *m_itemList;
|
||||
QLabel *m_builtinSchemeLabel;
|
||||
QWidget *m_fontProperties;
|
||||
QLabel *m_foregroundLabel;
|
||||
QToolButton *m_foregroundToolButton;
|
||||
QToolButton *m_eraseForegroundToolButton;
|
||||
QLabel *m_backgroundLabel;
|
||||
QToolButton *m_backgroundToolButton;
|
||||
QToolButton *m_eraseBackgroundToolButton;
|
||||
QLabel *m_relativeForegroundHeadline;
|
||||
QLabel *m_foregroundLightnessLabel;
|
||||
QDoubleSpinBox *m_foregroundLightnessSpinBox;
|
||||
QLabel *m_foregroundSaturationLabel;
|
||||
QDoubleSpinBox *m_foregroundSaturationSpinBox;
|
||||
QLabel *m_relativeBackgroundHeadline;
|
||||
QLabel *m_backgroundSaturationLabel;
|
||||
QDoubleSpinBox *m_backgroundSaturationSpinBox;
|
||||
QLabel *m_backgroundLightnessLabel;
|
||||
QDoubleSpinBox *m_backgroundLightnessSpinBox;
|
||||
QLabel *m_fontHeadline;
|
||||
QCheckBox *m_boldCheckBox;
|
||||
QCheckBox *m_italicCheckBox;
|
||||
QLabel *m_underlineHeadline;
|
||||
QLabel *m_underlineLabel;
|
||||
QToolButton *m_underlineColorToolButton;
|
||||
QToolButton *m_eraseUnderlineColorToolButton;
|
||||
QComboBox *m_underlineComboBox;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace TextEditor
|
||||
} // TextEditor::Internal
|
||||
|
@@ -1,714 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TextEditor::Internal::ColorSchemeEdit</class>
|
||||
<widget class="QWidget" name="TextEditor::Internal::ColorSchemeEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>513</width>
|
||||
<height>416</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListView" name="itemList">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="uniformItemSizes">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="builtinSchemeLabel">
|
||||
<property name="text">
|
||||
<string><p align='center'><b>Builtin color schemes need to be <a href="copy">copied</a><br/> before they can be changed</b></p></string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="detailsScrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>212</width>
|
||||
<height>390</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="30" column="0" colspan="3">
|
||||
<spacer name="spacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QWidget" name="foregroundSpacer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QToolButton" name="foregroundToolButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="foregroundLightnessLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Lightness:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="3">
|
||||
<widget class="QWidget" name="relativeForegroundSpacer3" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="foregroundSaturationLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Saturation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="0" colspan="3">
|
||||
<widget class="QWidget" name="fontSpacer1" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="0" colspan="3">
|
||||
<widget class="QWidget" name="underlineSpacer1" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="foregroundLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Foreground:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>foregroundToolButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="0">
|
||||
<widget class="QLabel" name="underlineHeadline">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Underline</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="3">
|
||||
<widget class="QLabel" name="relativeForegroundHeadline">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Relative Foreground</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="QWidget" name="relativeForegroundSpacer1" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="backgroundLightnessSpinBox">
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QToolButton" name="eraseBackgroundToolButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Erase background.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>x</string>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::LeftArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0" colspan="3">
|
||||
<widget class="QWidget" name="relativeBackgroundSpacer1" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QToolButton" name="backgroundToolButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="0">
|
||||
<widget class="QLabel" name="backgroundLightnessLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Lightness:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="3">
|
||||
<widget class="QLabel" name="relativeBackgroundHeadline">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Relative Background</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="0">
|
||||
<widget class="QLabel" name="fontHeadline">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Font</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="backgroundSaturationLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Saturation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="backgroundSaturationSpinBox">
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="2">
|
||||
<widget class="QToolButton" name="eraseUnderlineColorToolButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Erase background.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>x</string>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::LeftArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="26" column="0" colspan="3">
|
||||
<widget class="QComboBox" name="underlineComboBox"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="eraseForegroundToolButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Erase foreground.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>x</string>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::LeftArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0" colspan="3">
|
||||
<widget class="QWidget" name="relativeBackgroundSpacer2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="0">
|
||||
<widget class="QCheckBox" name="boldCheckBox">
|
||||
<property name="text">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0" colspan="3">
|
||||
<widget class="QWidget" name="relativeBackgroundSpacer3" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="1">
|
||||
<widget class="QToolButton" name="underlineColorToolButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="25" column="0" colspan="3">
|
||||
<widget class="QWidget" name="underlineSpacer2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0" colspan="3">
|
||||
<widget class="QWidget" name="fontSpacer2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="foregroundLightnessSpinBox">
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="foregroundSaturationSpinBox">
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="3">
|
||||
<widget class="QWidget" name="relativeForegroundSpacer2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="0">
|
||||
<widget class="QLabel" name="underlineLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>backgroundToolButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="backgroundLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Background:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>backgroundToolButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="italicCheckBox">
|
||||
<property name="text">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="3">
|
||||
<widget class="QWidget" name="backgroundSpacer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>itemList</tabstop>
|
||||
<tabstop>foregroundToolButton</tabstop>
|
||||
<tabstop>eraseForegroundToolButton</tabstop>
|
||||
<tabstop>backgroundToolButton</tabstop>
|
||||
<tabstop>eraseBackgroundToolButton</tabstop>
|
||||
<tabstop>boldCheckBox</tabstop>
|
||||
<tabstop>italicCheckBox</tabstop>
|
||||
<tabstop>underlineColorToolButton</tabstop>
|
||||
<tabstop>eraseUnderlineColorToolButton</tabstop>
|
||||
<tabstop>underlineComboBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@@ -49,7 +49,6 @@ Project {
|
||||
"colorscheme.h",
|
||||
"colorschemeedit.cpp",
|
||||
"colorschemeedit.h",
|
||||
"colorschemeedit.ui",
|
||||
"command.cpp",
|
||||
"command.h",
|
||||
"commentssettings.cpp",
|
||||
|
Reference in New Issue
Block a user