37,7 → 37,6 |
setEraseColor(QColor(255,255,255)); |
offs = 0; |
editor = 0; |
noUpdt = true; |
setMinimumWidth(fontMetrics().width( "No Style" )+30); |
} |
|
47,7 → 46,7 |
int st; |
QPainter p; |
p.begin(this); |
if ((editor != 0) && (noUpdt)) |
if (editor != 0) |
{ |
for (int pa = 0; pa < editor->paragraphs(); ++pa) |
{ |
58,7 → 57,6 |
p.drawLine(0, (re.y()+re.height())-offs, width()-1, (re.y()+re.height())-offs); |
if (re.y()-offs < height()) |
{ |
re.setY(re.y()-offs); |
if ((pa < static_cast<int>(editor->StyledText.count())) && (editor->StyledText.count() != 0)) |
{ |
if (editor->StyledText.at(pa)->count() > 0) |
103,11 → 101,6 |
repaint(); |
} |
|
void SideBar::setRepaint(bool r) |
{ |
noUpdt = r; |
} |
|
SEditor::SEditor(QWidget* parent, ScribusDoc *docc) : QTextEdit(parent) |
{ |
doc = docc; |
124,7 → 117,6 |
|
void SEditor::keyPressEvent(QKeyEvent *k) |
{ |
emit SideBarUp(false); |
int p, i; |
getCursorPosition(&p, &i); |
int KeyMod; |
147,7 → 139,6 |
{ |
insChars(QString(QChar(30))); |
insert("#"); |
emit SideBarUp(true); |
return; |
} |
switch (k->state()) |
185,15 → 176,11 |
conv = 32; |
insChars(QString(QChar(conv))); |
insert(QString(QChar(conv))); |
emit SideBarUp(true); |
return; |
} |
} |
else |
{ |
emit SideBarUp(true); |
return; |
} |
} |
wasMod = false; |
switch (k->key()) |
326,8 → 313,6 |
break; |
} |
QTextEdit::keyPressEvent(k); |
emit SideBarUp(true); |
emit SideBarUpdate(); |
} |
|
void SEditor::insChars(QString t) |
1041,31 → 1026,25 |
|
void SEditor::copy() |
{ |
emit SideBarUp(false); |
if ((hasSelectedText()) && (selectedText() != "")) |
{ |
tBuffer = selectedText(); |
copyStyledText(); |
} |
emit SideBarUp(true); |
} |
|
void SEditor::cut() |
{ |
copy(); |
emit SideBarUp(false); |
if (hasSelectedText()) |
{ |
deleteSel(); |
removeSelectedText(); |
} |
emit SideBarUp(true); |
emit SideBarUpdate(); |
} |
|
void SEditor::paste() |
{ |
emit SideBarUp(false); |
int p, i; |
getCursorPosition(&p, &i); |
insStyledText(); |
1072,8 → 1051,6 |
insert(tBuffer); |
for (int pa = p; pa < static_cast<int>(StyledText.count()); ++pa) |
updateFromChars(pa); |
emit SideBarUp(true); |
emit SideBarUpdate(); |
} |
|
/* Toolbar for Fill Colour */ |
1454,8 → 1431,6 |
connect(Editor, SIGNAL(copyAvailable(bool)), this, SLOT(CopyAvail(bool ))); |
connect(Editor, SIGNAL(contentsMoving(int, int)), EditorBar, SLOT(doMove(int, int))); |
connect(Editor, SIGNAL(textChanged()), EditorBar, SLOT(doRepaint())); |
connect(Editor, SIGNAL(SideBarUp(bool )), EditorBar, SLOT(setRepaint(bool ))); |
connect(Editor, SIGNAL(SideBarUpdate( )), EditorBar, SLOT(doRepaint())); |
connect(AlignTools, SIGNAL(NewStyle(int)), this, SLOT(newAlign(int))); |
connect(AlignTools, SIGNAL(NewAlign(int)), this, SLOT(newAlign(int))); |
connect(FillTools, SIGNAL(NewColor(int, int)), this, SLOT(newTxFill(int, int))); |
1905,13 → 1880,11 |
void StoryEditor::Do_paste() |
{ |
Editor->paste(); |
EditorBar->repaint(); |
} |
|
void StoryEditor::Do_cut() |
{ |
Editor->cut(); |
EditorBar->repaint(); |
} |
|
void StoryEditor::Do_del() |
1918,14 → 1891,11 |
{ |
if (Editor->StyledText.count() == 0) |
return; |
EditorBar->setRepaint(false); |
if (Editor->hasSelectedText()) |
{ |
Editor->deleteSel(); |
Editor->removeSelectedText(); |
} |
EditorBar->setRepaint(true); |
EditorBar->repaint(); |
} |
|
void StoryEditor::CopyAvail(bool u) |