* Licence details can be found in the file COPYING.
*
* \author Edwin Leuven
- * \author Richard Heck (modules)
+ * \author Richard Kimberly Heck (modules)
*
* Full author contact details are available in file CREDITS.
*/
#include "LayoutModuleList.h"
#include "LyXRC.h"
#include "ModuleList.h"
-#include "OutputParams.h"
#include "PDFOptions.h"
#include "qt_helpers.h"
#include "Session.h"
#include "VSpace.h"
#include "insets/InsetListingsParams.h"
+#include "insets/InsetQuotes.h"
#include "support/debug.h"
#include "support/docstream.h"
#include <QTextBoundaryFinder>
#include <QTextCursor>
-#include <algorithm>
#include <sstream>
#include <vector>
-#ifdef IN
-#undef IN
-#endif
-
// a style sheet for buttons
// this is for example used for the background color setting button
lyx::RGBColor set_fontcolor;
bool is_fontcolor;
lyx::RGBColor set_notefontcolor;
+bool is_notefontcolor;
lyx::RGBColor set_boxbgcolor;
+bool is_boxbgcolor;
bool forced_fontspec_activation;
} // anonymous namespace
modulesModule->availableLV, SLOT(setFocus()));
#else
connect(filter_, &FancyLineEdit::downPressed,
- modulesModule->availableLV, [=](){ focusAndHighlight(modulesModule->availableLV); });
+ modulesModule->availableLV, [this](){ focusAndHighlight(modulesModule->availableLV); });
#endif
item->setData(m.name, Qt::DisplayRole);
item->setData(toqstr(m.id), Qt::UserRole);
item->setData(m.description, Qt::ToolTipRole);
+ item->setEditable(false);
if (m.local)
item->setIcon(user_icon);
else
marginsModule->marginCB->setChecked(!bp_.use_geometry);
setCustomMargins(!bp_.use_geometry);
}
+
+ // set some placeholder text that hint on defaults
+ QString const placeholder = marginsModule->marginCB->isChecked() ?
+ qt_("Class defaults") : qt_("Package defaults");
+ // set tooltip depending on gemoetry state
+ QString const tooltip = marginsModule->marginCB->isChecked() ?
+ qt_("If no value is given, the defaults as set by the class are used.")
+ : qt_("If no value is given, the defaults as set by the geometry package or a package/class overriding geometry's defaults are used.");
+ marginsModule->topLE->setPlaceholderText(placeholder);
+ marginsModule->bottomLE->setPlaceholderText(placeholder);
+ marginsModule->innerLE->setPlaceholderText(placeholder);
+ marginsModule->outerLE->setPlaceholderText(placeholder);
+ marginsModule->headheightLE->setPlaceholderText(placeholder);
+ marginsModule->headsepLE->setPlaceholderText(placeholder);
+ marginsModule->footskipLE->setPlaceholderText(placeholder);
+ marginsModule->columnsepLE->setPlaceholderText(placeholder);
+ marginsModule->topLE->setToolTip(tooltip);
+ marginsModule->bottomLE->setToolTip(tooltip);
+ marginsModule->innerLE->setToolTip(tooltip);
+ marginsModule->outerLE->setToolTip(tooltip);
+ marginsModule->headheightLE->setToolTip(tooltip);
+ marginsModule->headsepLE->setToolTip(tooltip);
+ marginsModule->footskipLE->setToolTip(tooltip);
+ marginsModule->columnsepLE->setToolTip(tooltip);
}
marginsModule->columnsepL->setEnabled(enableColSep);
marginsModule->columnsepLE->setEnabled(enableColSep);
marginsModule->columnsepUnit->setEnabled(enableColSep);
+
+ // set some placeholder text that hint on defaults
+ QString const placeholder = marginsModule->marginCB->isChecked() ?
+ qt_("Class defaults") : qt_("Package defaults");
+ // set tooltip depending on gemoetry state
+ QString const tooltip = marginsModule->marginCB->isChecked() ?
+ qt_("If no value is given, the defaults as set by the class are used.")
+ : qt_("If no value is given, the defaults as set by the geometry package or a package/class overriding geometry's defaults are used.");
+ marginsModule->topLE->setPlaceholderText(placeholder);
+ marginsModule->bottomLE->setPlaceholderText(placeholder);
+ marginsModule->innerLE->setPlaceholderText(placeholder);
+ marginsModule->outerLE->setPlaceholderText(placeholder);
+ marginsModule->headheightLE->setPlaceholderText(placeholder);
+ marginsModule->headsepLE->setPlaceholderText(placeholder);
+ marginsModule->footskipLE->setPlaceholderText(placeholder);
+ marginsModule->columnsepLE->setPlaceholderText(placeholder);
+ marginsModule->topLE->setToolTip(tooltip);
+ marginsModule->bottomLE->setToolTip(tooltip);
+ marginsModule->innerLE->setToolTip(tooltip);
+ marginsModule->outerLE->setToolTip(tooltip);
+ marginsModule->headheightLE->setToolTip(tooltip);
+ marginsModule->headsepLE->setToolTip(tooltip);
+ marginsModule->footskipLE->setToolTip(tooltip);
+ marginsModule->columnsepLE->setToolTip(tooltip);
+
}
colorButtonStyleSheet(newColor));
// save color
set_notefontcolor = rgbFromHexName(fromqstr(newColor.name()));
+ is_notefontcolor = true;
change_adaptor();
}
theApp()->getRgbColor(Color_greyedouttext, set_notefontcolor);
colorModule->noteFontColorPB->setStyleSheet(
colorButtonStyleSheet(rgb2qcolor(set_notefontcolor)));
+ is_notefontcolor = false;
change_adaptor();
}
colorButtonStyleSheet(newColor));
// save color
set_boxbgcolor = rgbFromHexName(fromqstr(newColor.name()));
+ is_boxbgcolor = true;
change_adaptor();
}
theApp()->getRgbColor(Color_shadedbg, set_boxbgcolor);
colorModule->boxBackgroundPB->setStyleSheet(
colorButtonStyleSheet(rgb2qcolor(set_boxbgcolor)));
+ is_boxbgcolor = false;
change_adaptor();
}
fromqstr(langModule->languageCO->itemData(
langModule->languageCO->currentIndex()).toString()));
- InsetQuotesParams::QuoteStyle def = bp_.getQuoteStyle(lang->quoteStyle());
+ QuoteStyle def = bp_.getQuoteStyle(lang->quoteStyle());
langModule->quoteStyleCO->clear();
bool has_default = false;
for (int i = 0; i < quoteparams.stylescount(); ++i) {
- InsetQuotesParams::QuoteStyle qs = InsetQuotesParams::QuoteStyle(i);
- if (qs == InsetQuotesParams::DynamicQuotes)
+ QuoteStyle qs = QuoteStyle(i);
+ if (qs == QuoteStyle::Dynamic)
continue;
bool const langdef = (qs == def);
if (langdef) {
// add the default style on top
langModule->quoteStyleCO->insertItem(0,
- toqstr(quoteparams.getGuiLabel(qs, langdef)), qs);
+ toqstr(quoteparams.getGuiLabel(qs, langdef)), static_cast<int>(qs));
has_default = true;
}
else
langModule->quoteStyleCO->addItem(
- toqstr(quoteparams.getGuiLabel(qs, langdef)), qs);
+ toqstr(quoteparams.getGuiLabel(qs, langdef)), static_cast<int>(qs));
}
if (set && has_default)
// (re)set to the default style
<< toqstr(system);
for (int i = 0; i < dirs.size(); ++i) {
- QString const dir = dirs.at(i);
+ QString const & dir = dirs.at(i);
QDirIterator it(dir, QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
QString fn = QFileInfo(it.next()).fileName();
// this should never happen
bp_.inputenc = "utf8";
}
- bp_.quotes_style = (InsetQuotesParams::QuoteStyle) langModule->quoteStyleCO->itemData(
- langModule->quoteStyleCO->currentIndex()).toInt();
+ bp_.quotes_style = QuoteStyle(langModule->quoteStyleCO->itemData(
+ langModule->quoteStyleCO->currentIndex()).toInt());
bp_.dynamic_quotes = langModule->dynamicQuotesCB->isChecked();
QString const langname = langModule->languageCO->itemData(
bp_.fontcolor = set_fontcolor;
bp_.isfontcolor = is_fontcolor;
bp_.notefontcolor = set_notefontcolor;
+ bp_.isnotefontcolor = is_notefontcolor;
bp_.boxbgcolor = set_boxbgcolor;
+ bp_.isboxbgcolor = is_boxbgcolor;
// numbering
if (bp_.documentClass().hasTocLevels()) {
updateQuoteStyles();
langModule->quoteStyleCO->setCurrentIndex(
- langModule->quoteStyleCO->findData(bp_.quotes_style));
+ langModule->quoteStyleCO->findData(static_cast<int>(bp_.quotes_style)));
langModule->dynamicQuotesCB->setChecked(bp_.dynamic_quotes);
// LaTeX input encoding: set after the fonts (see below)
colorModule->noteFontColorPB->setStyleSheet(
colorButtonStyleSheet(rgb2qcolor(bp_.notefontcolor)));
set_notefontcolor = bp_.notefontcolor;
+ is_notefontcolor = bp_.isnotefontcolor;
if (bp_.isbackgroundcolor) {
colorModule->backgroundPB->setStyleSheet(
colorModule->boxBackgroundPB->setStyleSheet(
colorButtonStyleSheet(rgb2qcolor(bp_.boxbgcolor)));
set_boxbgcolor = bp_.boxbgcolor;
+ is_boxbgcolor = bp_.isboxbgcolor;
// numbering
int const min_toclevel = documentClass().min_toclevel();
// clear changed branches cache
changedBranches_.clear();
+ // re-initiate module filter
+ if (!filter_->text().isEmpty())
+ moduleFilterPressed();
+
// reset trackers
nonModuleChanged_ = false;
shellescapeChanged_ = false;
FileName const master_file = support::makeAbsPath(params().master,
support::onlyPath(buffer().absFileName()));
if (isLyXFileName(master_file.absFileName())) {
- Buffer * master = checkAndLoadLyXFile(master_file);
+ Buffer * master = checkAndLoadLyXFile(master_file, true);
if (master) {
if (master->isChild(const_cast<Buffer *>(&buffer())))
const_cast<Buffer &>(buffer()).setParent(master);
for (; it != end; ++it) {
docstring const & current_branch = it->branch();
Branch const * branch = branchlist.find(current_branch);
- string const x11hexname = X11hexname(branch->color());
+ string const bcolor = branch->color();
+ RGBColor rgbcol;
+ if (bcolor.size() == 7 && bcolor[0] == '#')
+ rgbcol = lyx::rgbFromHexName(bcolor);
+ else
+ guiApp->getRgbColor(lcolor.getFromLyXName(bcolor), rgbcol);
+ string const x11hexname = X11hexname(rgbcol);
// display the new color
docstring const str = current_branch + ' ' + from_ascii(x11hexname);
dispatch(FuncRequest(LFUN_SET_COLOR, str));
}
-
-Dialog * createGuiDocument(GuiView & lv) { return new GuiDocument(lv); }
-
-
} // namespace frontend
} // namespace lyx