Skip to content
Snippets Groups Projects
Commit c5a7c48b authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Allow editing of color scheme name

parent 6684c8f1
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@
#include <QtGui/QColorDialog>
using namespace TextEditor;
using namespace TextEditor::Internal;
static inline QString colorButtonStyleSheet(const QColor &bgColor)
......@@ -57,6 +58,8 @@ EditColorSchemeDialog::EditColorSchemeDialog(const FormatDescriptions &fd,
{
m_ui->setupUi(this);
m_ui->nameEdit->setText(scheme.name());
foreach (const FormatDescription &d, fd)
m_ui->itemListWidget->addItem(d.trName());
......@@ -76,6 +79,12 @@ EditColorSchemeDialog::~EditColorSchemeDialog()
delete m_ui;
}
void EditColorSchemeDialog::accept()
{
m_scheme.setName(m_ui->nameEdit->text());
QDialog::accept();
}
void EditColorSchemeDialog::itemChanged()
{
QListWidgetItem *item = m_ui->itemListWidget->currentItem();
......
......@@ -56,6 +56,8 @@ public:
ColorScheme colorScheme() const
{ return m_scheme; }
void accept();
private slots:
void itemChanged();
void changeForeColor();
......
......@@ -6,14 +6,30 @@
<rect>
<x>0</x>
<y>0</y>
<width>462</width>
<height>416</height>
<width>494</width>
<height>571</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit Color Scheme</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Name</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="nameEdit"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
......@@ -143,29 +159,34 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Preview:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="previewTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Preview</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTextEdit" name="previewTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
......@@ -175,8 +196,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
<width>17</width>
<height>13</height>
</size>
</property>
</spacer>
......@@ -193,6 +214,16 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>nameEdit</tabstop>
<tabstop>itemListWidget</tabstop>
<tabstop>foregroundToolButton</tabstop>
<tabstop>backgroundToolButton</tabstop>
<tabstop>eraseBackgroundToolButton</tabstop>
<tabstop>boldCheckBox</tabstop>
<tabstop>italicCheckBox</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment