src/insets/inseturl.C
src/insets/insetwrap.C
src/insets/render_graphic.C
+src/insets/render_preview.C
src/ispell.C
src/kbsequence.C
src/lengthcommon.C
+2003-10-27 Juergen Spitzmueller <j.spitzmueller@gmx.de>
+
+ * ControlDocument.[Ch]: add method setBranchColor().
+
2003-10-13 Lars Gullik Bjønnes <larsbj@gullik.net>
* ControlCommandBuffer.C (dispatch): adjust for dispatch change
#include "language.h"
#include "lyxtextclasslist.h"
#include "paragraph.h"
+#include "funcrequest.h"
+#include "lfuns.h"
+#include "LColor.h"
#include "frontends/Alert.h"
#include "frontends/LyXView.h"
}
+void ControlDocument::setBranchColor(string const & branch, string const & hex)
+{
+ lcolor.setColor(branch, hex);
+ string const s = branch + ' ' + hex;
+ lv_.dispatch(FuncRequest(LFUN_SET_COLOR, s));
+}
+
+
void ControlDocument::classApply()
{
BufferParams & params = buffer()->params();
///
void setLanguage();
///
+ void setBranchColor(std::string const & branch, std::string const & hex);
+ ///
LyXTextClass textClass();
///
BufferParams & params();
+2003-10-27 Juergen Spitzmueller <j.spitzmueller@gmx.de>
+
+ * QDocument.[Ch]:
+ * QDocumentDialog.[Ch]: Fix color setting of branches.
+
2003-10-23 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* Dialogs.C:
#include "support/lstrings.h"
#include "lyxtextclasslist.h"
#include "floatplacement.h"
+#include "LColor.h"
#include <qpushbutton.h>
#include <qmultilineedit.h>
using lyx::support::bformat;
+using lyx::support::getVectorFromString;
using std::vector;
using std::string;
params.headsep = widgetsToLength(m->headsepLE, m->headsepUnit);
params.footskip = widgetsToLength(m->footskipLE, m->footskipUnit);
+
+ // branches
+ string const all_branches = params.branchlist().allBranches();
+ if (!all_branches.empty()) {
+ std::vector<string> all = getVectorFromString(all_branches, "|");
+ for (unsigned i = 0; i < all.size(); ++i) {
+ string const current_branch = all[i].c_str();
+ string x11hexname = params.branchlist().getColor(current_branch);
+ // check that we have a valid color!
+ if (x11hexname.empty() || x11hexname[0] != '#')
+ x11hexname = lcolor.getX11Name(LColor::background);
+ // display the new color
+ controller().setBranchColor(current_branch, x11hexname);
+ }
+ }
+ if (branchlist_.empty())
+ branchlist_ = params.branchlist();
+ params.branchlist() = branchlist_;
+ branchlist_.clear();
}
BufferParams & params = cntrl.params();
string const all_branches = params.branchlist().allBranches();
- string const all_selected = params.branchlist().allSelected();
branchesModule->branchesLV->clear();
if (!all_branches.empty()) {
std::vector<string> all = getVectorFromString(all_branches, "|");
newItem->setPixmap(2, coloritem);
}
}
+ form_->branchlist_ = params.branchlist();
form_->changed();
}
sel_branch = selItem->text(0);
if (sel_branch) {
QColor initial;
- string x11hexname = params.branchlist().getColor(fromqstr(sel_branch));
+ string current_branch = fromqstr(sel_branch);
+ string x11hexname = params.branchlist().getColor(current_branch);
if (x11hexname[0] == '#')
initial.setNamedColor(toqstr(x11hexname));
QColor ncol(QColorDialog::getColor(initial));
if (ncol.isValid()){
- // FIXME: The color does not apply unless buffer restart
- // XForms has this hack. What can we do?
- // lyxColorHandler->getGCForeground(c);
- // lyxColorHandler->updateColor(c);
- params.branchlist().setColor(fromqstr(sel_branch), fromqstr(ncol.name()));
+ // add the color to the branchlist
+ params.branchlist().setColor(current_branch, fromqstr(ncol.name()));
branchesModule->newBranchLE->clear();
updateBranchView();
}