View Issue Details

IDProjectCategoryView StatusLast Update
0011762ScribusStory Editor / Text Framespublic2019-05-09 18:05
Reportercezaryece Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status newResolutionopen 
Product Version1.5.0 
Target VersionFixed in Version 
Summary0011762: [patch] top line for footnotes frames
DescriptionPatch provide feature of drawing line above footnotes frame as users requesting (0011625)

Working on this solution I notice that:
- it should be stroke color property in Line Style; for now I suspend adding color swatch to Notes Styles Editor as I think it is not good place for this
- frame styles are more and more urgent - I can add few additional text frame properties (like text distances) to Notes Style and make Notes Style Editor bigger and more complex, but is not good way - again - it is not good place to do it here; frames styles should be much better solution
Additional InformationPatch is against trunk/svn (not against 11282 patch).
Tags#rottenpatch, footnotes
PatchYes

Relationships

child of 0012496 acknowledged Metabug: Marks & Footnotes & Weld (1.5.0.svn) 

Activities

cezaryece

2013-10-03 10:43

developer  

footnotes_topLine.patch (27,661 bytes)
diff --git a/Scribus/scribus/notesstyles.cpp b/Scribus/scribus/notesstyles.cpp
index f4a2a91..c0ccc2e 100644
--- a/Scribus/scribus/notesstyles.cpp
+++ b/Scribus/scribus/notesstyles.cpp
@@ -18,5 +18,6 @@ bool NotesStyle::operator!=(const NotesStyle& n2)
 	        (autoRemoveEmptyNotesFrames != n2.autoRemoveEmptyNotesFrames) || (autoWeldNotesFrames != n2.autoWeldNotesFrames) ||
 	        (superscriptInMaster != n2.superscriptInMaster) || (superscriptInNote != n2.superscriptInNote) ||
 	        (marksCharStyle != n2.marksCharStyle) || (notesParaStyle != n2.notesParaStyle)
+	        || (m_topLineStyle != n2.m_topLineStyle) || (m_topLineWidth != n2.m_topLineWidth)
 	        );
 }
diff --git a/Scribus/scribus/notesstyles.h b/Scribus/scribus/notesstyles.h
index 792b50f..20288e6 100644
--- a/Scribus/scribus/notesstyles.h
+++ b/Scribus/scribus/notesstyles.h
@@ -31,7 +31,7 @@ class SCRIBUS_API NotesStyle
 public:
 	NotesStyle() : nameStr ("Default"), startNum(1), m_endNotesStyle(false), numeration(), numRange(NSRdocument), prefixStr(""), suffixStr(")"),
 		autoNotesHeight(true), autoNotesWidth(true), autoRemoveEmptyNotesFrames(true), autoWeldNotesFrames(true),
-		superscriptInNote(true), superscriptInMaster(true), marksCharStyle(""), notesParaStyle("") {}
+		superscriptInNote(true), superscriptInMaster(true), marksCharStyle(""), notesParaStyle(""), m_topLineStyle(""), m_topLineWidth(0.0) {}
 	~NotesStyle() {}
 	bool operator!=(const NotesStyle& n2);
 
@@ -67,6 +67,10 @@ public:
 	void setMarksCharStyle(const QString styleName) { marksCharStyle = styleName; }
 	const QString notesParStyle() { return notesParaStyle; }
 	void setNotesParStyle(const QString styleName) { notesParaStyle = styleName; }
+	QString topLineStyle() { return m_topLineStyle; }
+	void setTopLineStyle(const QString styleName) { m_topLineStyle = styleName; }
+	double topLineWidth() { return m_topLineWidth; }
+	void setTopLineWidth(const double w) { m_topLineWidth = w; }
 
 	void setEndNotes(bool);
 
@@ -87,6 +91,8 @@ private:
 	bool superscriptInMaster;
 	QString marksCharStyle;
 	QString notesParaStyle;
+	QString m_topLineStyle;
+	double m_topLineWidth;
 };
 
 class SCRIBUS_API TextNote : public QObject
diff --git a/Scribus/scribus/pageitem_line.h b/Scribus/scribus/pageitem_line.h
index 18fcd36..2d58871 100644
--- a/Scribus/scribus/pageitem_line.h
+++ b/Scribus/scribus/pageitem_line.h
@@ -28,13 +28,14 @@ for which a new license (GPL+exception) is in place.
 
 #include "scribusapi.h"
 #include "pageitem.h"
+
 class ScPainter;
 class ScribusDoc;
 
 class SCRIBUS_API PageItem_Line : public PageItem
 {
 	Q_OBJECT
-
+friend class PageItem_NoteFrame;
 public:
 	PageItem_Line(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
 	PageItem_Line(const PageItem & p) : PageItem(p) {}
diff --git a/Scribus/scribus/pageitem_noteframe.cpp b/Scribus/scribus/pageitem_noteframe.cpp
index fdb04e8..74d799e 100644
--- a/Scribus/scribus/pageitem_noteframe.cpp
+++ b/Scribus/scribus/pageitem_noteframe.cpp
@@ -1,4 +1,5 @@
 #include <QMessageBox>
+#include "pageitem_line.h"
 #include "pageitem_noteframe.h"
 #include "pageitem_textframe.h"
 #include "pageitem.h"
@@ -6,6 +7,7 @@
 #include "scribusdoc.h"
 #include "undomanager.h"
 #include "util_text.h"
+#include "util_math.h"
 
 #include <cmath>
 
@@ -14,6 +16,7 @@ PageItem_NoteFrame::PageItem_NoteFrame(NotesStyle *nStyle, ScribusDoc *doc, doub
 {
 	m_nstyle = nStyle;
 	m_masterFrame = NULL;
+	m_topLine = NULL;
 	itemText.clear();
 
 	AnName = generateUniqueCopyName(nStyle->isEndNotes() ? tr("Endnote frame ") + m_nstyle->name() : tr("Footnote frame ") + m_nstyle->name(), false);
@@ -66,12 +69,14 @@ PageItem_NoteFrame::PageItem_NoteFrame(ScribusDoc *doc, double x, double y, doub
 	textFlowModeVal = TextFlowUsesFrameShape;
 	deleteIt = false;
 	l_notes.empty();
+	m_topLine = NULL;
 }
 
 PageItem_NoteFrame::PageItem_NoteFrame(PageItem_TextFrame* inFrame, NotesStyle *nStyle) : PageItem_TextFrame(inFrame->doc(),inFrame->xPos(), inFrame->yPos(),inFrame->width(), inFrame->height(),inFrame->lineWidth(), inFrame->fillColor(), inFrame->lineColor())
 {
 	m_nstyle = nStyle;
 	m_masterFrame = inFrame;
+	m_topLine = NULL;
 
 	AnName = generateUniqueCopyName(nStyle->isEndNotes() ? tr("Endnote frame ") + m_nstyle->name() : tr("Footnote frame ") + m_nstyle->name(), false);
 	AutoName = false;
@@ -131,6 +136,12 @@ PageItem_NoteFrame::PageItem_NoteFrame(PageItem_TextFrame* inFrame, NotesStyle *
 	l_notes.empty();
 }
 
+PageItem_NoteFrame::~PageItem_NoteFrame()
+{
+	if (m_topLine != NULL)
+		delete m_topLine;
+}
+
 void PageItem_NoteFrame::setNS(NotesStyle *nStyle, PageItem_TextFrame* master)
 {
 	m_nstyle = nStyle;
@@ -190,6 +201,7 @@ void PageItem_NoteFrame::layout()
 	//while layouting notes frames undo should be disabled
 	UndoManager::instance()->setUndoEnabled(false);
 
+	updateTopLine();
 	if (m_nstyle->isAutoNotesWidth() && (m_width != m_masterFrame->width()))
 	{
 		oldWidth = m_width = m_masterFrame->width();
@@ -272,6 +284,36 @@ void PageItem_NoteFrame::insertNote(TextNote *note)
 	itemText.insert(itemText.length(), story);
 }
 
+void PageItem_NoteFrame::updateTopLine()
+{
+	UndoManager::instance()->setUndoEnabled(false);
+	if (isequiv(m_nstyle->topLineWidth(),0.0))
+	{
+		if (m_topLine)
+			delete m_topLine;
+	}
+	else
+	{
+		if (m_topLine == NULL)
+		{
+			m_topLine = new PageItem_Line(m_Doc, xPos(), yPos(), width() * (notesStyle()->topLineWidth()), 0, m_Doc->itemToolPrefs().lineWidth, CommonStrings::None, m_Doc->itemToolPrefs().lineColor);
+			m_topLine->setLocked(true);
+		}
+		else
+			m_topLine->setXYPos(xPos(), yPos());
+		m_topLine->setWidth(width() * (notesStyle()->topLineWidth()));
+		m_topLine->setFillColor(CommonStrings::None);
+		if (notesStyle()->topLineStyle() != "" && notesStyle()->topLineStyle() != tr("No Style"))
+		{
+			m_topLine->setCustomLineStyle(notesStyle()->topLineStyle());
+
+			multiLine ml = m_Doc->MLineStyles[notesStyle()->topLineStyle()];
+			m_topLine->setHeight(ml.at(0).Width);
+		}
+	}
+	UndoManager::instance()->setUndoEnabled(true);
+}
+
 void PageItem_NoteFrame::updateNotes(QList<TextNote*> nList, bool clear)
 {
 	if (nList == l_notes && !clear)
@@ -421,3 +463,10 @@ int PageItem_NoteFrame::findNoteCpos(TextNote* note)
 	}
 	return -1;
 }
+
+void PageItem_NoteFrame::DrawObj_Item(ScPainter *p, QRectF e)
+{
+	PageItem_TextFrame::DrawObj_Item(p,e);
+	if (m_topLine)
+		m_topLine->DrawObj_Item(p,e);
+}
diff --git a/Scribus/scribus/pageitem_noteframe.h b/Scribus/scribus/pageitem_noteframe.h
index 36bcd13..c8672c7 100644
--- a/Scribus/scribus/pageitem_noteframe.h
+++ b/Scribus/scribus/pageitem_noteframe.h
@@ -14,7 +14,7 @@ private:
 	PageItem_NoteFrame(NotesStyle *nStyle, ScribusDoc *doc, double x, double y, double w, double h, double w2, QString fill, QString outline);
 	PageItem_NoteFrame(ScribusDoc *doc, double x, double y, double w, double h, double w2, QString fill, QString outline);
 	PageItem_NoteFrame(PageItem_TextFrame* inFrame, NotesStyle *nStyle);
-	~PageItem_NoteFrame() { }
+	~PageItem_NoteFrame();
 public:
 	virtual PageItem_NoteFrame * asNoteFrame() { return this; }
 	virtual bool isNoteFrame() const { return true; }
@@ -42,6 +42,8 @@ public:
 	bool isAutoWelded() { return m_nstyle->isAutoWeldNotesFrames(); }
 	bool isAutoHeight() { return m_nstyle->isAutoNotesHeight(); }
 	bool isAutoWidth() { return m_nstyle->isAutoNotesWidth(); }
+	bool hasTopLine() {return (m_topLine!=NULL);}
+	PageItem_Line * getTopLine() const  { return m_topLine; }
 
 	//return list of notes in noteframe
 	QList<TextNote*> notesList() { return l_notes; }
@@ -57,14 +59,18 @@ private:
 	QList<TextNote*> l_notes;
 	NotesStyle* m_nstyle;
 	PageItem_TextFrame* m_masterFrame;
+	PageItem_Line* m_topLine;
 
 	//insert note at end of text in noteframe
 	void insertNote(TextNote* note);
+	//create top line object
+	void updateTopLine();
 
 //not used???
 	//find position of note marker in text
 	int findNoteCpos(TextNote* note);
-	
+protected:
+	virtual void DrawObj_Item(ScPainter *p, QRectF e);
 };
 
 #endif // PAGEITEM_NOTEFRAME_H
diff --git a/Scribus/scribus/pdflib_core.cpp b/Scribus/scribus/pdflib_core.cpp
index c360b86..41b4cc1 100644
--- a/Scribus/scribus/pdflib_core.cpp
+++ b/Scribus/scribus/pdflib_core.cpp
@@ -60,6 +60,7 @@ for which a new license (GPL+exception) is in place.
 #include "commonstrings.h"
 #include "pageitem.h"
 #include "pageitem_textframe.h"
+#include "pageitem_noteframe.h"
 #include "pageitem_group.h"
 #include "pageitem_pathtext.h"
 #include "pageitem_table.h"
@@ -2211,6 +2212,78 @@ bool PDFLibCore::PDF_TemplatePage(const ScPage* pag, bool )
 						}
 						break;
 					case PageItem::TextFrame:
+						if (ite->isNoteFrame() && ite->asNoteFrame()->hasTopLine())
+						{
+							PageItem * topLine = (PageItem*) ite->asNoteFrame()->getTopLine();
+							if (((topLine->lineTransparency() != 0) || (topLine->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
+								PutPage(PDF_TransparenzStroke(topLine));
+							if (topLine->NamedLStyle.isEmpty())
+							{
+								if (!topLine->strokePattern().isEmpty())
+								{
+									if (topLine->patternStrokePath)
+									{
+										QPainterPath path;
+										path.moveTo(0, 0);
+										path.lineTo(topLine->width(), 0);
+										PutPage(HandleBrushPattern(topLine, path, pag, pag->pageNr()));
+									}
+									else
+									{
+										if (!PDF_PatternFillStroke(tmpOut, topLine, 1))
+											return false;
+										PutPage(tmpOut);
+										PutPage("0 0 m\n");
+										PutPage(FToStr(topLine->width())+" 0 l\n");
+										PutPage("S\n");
+									}
+								}
+								else if (topLine->GrTypeStroke > 0)
+								{
+									if (!PDF_GradientFillStroke(tmpOut, topLine, true))
+										return false;
+									PutPage("q\n");
+									PutPage(tmpOut);
+									PutPage("0 0 m\n");
+									PutPage(FToStr(topLine->width())+" 0 l\n");
+									PutPage("S\nQ\n");
+								}
+								else
+								{
+									PutPage("0 0 m\n");
+									PutPage(FToStr(topLine->width())+" 0 l\n");
+									PutPage("S\n");
+								}
+							}
+							else
+							{
+								multiLine ml = doc.MLineStyles[topLine->NamedLStyle];
+								for (int it = ml.size()-1; it > -1; it--)
+								{
+										if ((ml[it].Color != CommonStrings::None) && (ml[it].Width != 0))
+										{
+											PutPage(setStrokeMulti(&ml[it]));
+											PutPage("0 0 m\n");
+											PutPage(FToStr(topLine->width())+" 0 l\n");
+											PutPage("S\n");
+										}
+								}
+							}
+							if (ite->startArrowIndex() != 0)
+							{
+								QTransform arrowTrans;
+								arrowTrans.scale(-1,1);
+								arrowTrans.scale(topLine->startArrowScale() / 100.0, topLine->startArrowScale() / 100.0);
+								PutPage(drawArrow(topLine, arrowTrans, topLine->startArrowIndex()));
+							}
+							if (ite->endArrowIndex() != 0)
+							{
+								QTransform arrowTrans;
+								arrowTrans.translate(topLine->width(), 0);
+								arrowTrans.scale(topLine->endArrowScale() / 100.0, topLine->endArrowScale() / 100.0);
+								PutPage(drawArrow(topLine, arrowTrans, ite->endArrowIndex()));
+							}
+						}
 						break;
 					case PageItem::Line:
 						if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
@@ -3815,6 +3888,13 @@ bool PDFLibCore::PDF_ProcessItem(QString& output, PageItem* ite, const ScPage* p
 					}
 				}
 			}
+			if (ite->isNoteFrame() && ite->asNoteFrame()->hasTopLine())
+			{
+				PageItem * topLine = (PageItem*) ite->asNoteFrame()->getTopLine();
+				QString tmp2 = "";
+				if (PDF_ProcessItem(tmp2, topLine, pag, PNr))
+					tmp += "Q\n" + tmp2.remove("Q\n");
+			}
 			break;
 		case PageItem::Line:
 			if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
diff --git a/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp b/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
index 71fa9e4..f248383 100644
--- a/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
+++ b/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
@@ -3308,6 +3308,10 @@ bool Scribus150Format::readNotesStyles(ScribusDoc* doc, ScXmlStreamReader& reade
 			name = attrs.valueAsString("NotesStyle");
 			if (!name.isEmpty())
 				NS.setNotesParStyle(name);
+			name = attrs.valueAsString("LineStyle");
+			if (!name.isEmpty())
+				NS.setTopLineStyle(name);
+			NS.setTopLineWidth(attrs.valueAsDouble("LineWidth"));
 
 			m_Doc->newNotesStyle(NS);
 		}
diff --git a/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp b/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
index 45090f3..63b4ec4 100644
--- a/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
+++ b/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
@@ -1319,6 +1319,8 @@ void Scribus150Format::writeNotesStyles(ScXmlStreamWriter & docu)
 		docu.writeAttribute("SuperMaster", NS->isSuperscriptInMaster());
 		docu.writeAttribute("MarksStyle", NS->marksChStyle());
 		docu.writeAttribute("NotesStyle", NS->notesParStyle());
+		docu.writeAttribute("LineStyle", NS->topLineStyle());
+		docu.writeAttribute("LineWidth", NS->topLineWidth());
 	}
 	docu.writeEndElement();
 }
diff --git a/Scribus/scribus/scribusdoc.cpp b/Scribus/scribus/scribusdoc.cpp
index 2151306..3a0a15c 100644
--- a/Scribus/scribus/scribusdoc.cpp
+++ b/Scribus/scribus/scribusdoc.cpp
@@ -17755,6 +17755,8 @@ void ScribusDoc::deleteNote(TextNote* note)
 			master->asTextFrame()->removeNoteFrame(nF);
 		}
 	}
+	//	else
+//		master->asTextFrame()->setNoteFrame(nF);
 	if (note->masterMark() != NULL)
 		eraseMark(note->masterMark(), true, master);
 	if (note->noteMark() != NULL)
@@ -17772,6 +17774,7 @@ void ScribusDoc::setUndoDelNote(TextNote *note)
 	{
 		ScItemsState* ims = new ScItemsState(Um::DeleteNote,"",Um::IDelete);
 		ims->set("DELETE_NOTE", QString("delete_note"));
+//		ims->set("ETEA", note->masterMark()->label);
 		PageItem* master = note->masterMark()->getItemPtr();
 		int pos = findMarkCPos(note->masterMark(), master);
 		Q_ASSERT(pos > -1);
diff --git a/Scribus/scribus/ui/notesstyleseditor.cpp b/Scribus/scribus/ui/notesstyleseditor.cpp
index f93c340..1a223de 100644
--- a/Scribus/scribus/ui/notesstyleseditor.cpp
+++ b/Scribus/scribus/ui/notesstyleseditor.cpp
@@ -88,6 +88,9 @@ void NotesStylesEditor::languageChange()
 	AutoWeldLabel->setText(tr("Auto Welding"));
 	AutoRemoveLabel->setText(tr("Remove if empty"));
 	DeleteButton->setText(tr("Delete"));
+	topLineStyleLabel->setText(tr("Top Line Style"));
+	topLineWidthLabel->setText(tr("Top Line Width"));
+	topLineWidthSpin->setToolTip(tr("Width of top line as % of noteframe width"));
 	setBlockSignals(wasSignalsBlocked);
 }
 
@@ -100,6 +103,7 @@ void NotesStylesEditor::setDoc(ScribusDoc *doc)
 	m_Doc = doc;
 	paraStyleCombo->setDoc(m_Doc);
 	charStyleCombo->setDoc(m_Doc);
+	updateLineStyles();
 	if (m_Doc != NULL)
 	{
 		updateNSList();
@@ -126,6 +130,8 @@ void NotesStylesEditor::handleUpdateRequest(int updateFlags)
 		charStyleCombo->updateFormatList();
 	if ((updateFlags & reqParaStylesUpdate) || (updateFlags & reqTextStylesUpdate))
 		paraStyleCombo->updateFormatList();
+	if (updateFlags & reqLineStylesUpdate)
+		updateLineStyles();
 	readNotesStyle(NSlistBox->currentText());
 	setBlockSignals(wasSignalsBlocked);
 }
@@ -165,6 +171,21 @@ void NotesStylesEditor::setBlockSignals(bool block)
 	}
 	paraStyleCombo->blockSignals(block);
 	charStyleCombo->blockSignals(block);
+	topLineStyleCombo->blockSignals(block);
+}
+
+void NotesStylesEditor::updateLineStyles()
+{
+	topLineStyleCombo->blockSignals(true);
+	topLineStyleCombo->clear();
+	if (m_Doc != NULL)
+	{
+		QHash<QString,multiLine>::Iterator it;
+		for (it = m_Doc->MLineStyles.begin(); it != m_Doc->MLineStyles.end(); ++it)
+			topLineStyleCombo->addItem(it.key());
+	}
+	topLineStyleCombo->insertItem( 0, tr("No Style"));
+	topLineStyleCombo->blockSignals(false);
 }
 
 void NotesStylesEditor::setNotesStyle(NotesStyle * NS)
@@ -217,6 +238,8 @@ void NotesStylesEditor::setNotesStyle(NotesStyle * NS)
 			RangeBox->addItem(tr("Frame"));
 	}
 	AutoRemove->setChecked(NS->isAutoRemoveEmptyNotesFrames());
+	topLineStyleCombo->setCurrentIndex(topLineStyleCombo->findText(NS->topLineStyle()));
+	topLineWidthSpin->setValue(NS->topLineWidth() * 100.0);
 	
 	ApplyButton->setEnabled(false);
 	setBlockSignals(wasSignalsBlocked);
@@ -326,6 +349,8 @@ void NotesStylesEditor::on_ApplyButton_clicked()
 					ss->set("NEWsuperNote", NS->isSuperscriptInNote());
 					ss->set("NEWmarksChStyle", NS->marksChStyle());
 					ss->set("NEWnotesParStyle", NS->notesParStyle());
+					ss->set("NEWtopLineStyle", NS->topLineStyle());
+					ss->set("NEWtopLineWidth", NS->topLineWidth());
 					UndoManager::instance()->action(m_Doc, ss);
 				}
 				//invalidate all text frames with marks from current changed notes style
@@ -596,3 +621,19 @@ void NotesStylesEditor::on_charStyleCombo_currentIndexChanged(const int &arg1)
 	changesMap.insert(NSlistBox->currentText(), ns);
 	ApplyButton->setEnabled(true);
 }
