bc().setCancel(closePB);
bc().setRestore(restorePB);
- textLayoutModule = new UiWidget<Ui::TextLayoutUi>;
+
// text layout
+ textLayoutModule = new UiWidget<Ui::TextLayoutUi>;
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)),
bc().addCheckedLineEdit(textLayoutModule->indentLE);
bc().addCheckedLineEdit(textLayoutModule->skipLE);
+
// master/child handling
masterChildModule = new UiWidget<Ui::MasterChildUi>;
masterChildModule->childrenTW->resizeColumnToContents(1);
masterChildModule->childrenTW->resizeColumnToContents(2);
+
// output
outputModule = new UiWidget<Ui::OutputUi>;
connect(outputModule->defaultFormatCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
+
// fonts
fontModule = new UiWidget<Ui::FontUi>;
connect(fontModule->fontsRomanCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(fontModule->fontOsfCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
- connect(fontModule->noteFontColorPB, SIGNAL(clicked()),
- this, SLOT(changeNoteFontColor()));
- connect(fontModule->delNoteFontColorTB, SIGNAL(clicked()),
- this, SLOT(deleteNoteFontColor()));
updateFontlist();
qt_(GuiDocument::fontfamilies_gui[n]));
- pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
// page layout
+ pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(papersizeChanged(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(pageLayoutModule->pagestyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
- connect(pageLayoutModule->backgroundPB, SIGNAL(clicked()),
- this, SLOT(changeBackgroundColor()));
- connect(pageLayoutModule->delbackgroundTB, SIGNAL(clicked()),
- this, SLOT(deleteBackgroundColor()));
-
+
pageLayoutModule->pagestyleCO->addItem(qt_("Default"));
pageLayoutModule->pagestyleCO->addItem(qt_("empty"));
pageLayoutModule->pagestyleCO->addItem(qt_("plain"));
bc().addCheckedLineEdit(pageLayoutModule->paperwidthLE,
pageLayoutModule->paperwidthL);
- // paper
QComboBox * cb = pageLayoutModule->papersizeCO;
cb->addItem(qt_("Default"));
cb->addItem(qt_("Custom"));
pageLayoutModule->paperwidthLE));
- marginsModule = new UiWidget<Ui::MarginsUi>;
// margins
+ marginsModule = new UiWidget<Ui::MarginsUi>;
connect(marginsModule->marginCB, SIGNAL(toggled(bool)),
this, SLOT(setCustomMargins(bool)));
connect(marginsModule->marginCB, SIGNAL(clicked()),
marginsModule->columnsepL);
- langModule = new UiWidget<Ui::LanguageUi>;
// language & quote
+ langModule = new UiWidget<Ui::LanguageUi>;
connect(langModule->languageCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(langModule->defaultencodingRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(langModule->quoteStyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
- // language & quotes
+
QAbstractItemModel * language_model = guiApp->languageModel();
// FIXME: it would be nice if sorting was enabled/disabled via a checkbox.
language_model->sort(0);
langModule->quoteStyleCO->addItem(qt_(">>text<<"));
- numberingModule = new UiWidget<Ui::NumberingUi>;
+ // color
+ colorModule = new UiWidget<Ui::ColorUi>;
+ connect(colorModule->noteFontColorPB, SIGNAL(clicked()),
+ this, SLOT(changeNoteFontColor()));
+ connect(colorModule->delNoteFontColorTB, SIGNAL(clicked()),
+ this, SLOT(deleteNoteFontColor()));
+ connect(colorModule->backgroundPB, SIGNAL(clicked()),
+ this, SLOT(changeBackgroundColor()));
+ connect(colorModule->delbackgroundTB, SIGNAL(clicked()),
+ this, SLOT(deleteBackgroundColor()));
+
+
// numbering
+ numberingModule = new UiWidget<Ui::NumberingUi>;
connect(numberingModule->depthSL, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(numberingModule->tocSL, SIGNAL(valueChanged(int)),
numberingModule->tocTW->headerItem()->setText(2, qt_("Appears in TOC"));
+ // biblio
biblioModule = new UiWidget<Ui::BiblioUi>;
connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)),
biblioModule->citationStyleL, SLOT(setEnabled(bool)));
connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)),
biblioModule->citeStyleCO, SLOT(setEnabled(bool)));
- // biblio
connect(biblioModule->citeDefaultRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(biblioModule->citeNatbibRB, SIGNAL(clicked()),
this, SLOT(bibtexChanged(int)));
connect(biblioModule->bibtexOptionsED, SIGNAL(textChanged(QString)),
this, SLOT(change_adaptor()));
- // biblio
+
biblioModule->citeStyleCO->addItem(qt_("Author-year"));
biblioModule->citeStyleCO->addItem(qt_("Numerical"));
biblioModule->citeStyleCO->setCurrentIndex(0);
biblioModule->bibtexCO->clear();
-
biblioModule->bibtexCO->addItem(qt_("Default"), QString("default"));
for (set<string>::const_iterator it = lyxrc.bibtex_alternatives.begin();
it != lyxrc.bibtex_alternatives.end(); ++it) {
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
biblioModule->bibtexCO->addItem(command, command);
}
+
// indices
indicesModule = new GuiIndices;
this, SLOT(change_adaptor()));
+ // maths
mathsModule = new UiWidget<Ui::MathsUi>;
connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)),
mathsModule->amsCB, SLOT(setDisabled(bool)));
mathsModule->esintCB, SLOT(setDisabled(bool)));
connect(mathsModule->mhchemautoCB, SIGNAL(toggled(bool)),
mathsModule->mhchemCB, SLOT(setDisabled(bool)));
- // maths
+
connect(mathsModule->amsCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(mathsModule->amsautoCB, SIGNAL(clicked()),
connect(mathsModule->mhchemautoCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
- latexModule = new UiWidget<Ui::LaTeXUi>;
+
// latex class
+ latexModule = new UiWidget<Ui::LaTeXUi>;
connect(latexModule->optionsLE, SIGNAL(textChanged(QString)),
this, SLOT(change_adaptor()));
connect(latexModule->defaultOptionsCB, SIGNAL(clicked()),
classes_model_.insertRow(i, toqstr(item), *cit);
}
+
// branches
branchesModule = new GuiBranches;
connect(branchesModule, SIGNAL(changed()),
this, SLOT(branchesRename(docstring const &, docstring const &)));
updateUnknownBranches();
+
// preamble
preambleModule = new PreambleModule;
connect(preambleModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
+
// bullets
bulletsModule = new BulletsModule;
connect(bulletsModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
+
// Modules
modulesModule = new UiWidget<Ui::ModulesUi>;
modulesModule->availableLV->header()->setVisible(false);
connect(selectionManager, SIGNAL(selectionChanged()),
this, SLOT(modulesChanged()));
+
// PDF support
pdfSupportModule = new UiWidget<Ui::PDFSupportUi>;
-
connect(pdfSupportModule->use_hyperrefGB, SIGNAL(toggled(bool)),
this, SLOT(change_adaptor()));
connect(pdfSupportModule->titleLE, SIGNAL(textChanged(QString)),
for (int i = 0; backref_opts[i][0]; ++i)
pdfSupportModule->backrefCO->addItem(qt_(backref_opts_gui[i]));
+
// float
floatModule = new FloatPlacement;
connect(floatModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
+
// listings
listingsModule = new UiWidget<Ui::ListingsSettingsUi>;
connect(listingsModule->listingsED, SIGNAL(textChanged()),
listingsModule->listingsTB->setPlainText(
qt_("Input listings parameters below. Enter ? for a list of parameters."));
+
+ // add the panels
docPS->addPanel(latexModule, qt_("Document Class"));
docPS->addPanel(masterChildModule, qt_("Child Documents"));
docPS->addPanel(modulesModule, qt_("Modules"));
docPS->addPanel(pageLayoutModule, qt_("Page Layout"));
docPS->addPanel(marginsModule, qt_("Page Margins"));
docPS->addPanel(langModule, qt_("Language"));
+ docPS->addPanel(colorModule, qt_("Colors"));
docPS->addPanel(numberingModule, qt_("Numbering & TOC"));
docPS->addPanel(biblioModule, qt_("Bibliography"));
docPS->addPanel(indicesModule, qt_("Indexes"));
marginsModule->columnsepUnit->setEnabled(enableColSep);
}
+
void GuiDocument::changeBackgroundColor()
{
QColor const & newColor = QColorDialog::getColor(
if (!newColor.isValid())
return;
// set the button color
- pageLayoutModule->backgroundPB->setStyleSheet(
+ colorModule->backgroundPB->setStyleSheet(
colorButtonStyleSheet(newColor));
// save color
set_backgroundcolor = rgbFromHexName(fromqstr(newColor.name()));
void GuiDocument::deleteBackgroundColor()
{
// set the button color back to white
- pageLayoutModule->backgroundPB->setStyleSheet(
+ colorModule->backgroundPB->setStyleSheet(
colorButtonStyleSheet(QColor(Qt::white)));
// save white as the set color
set_backgroundcolor = rgbFromHexName("#ffffff");
if (!newColor.isValid())
return;
// set the button color
- fontModule->noteFontColorPB->setStyleSheet(
+ colorModule->noteFontColorPB->setStyleSheet(
colorButtonStyleSheet(newColor));
// save color
set_notefontcolor = rgbFromHexName(fromqstr(newColor.name()));
void GuiDocument::deleteNoteFontColor()
{
// set the button color back to light gray
- fontModule->noteFontColorPB->setStyleSheet(
+ colorModule->noteFontColorPB->setStyleSheet(
colorButtonStyleSheet(QColor(204, 204, 204, 255)));
// save light gray as the set color
set_notefontcolor = rgbFromHexName("#cccccc");
langModule->languageCO->currentIndex()).toString();
bp_.language = lyx::languages.getLanguage(fromqstr(lang));
+ //color
+ bp_.backgroundcolor = set_backgroundcolor;
+ bp_.notefontcolor = set_notefontcolor;
+
// numbering
if (bp_.documentClass().hasTocLevels()) {
bp_.tocdepth = numberingModule->tocSL->value();
else
bp_.orientation = ORIENTATION_PORTRAIT;
- bp_.backgroundcolor = set_backgroundcolor;
- bp_.notefontcolor = set_notefontcolor;
-
// margins
bp_.use_geometry = !marginsModule->marginCB->isChecked()
|| geom_papersize;
langModule->defaultencodingRB->setChecked(default_enc);
langModule->otherencodingRB->setChecked(!default_enc);
+ //color
+ colorModule->noteFontColorPB->setStyleSheet(
+ colorButtonStyleSheet(rgb2qcolor(bp_.notefontcolor)));
+ set_notefontcolor = bp_.notefontcolor;
+ colorModule->backgroundPB->setStyleSheet(
+ colorButtonStyleSheet(rgb2qcolor(bp_.backgroundcolor)));
+ set_backgroundcolor = bp_.backgroundcolor;
+
// numbering
int const min_toclevel = documentClass().min_toclevel();
int const max_toclevel = documentClass().max_toclevel();
fontModule->fontOsfCB->setChecked(bp_.fontsOSF);
fontModule->scaleSansSB->setValue(bp_.fontsSansScale);
fontModule->scaleTypewriterSB->setValue(bp_.fontsTypewriterScale);
- fontModule->noteFontColorPB->setStyleSheet(
- colorButtonStyleSheet(rgb2qcolor(bp_.notefontcolor)));
- set_notefontcolor = bp_.notefontcolor;
-
+
int nn = findToken(GuiDocument::fontfamilies, bp_.fontsDefaultFamily);
if (nn >= 0)
fontModule->fontsDefaultCO->setCurrentIndex(nn);
pageLayoutModule->facingPagesCB->setChecked(
bp_.sides == TwoSides);
- pageLayoutModule->backgroundPB->setStyleSheet(
- colorButtonStyleSheet(rgb2qcolor(bp_.backgroundcolor)));
- set_backgroundcolor = bp_.backgroundcolor;
-
lengthToWidgets(pageLayoutModule->paperwidthLE,
pageLayoutModule->paperwidthUnitCO, bp_.paperwidth, defaultUnit);
lengthToWidgets(pageLayoutModule->paperheightLE,
--- /dev/null
+<ui version="4.0">
+ <class>ColorUi</class>
+ <widget class="QWidget" name="ColorUi">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>404</width>
+ <height>216</height>
+ </rect>
+ </property>
+ <property name="contextMenuPolicy">
+ <enum>Qt::DefaultContextMenu</enum>
+ </property>
+ <property name="windowTitle">
+ <string>ColorUi</string>
+ </property>
+ <property name="toolTip">
+ <string/>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="fontcolorGB">
+ <property name="title">
+ <string>Font colors</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="noteFontColorLA">
+ <property name="text">
+ <string>Font color for
+greyed-out notes:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QPushButton" name="noteFontColorPB">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Click to change the color</string>
+ </property>
+ <property name="text">
+ <string>&Change...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="delNoteFontColorTB">
+ <property name="minimumSize">
+ <size>
+ <width>23</width>
+ <height>23</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Revert the color to the default</string>
+ </property>
+ <property name="text">
+ <string>R&eset</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextOnly</enum>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::LeftArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="backgroundGB">
+ <property name="title">
+ <string>Background colors</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Background Color:</string>
+ </property>
+ <property name="buddy">
+ <cstring>backgroundPB</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QPushButton" name="backgroundPB">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Click to change the color</string>
+ </property>
+ <property name="text">
+ <string>&Change...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="delbackgroundTB">
+ <property name="minimumSize">
+ <size>
+ <width>23</width>
+ <height>23</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Revert the color to the default</string>
+ </property>
+ <property name="text">
+ <string>R&eset</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextOnly</enum>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::LeftArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>126</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <includes>
+ <include location="local">qt_i18n.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>