+
+void NotesStylesEditor::on_topLineWidthSpin_valueChanged(double arg1)
+{
+	NotesStyle ns = changesMap.value(NSlistBox->currentText());
+	ns.setTopLineWidth(arg1/100.0);
+	changesMap.insert(NSlistBox->currentText(), ns);
+	ApplyButton->setEnabled(true);
+}
+
+void NotesStylesEditor::on_topLineStyleCombo_currentIndexChanged(const QString &arg1)
+{
+	NotesStyle ns = changesMap.value(NSlistBox->currentText());
+	ns.setTopLineStyle(arg1);
+	changesMap.insert(NSlistBox->currentText(), ns);
+	ApplyButton->setEnabled(true);
+}
diff --git a/Scribus/scribus/ui/notesstyleseditor.h b/Scribus/scribus/ui/notesstyleseditor.h
index fc07f88..4ac0c7d 100644
--- a/Scribus/scribus/ui/notesstyleseditor.h
+++ b/Scribus/scribus/ui/notesstyleseditor.h
@@ -25,6 +25,7 @@ private:
 	void changeNotesStyle();
 	void setBlockSignals(bool block);
 	bool addNewNsMode;
+	void updateLineStyles();
 
 public slots:
 	void setDoc(ScribusDoc *doc);
@@ -54,5 +55,7 @@ private slots:
 	void on_NewButton_clicked();
 	void on_paraStyleCombo_currentIndexChanged(const int &arg1);
 	void on_charStyleCombo_currentIndexChanged(const int &arg1);
+	void on_topLineWidthSpin_valueChanged(double arg1);
+	void on_topLineStyleCombo_currentIndexChanged(const QString &arg1);
 };
 #endif // NOTESSTYLESEDITOR_H
diff --git a/Scribus/scribus/ui/notesstyleseditor.ui b/Scribus/scribus/ui/notesstyleseditor.ui
index de8faf2..bd65811 100644
--- a/Scribus/scribus/ui/notesstyleseditor.ui
+++ b/Scribus/scribus/ui/notesstyleseditor.ui
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>324</width>
-    <height>576</height>
+    <width>280</width>
+    <height>545</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+   <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
@@ -25,13 +25,11 @@
   <property name="windowTitle">
    <string>Notes Styles Editor</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="1" column="0">
-    <layout class="QVBoxLayout" name="verticalLayout">
+  <layout class="QVBoxLayout" name="verticalLayout_2">
    <item>
     <widget class="QComboBox" name="NSlistBox">
      <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -48,13 +46,25 @@
        <property name="sizeHint" stdset="0">
         <size>
          <width>40</width>
-           <height>20</height>
+         <height>13</height>
         </size>
        </property>
       </spacer>
      </item>
      <item>
       <widget class="QPushButton" name="NewButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
        <property name="text">
         <string>Add New Style</string>
        </property>
@@ -64,6 +74,9 @@
    </item>
    <item>
     <layout class="QFormLayout" name="formLayout">
+     <property name="fieldGrowthPolicy">
+      <enum>QFormLayout::ExpandingFieldsGrow</enum>
+     </property>
      <item row="0" column="0">
       <widget class="QLabel" name="NewNameLabel">
        <property name="text">
@@ -72,12 +85,19 @@
       </widget>
      </item>
      <item row="0" column="1">
-        <widget class="QLineEdit" name="NewNameEdit"/>
+      <widget class="QLineEdit" name="NewNameEdit">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
      </item>
      <item row="1" column="0">
       <widget class="QRadioButton" name="FootRadio">
        <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
@@ -159,7 +179,14 @@
       </widget>
      </item>
      <item row="5" column="1">
-        <widget class="QLineEdit" name="PrefixEdit"/>
+      <widget class="QLineEdit" name="PrefixEdit">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
      </item>
      <item row="6" column="0">
       <widget class="QLabel" name="SuffixLabel">
@@ -169,7 +196,14 @@
       </widget>
      </item>
      <item row="6" column="1">
-        <widget class="QLineEdit" name="SuffixEdit"/>
+      <widget class="QLineEdit" name="SuffixEdit">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
      </item>
      <item row="7" column="0">
       <widget class="QCheckBox" name="SuperMasterCheck">
@@ -212,89 +246,119 @@
        </property>
       </widget>
      </item>
-       <item row="9" column="1">
-        <widget class="CharStyleComboBox" name="charStyleCombo">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-        </widget>
-       </item>
-       <item row="10" column="0">
+     <item row="11" column="0">
       <widget class="QLabel" name="paraStyleComboLabel">
        <property name="text">
         <string>Note Paragraph Style</string>
        </property>
       </widget>
      </item>
-       <item row="10" column="1">
+     <item row="11" column="1">
       <widget class="ParaStyleComboBox" name="paraStyleCombo">
        <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
       </widget>
      </item>
-       <item row="11" column="0">
+     <item row="12" column="0">
       <widget class="QCheckBox" name="AutoH">
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
-       <item row="11" column="1">
+     <item row="12" column="1">
       <widget class="QLabel" name="AutoHLabel">
        <property name="text">
         <string>Auto Height</string>
        </property>
       </widget>
      </item>
-       <item row="12" column="0">
+     <item row="13" column="0">
       <widget class="QCheckBox" name="AutoW">
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
-       <item row="12" column="1">
+     <item row="13" column="1">
       <widget class="QLabel" name="AutoWLabel">
        <property name="text">
         <string>Auto Width</string>
        </property>
       </widget>
      </item>
-       <item row="13" column="0">
+     <item row="14" column="0">
       <widget class="QCheckBox" name="AutoWeld">
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
-       <item row="13" column="1">
+     <item row="14" column="1">
       <widget class="QLabel" name="AutoWeldLabel">
        <property name="text">
         <string>Auto Welding</string>
        </property>
       </widget>
      </item>
-       <item row="14" column="0">
+     <item row="15" column="0">
       <widget class="QCheckBox" name="AutoRemove">
        <property name="text">
         <string/>
        </property>
       </widget>
      </item>
-       <item row="14" column="1">
+     <item row="15" column="1">
       <widget class="QLabel" name="AutoRemoveLabel">
        <property name="text">
         <string>Remove if empty</string>
        </property>
       </widget>
      </item>
+     <item row="16" column="0">
+      <widget class="QLabel" name="topLineWidthLabel">
+       <property name="text">
+        <string>Top Line Width</string>
+       </property>
+      </widget>
+     </item>
+     <item row="17" column="0">
+      <widget class="QLabel" name="topLineStyleLabel">
+       <property name="text">
+        <string>Top Line Style</string>
+       </property>
+      </widget>
+     </item>
+     <item row="17" column="1">
+      <widget class="QComboBox" name="topLineStyleCombo"/>
+     </item>
+     <item row="10" column="1">
+      <widget class="CharStyleComboBox" name="charStyleCombo">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item row="16" column="1">
+      <widget class="QDoubleSpinBox" name="topLineWidthSpin">
+       <property name="suffix">
+        <string>%</string>
+       </property>
+       <property name="decimals">
+        <number>2</number>
+       </property>
+       <property name="maximum">
+        <double>100.000000000000000</double>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
    <item>
@@ -340,7 +404,18 @@
      </item>
     </layout>
    </item>
-    </layout>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
    </item>
   </layout>
  </widget>
footnotes_topLine.patch (27,661 bytes)

cezaryece

2013-10-03 10:45

developer  

topLine.jpg (208,760 bytes)
topLine.jpg (208,760 bytes)

cbradney

2013-10-03 21:31

administrator   ~0030664

You've implemented this with another pageitem. Wouldn't it be better to just draw the line?

cezaryece

2013-10-04 06:04

developer   ~0030666

Maybe yes, I only use existing code.
PageItem_Line has implemented support of line styles already and footnotes line strongly use line style too, so I only try to not to break open doors.

Another point is I am not strong in drawing computation yet.

Issue History

Date Modified Username Field Change
2013-10-03 10:43 cezaryece New Issue
2013-10-03 10:43 cezaryece File Added: footnotes_topLine.patch
2013-10-03 10:45 cezaryece File Added: topLine.jpg
2013-10-03 21:31 cbradney Note Added: 0030664
2013-10-04 06:04 cezaryece Note Added: 0030666
2014-10-24 23:00 Kunda Patch => Yes
2015-09-17 20:08 Kunda Category Story Editor / Text Frames => Story Ed/Txt Frames
2015-09-17 20:12 Kunda Category Story Ed/Txt Frames => Story Editor / Text Frames
2015-11-13 01:27 Kunda Relationship added child of 0012496
2016-04-11 18:20 Kunda Tag Attached: footnotes
2019-05-09 18:05 JLuc Tag Attached: #rottenpatch