View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0011043 | Scribus | General | public | 2012-08-22 21:07 | 2026-10-09 12:02 |
| Reporter | ale | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | new | Resolution | open | ||
| Product Version | 1.5.0svn | ||||
| Summary | 0011043: once the document is created, there is no way to disable auto text frames | ||||
| Description | if you have chosen the option to automatically create text frames when you create a new page, i could not find a way to disable it for the current document. | ||||
| Tags | #please_test | ||||
| Patch | |||||
| related to | 0001098 | acknowledged | Feature request ot manually integrate Shift+Click automatic text frames (without using mouse) |
|
|
This is still a problem in 1.6.3. I've attached three screenshots: 1. The New Document window where the option to select "Automatic Text Frames" is. 2. The File > Document Setup > General window, with the mouse cursor pointed to the location where you would expect the Automatic Text Frame option to be. There is no toggle for this anywhere in Document Setup. 3. A quick copy-paste to show what the desired situation: Add an option to toggle Automatic Text Frames on or off in Document Setup. At the moment the only real option for users is to deleted the extra automatic text frame if you change your mind. But also the reverse is true - users who decide they want to add automatic text frames have no option to do that once the document is already created. The desired situation would give users more flexibility and control over the document. |
|
|
automatic text frames as a part of a master page is what i would really like. |
|
|
Related to 0001410. |
|
|
Here is a 2-patch series that fixes this and 0001410. Dependency: r27881 > ATF1 > ATF2 (auto text frame). ## atf1-chain-management-v1.04.patch Automatic text-frame chain management - Supports starting independent chains or continuing existing ones. - Allows automatic frame creation to be toggled without affecting existing frames. - Fixes automatic-frame positioning and chain linking during middle-page insertion. - Preserves chain boundaries across skipped pages and independent stories. - Fixes undo/redo restoration of frames, links and story content. - Hardens endpoint validation, frame identity handling and persistence. ## atf2-ui-integration-v1.08.patch Document Setup and context-menu integration - Adds automatic text-frame controls to Document Setup → Layout (enable, chain mode, columns and gap). - Adds a checkable page context-menu submenu for chain management. - Displays the active mode and synchronises controls with document state. - Preserves existing frames and Document Setup cancellation behaviour. atf1-chain-management-v1.04-fpatch.patch (14,037 bytes)
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp
+++ scribus/pageitem.cpp
@@ -1201,6 +1201,31 @@
}
}
+void PageItem::insertInChainAfter(PageItem* previous)
+{
+ if (!previous || previous == this || m_backBox || m_nextBox || !previous->m_nextBox || previous->m_Doc != m_Doc)
+ return;
+ PageItem* following = previous->m_nextBox;
+ if (following == this || following->m_Doc != m_Doc || following->m_backBox != previous)
+ return;
+ // Preserve the shared story and its text positions. unlink() would instead
+ // divide the story, so it must not be used for structural page insertion.
+ itemText = previous->itemText;
+ isAutoText = previous->isAutoText;
+ m_backBox = previous;
+ m_nextBox = following;
+ previous->m_nextBox = this;
+ following->m_backBox = this;
+ previous->invalid = true;
+ // Recompose the tail without altering the content of the shared story.
+ for (PageItem* frame = this; frame; frame = frame->m_nextBox)
+ {
+ frame->itemText = itemText;
+ frame->invalid = true;
+ frame->firstChar = 0;
+ }
+}
+
void PageItem::unlink(bool createUndo)
{
if (m_nextBox)
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h
+++ scribus/pageitem.h
@@ -503,6 +503,8 @@
bool canBeLinkedTo(const PageItem* nextFrame) const;
void unlink(bool createUndo = true);
void link(PageItem* nextFrame, bool addPARSEP = true);
+ /** Insert an empty frame between two frames without splitting their story text. */
+ void insertInChainAfter(PageItem* previous);
void dropLinks();
void unlinkWithText();
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp
+++ scribus/scribus.cpp
@@ -5343,6 +5343,9 @@
void ScribusMainWindow::addNewPages(int wo, int where, int numPages, double height, double width, int orient, const QString& siz, bool mov, QStringList* basedOn, bool overrideMasterPageSizing)
{
UndoTransaction activeTransaction;
+ SimpleState* pageUndoState = nullptr;
+ const bool autoFramesAtCreation = doc->usesAutomaticTextFrames();
+ const bool newAutoChainAtCreation = doc->startsNewAutomaticTextFrameChain();
if (UndoManager::undoEnabled())
{
activeTransaction = m_undoManager->beginTransaction(doc->getUName(), Um::IDocument, (numPages == 1) ? Um::AddPage : Um::AddPages, QString(), Um::ICreate);
@@ -5369,6 +5372,11 @@
ss->set("ORIENT", orient);
ss->set("SIZE", siz);
ss->set("MOVED", mov);
+ // Redo must replay the original creation decision, not today's ATF settings.
+ ss->set("ATF_SAVED", true);
+ ss->set("ATF_ENABLED", autoFramesAtCreation);
+ ss->set("ATF_NEW_CHAIN", newAutoChainAtCreation);
+ pageUndoState = ss;
m_undoManager->action(this, ss);
}
// disable recording of undo actions related to new page creating
@@ -5418,6 +5426,7 @@
else if (where == 2)
wot = doc->Pages->count();
+ const int insertedPageStart = wot;
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
view->updatesOn(false);
const PageSet& pageSet = doc->pageSets()[doc->pagePositioning()];
@@ -5439,6 +5448,22 @@
// doc->currentPage()->pageNr(), false); // this Apply_MasterPage avoids DreawNew and PagePalette->ReBuild, which is much faster for 100 pp :-)
++wot;
}
+ // Record the identity of each created automatic frame. Later text undo
+ // actions may target these frames and must survive page undo/redo.
+ if (pageUndoState)
+ {
+ for (int i = 0; i < numPages; ++i)
+ {
+ for (PageItem* item : doc->DocItems)
+ {
+ if (item && item->isAutoText && item->OwnPage == insertedPageStart + i)
+ {
+ pageUndoState->set(QString("ATF_FRAME_%1").arg(i), static_cast<uint>(item->getUId()));
+ break;
+ }
+ }
+ }
+ }
doc->setCurrentPage(currentPage);
view->updatesOn(true);
QApplication::restoreOverrideCursor();
@@ -5467,8 +5492,12 @@
void ScribusMainWindow::slotNewPage(int w, const QString& masterPageName, bool mov)
{
- doc->addPage(w, masterPageName, true);
+ // The new page receives its final position when the view reforms pages.
+ // Creating its automatic frame before that can leave it on the pasteboard.
+ doc->addPage(w, masterPageName, false);
view->addPage(w, mov);
+ if (doc->usesAutomaticTextFrames())
+ doc->addAutomaticTextFrame(w);
slotSetCurrentPage(w);
}
@@ -8049,6 +8078,27 @@
break;
}
+ // These indices are shared by the page and frame identity restoration.
+ // A text-history entry may refer to an automatic frame removed by page undo.
+ if (isUndo && state->getBool("ATF_SAVED"))
+ {
+ for (int i = 0; i < count; ++i)
+ {
+ const int pageIndex = delFrom - 1 + i;
+ const uint frameId = state->getUInt(QString("ATF_FRAME_%1").arg(i));
+ if (!frameId)
+ continue;
+ for (PageItem* frame : doc->DocItems)
+ {
+ if (!frame || !frame->isAutoText || frame->OwnPage != pageIndex || frame->getUId() != frameId)
+ continue;
+ auto* dummy = new DummyUndoObject();
+ state->set(QString("ATF_DUMMY_%1").arg(i), static_cast<uint>(dummy->getUId()));
+ m_undoManager->replaceObject(frame->getUId(), dummy);
+ break;
+ }
+ }
+ }
if (isUndo)
{
for (int i = delFrom - 1; i < delTo; ++i)
@@ -8072,7 +8122,37 @@
}
else
{
+ // Recreate the same kind of pages, including whether frames were
+ // absent and whether the first frame began a new chapter.
+ const bool oldEnabled = doc->usesAutomaticTextFrames();
+ const bool oldStartNew = doc->startsNewAutomaticTextFrameChain();
+ if (state->getBool("ATF_SAVED"))
+ {
+ doc->setUsesAutomaticTextFrames(state->getBool("ATF_ENABLED"));
+ doc->setStartNewAutomaticTextFrameChain(state->getBool("ATF_NEW_CHAIN"));
+ }
addNewPages(wo, where, count, height, width, orient, siz, mov, &based);
+ if (state->getBool("ATF_SAVED"))
+ {
+ doc->setUsesAutomaticTextFrames(oldEnabled);
+ doc->setStartNewAutomaticTextFrameChain(oldStartNew);
+ for (int i = 0; i < count; ++i)
+ {
+ const uint dummyId = state->getUInt(QString("ATF_DUMMY_%1").arg(i));
+ if (!dummyId)
+ continue;
+ for (PageItem* frame : doc->DocItems)
+ {
+ if (frame && frame->isAutoText && frame->OwnPage == delFrom - 1 + i)
+ {
+ UndoObject* old = m_undoManager->replaceObject(dummyId, frame);
+ state->set(QString("ATF_FRAME_%1").arg(i), static_cast<uint>(frame->getUId()));
+ delete old;
+ break;
+ }
+ }
+ }
+ }
}
for (int i = delFrom - 1; i < delTo; ++i)
{
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp
+++ scribus/scribusdoc.cpp
@@ -3028,31 +3028,89 @@
int ScribusDoc::addAutomaticTextFrame(int pageNumber)
{
- if (!m_automaticTextFrames)
+ if (!m_automaticTextFrames || masterPageMode() || pageNumber < 0 || pageNumber >= DocPages.count())
return -1;
- const ScPage *addToPage = DocPages.at(pageNumber);
- if ((!masterPageMode()) && (usesAutomaticTextFrames()))// && (!isLoading()))
+
+ const ScPage* page = DocPages.at(pageNumber);
+ // Existing automatic frames must be resolved by page, not by item order:
+ // independent chapters can occur on either side of an inserted page.
+ PageItem* before = nullptr;
+ PageItem* after = nullptr;
+ int beforePage = -1;
+ int afterPage = DocPages.count();
+ for (PageItem* candidate : DocItems)
{
- int z = itemAdd(PageItem::TextFrame, PageItem::Unspecified,
- addToPage->Margins.left()+addToPage->xOffset(),
- addToPage->Margins.top()+addToPage->yOffset(), m_docPrefsData.docSetupPrefs.pageWidth-addToPage->Margins.right()-addToPage->Margins.left(),
- m_docPrefsData.docSetupPrefs.pageHeight-addToPage->Margins.bottom()-addToPage->Margins.top(),
- 1, CommonStrings::None, m_docPrefsData.itemToolPrefs.shapeLineColor);
- Items->at(z)->isAutoText = true;
- Items->at(z)->m_columns = qRound(PageSp);
- Items->at(z)->m_columnGap = PageSpa;
- if (LastAuto != nullptr)
- LastAuto->link(Items->at(z));
- else
- FirstAuto = Items->at(z);
- LastAuto = Items->at(z);
- Items->at(z)->setRedrawBounding();
- updateEndnotesFrames();
- return z;
+ if (!candidate || !candidate->isAutoText || candidate->OwnPage < 0)
+ continue;
+ if (candidate->OwnPage < pageNumber && candidate->OwnPage >= beforePage)
+ {
+ before = candidate;
+ beforePage = candidate->OwnPage;
+ }
+ if (candidate->OwnPage > pageNumber && candidate->OwnPage < afterPage)
+ {
+ after = candidate;
+ afterPage = candidate->OwnPage;
+ }
}
- return -1;
-}
+ const bool startNew = m_startNewAutomaticTextFrameChain;
+ PageItem* activeEndpoint = automaticTextFrameEndpoint();
+ int z = itemAdd(PageItem::TextFrame, PageItem::Unspecified,
+ page->Margins.left() + page->xOffset(),
+ page->Margins.top() + page->yOffset(),
+ page->width() - page->Margins.right() - page->Margins.left(),
+ page->height() - page->Margins.bottom() - page->Margins.top(),
+ 1, CommonStrings::None, m_docPrefsData.itemToolPrefs.shapeLineColor);
+ if (z < 0 || z >= Items->count())
+ return -1;
+ PageItem* frame = Items->at(z);
+ frame->OwnPage = pageNumber;
+ frame->isAutoText = true;
+ frame->m_columns = qRound(PageSp);
+ frame->m_columnGap = PageSpa;
+
+ if (!startNew && before && after && before->nextInChain() == after)
+ {
+ // Inserting within a story must not split or concatenate its text.
+ frame->insertInChainAfter(before);
+ }
+ else if (!startNew && pageNumber == DocPages.count() - 1 && activeEndpoint && !activeEndpoint->nextInChain())
+ {
+ // Appending extends the active chapter, not an unrelated one.
+ activeEndpoint->link(frame);
+ }
+ else if (!startNew && before && !before->nextInChain())
+ {
+ // Extend the preceding chapter without joining the following chapter.
+ before->link(frame);
+ }
+ else if (!startNew && !before && after && !after->prevInChain())
+ {
+ frame->link(after);
+ }
+ else if (!startNew && !before && !after && activeEndpoint)
+ {
+ activeEndpoint->link(frame);
+ }
+ // Otherwise begin a separate story rather than guessing across chapters.
+ // Retain the active endpoint for an insertion into an earlier story.
+ if (startNew || !activeEndpoint || !DocItems.contains(activeEndpoint) ||
+ (pageNumber == DocPages.count() - 1 && !frame->nextInChain()))
+ {
+ LastAuto = frame->lastInChain();
+ FirstAuto = frame->firstInChain();
+ }
+ else
+ {
+ LastAuto = activeEndpoint;
+ FirstAuto = activeEndpoint->firstInChain();
+ }
+ m_startNewAutomaticTextFrameChain = false;
+ frame->setRedrawBounding();
+ updateEndnotesFrames();
+ return z;
+}
int ScribusDoc::addLayer(const QString& layerName, bool activate)
{
@@ -5924,6 +5982,58 @@
m_automaticTextFrames = atf;
}
+void ScribusDoc::setAutomaticTextFramesEnabled(bool enabled)
+{
+ if (m_automaticTextFrames == enabled)
+ return;
+ setUsesAutomaticTextFrames(enabled);
+ changed();
+}
+
+void ScribusDoc::setAutomaticTextFrameDimensions(int columns, double gap)
+{
+ if (PageSp == columns && qAbs(PageSpa - gap) < 0.000001)
+ return;
+ PageSp = columns;
+ PageSpa = gap;
+ changed();
+}
+
+PageItem* ScribusDoc::automaticTextFrameEndpoint() const
+{
+ // Compare pointers before dereferencing: deletion/undo may have removed LastAuto.
+ if (LastAuto && DocItems.contains(LastAuto) && LastAuto->isAutoText && !LastAuto->nextInChain())
+ return LastAuto;
+ // A removed active endpoint may leave an earlier independent chapter intact.
+ // Select the last eligible automatic endpoint in document item order.
+ for (auto it = DocItems.crbegin(); it != DocItems.crend(); ++it)
+ {
+ PageItem* frame = *it;
+ if (frame && frame->isAutoText && !frame->nextInChain())
+ return frame;
+ }
+ return nullptr;
+}
+
+bool ScribusDoc::canContinueAutomaticTextFrames() const
+{
+ return automaticTextFrameEndpoint() != nullptr;
+}
+
+void ScribusDoc::enableAutomaticTextFrames(bool continueExisting)
+{
+ // Leave all pre-existing frames and links untouched. The choice
+ // governs only the next automatic frame and its successors.
+ const bool startNew = !continueExisting || !canContinueAutomaticTextFrames();
+ if (m_automaticTextFrames && m_startNewAutomaticTextFrameChain == startNew)
+ return;
+ m_startNewAutomaticTextFrameChain = startNew;
+ if (!m_automaticTextFrames)
+ setAutomaticTextFramesEnabled(true);
+ else
+ changed();
+}
+
bool ScribusDoc::loadPict(const QString& fn, PageItem *pageItem, bool reload, bool showMsg)
{
if (!reload)
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h
+++ scribus/scribusdoc.h
@@ -954,6 +954,19 @@
*/
bool usesAutomaticTextFrames() const;
void setUsesAutomaticTextFrames(bool);
+ /** Update the enabled flag as a user-visible document change. */
+ void setAutomaticTextFramesEnabled(bool enabled);
+ /** Apply document-level automatic frame columns and gap. */
+ void setAutomaticTextFrameDimensions(int columns, double gap);
+ /** Find a valid, unlinked automatic story endpoint. */
+ PageItem* automaticTextFrameEndpoint() const;
+ /** Enable automatic frame creation, either as a new story or by extending the active story. */
+ void enableAutomaticTextFrames(bool continueExisting = false);
+ /** Is an automatic story available to continue? */
+ bool canContinueAutomaticTextFrames() const;
+ /** Persist a not-yet-consumed request to begin a separate story. */
+ bool startsNewAutomaticTextFrameChain() const { return m_startNewAutomaticTextFrameChain; }
+ void setStartNewAutomaticTextFrameChain(bool startNew) { m_startNewAutomaticTextFrameChain = startNew; }
/**
*
@@ -1366,6 +1379,7 @@
double m_docUnitRatio;
AnchorPoint m_rotMode {AnchorPoint::TopLeft};
bool m_automaticTextFrames; // Flag for automatic Textframes
+ bool m_startNewAutomaticTextFrameChain {false}; // Consumed on the next automatic frame
bool m_masterPageMode {false};
bool m_symbolEditMode {false};
bool m_inlineEditMode {false};
atf2-ui-integration-v1.08-fpatch.patch (10,263 bytes)
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp
+++ scribus/scribus.cpp
@@ -6791,6 +6791,15 @@
bool resizePages, resizeMasterPages, resizePageMargins, resizeMasterPageMargins;
prefsDialog.getResizeDocumentPages(resizePages, resizeMasterPages, resizePageMargins, resizeMasterPageMargins);
doc->setNewPrefs(newDocPrefs, oldDocPrefs, resizePages, resizeMasterPages, resizePageMargins, resizeMasterPageMargins);
+ // Apply only after acceptance. The chain choice is meaningful on enablement,
+ // not when editing unrelated document settings.
+ const bool hadAutoFrames = doc->usesAutomaticTextFrames();
+ const bool wantsAutoFrames = prefsDialog.automaticFramesEnabled();
+ if (wantsAutoFrames && !hadAutoFrames)
+ doc->enableAutomaticTextFrames(prefsDialog.continueAutomaticChain());
+ else if (!wantsAutoFrames && hadAutoFrames)
+ doc->setAutomaticTextFramesEnabled(false);
+ doc->setAutomaticTextFrameDimensions(prefsDialog.automaticFrameColumns(), prefsDialog.automaticFrameGap());
slotChangeUnit(doc->unitIndex(), false);
Index: scribus/ui/contextmenu.cpp
===================================================================
--- scribus/ui/contextmenu.cpp
+++ scribus/ui/contextmenu.cpp
@@ -682,6 +682,38 @@
if (onAPage)
{
addSeparator();
+ // A submenu-owning action displays the current enabled state; Qt opens
+ // its submenu on activation instead of reliably toggling its checkmark.
+ const bool automaticFramesEnabled = m_doc->usesAutomaticTextFrames();
+ const bool pendingNew = m_doc->startsNewAutomaticTextFrameChain();
+ const bool canContinue = m_doc->canContinueAutomaticTextFrames();
+ QString automaticFramesLabel = tr("Automatic text frames");
+ if (automaticFramesEnabled)
+ automaticFramesLabel += pendingNew || !canContinue ? tr(" (New chain)") : tr(" (Continue)");
+ QMenu* automaticFramesMenu = addMenu(automaticFramesLabel);
+ QAction* automaticFramesStatus = automaticFramesMenu->menuAction();
+ automaticFramesStatus->setCheckable(true);
+ automaticFramesStatus->setChecked(m_doc->usesAutomaticTextFrames());
+ QAction* startNew = automaticFramesMenu->addAction(tr("Start new chain"));
+ QAction* continueExisting = automaticFramesMenu->addAction(tr("Continue existing chain"));
+ startNew->setCheckable(true);
+ continueExisting->setCheckable(true);
+ // Checkmarks describe the next automatic frame's linking behaviour.
+ // Once Start New is consumed, subsequent frames continue that new story.
+ startNew->setChecked(m_doc->usesAutomaticTextFrames() && (pendingNew || !canContinue));
+ continueExisting->setChecked(m_doc->usesAutomaticTextFrames() && !pendingNew && canContinue);
+ continueExisting->setEnabled(canContinue);
+ connect(startNew, &QAction::triggered, this, [this]() { m_doc->enableAutomaticTextFrames(false); });
+ connect(continueExisting, &QAction::triggered, this, [this]() { m_doc->enableAutomaticTextFrames(true); });
+ if (m_doc->usesAutomaticTextFrames())
+ {
+ automaticFramesMenu->addSeparator();
+ QAction* disable = automaticFramesMenu->addAction(tr("Disable automatic text frames"));
+ connect(disable, &QAction::triggered, this, [this]() {
+ m_doc->setAutomaticTextFramesEnabled(false);
+ });
+ }
+ addSeparator();
addAction(m_ScMW->scrActions["pageApplyMasterPage"]);
addAction(m_ScMW->scrActions["pageManageGuides"]);
addAction(m_ScMW->scrActions["pageManageProperties"]);
Index: scribus/ui/preferences/preferencesdialog.h
===================================================================
--- scribus/ui/preferences/preferencesdialog.h
+++ scribus/ui/preferences/preferencesdialog.h
@@ -63,6 +63,10 @@
~PreferencesDialog() = default;
ApplicationPrefs prefs() const { return localPrefs; }
+ bool automaticFramesEnabled() const { return prefs_DocumentSetup->automaticFramesEnabled(); }
+ bool continueAutomaticChain() const { return prefs_DocumentSetup->continueAutomaticChain(); }
+ int automaticFrameColumns() const { return prefs_DocumentSetup->automaticFrameColumns(); }
+ double automaticFrameGap() const { return prefs_DocumentSetup->automaticFrameGap(); }
void getResizeDocumentPages(bool &resizePages, bool &resizeMasterPages, bool &resizePageMargins, bool &resizeMasterPageMargins);
public slots:
Index: scribus/ui/preferences/prefs_documentsetup.cpp
===================================================================
--- scribus/ui/preferences/prefs_documentsetup.cpp
+++ scribus/ui/preferences/prefs_documentsetup.cpp
@@ -7,6 +7,14 @@
#include <algorithm>
#include <QButtonGroup>
+#include <QCheckBox>
+#include <QFormLayout>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QRadioButton>
+#include <QSpinBox>
+#include <QVBoxLayout>
#include <QFileDialog>
#include "commonstrings.h"
@@ -15,6 +23,8 @@
#include "prefsfile.h"
#include "prefsmanager.h"
#include "prefsstructs.h"
+#include "scribusdoc.h"
+#include "ui/scrspinbox.h"
#include "ui/newmarginwidget.h"
#include "ui/preferences/prefs_documentsetup.h"
#include "undomanager.h"
@@ -27,7 +37,54 @@
m_doc(doc)
{
setupUi(this);
-
+
+ if (m_doc)
+ {
+ // Document-only controls: application defaults use a separate new-document workflow.
+ auto* group = new QGroupBox(tr("Automatic text frames"), layoutTab);
+ auto* groupLayout = new QVBoxLayout(group);
+ m_autoFramesEnabled = new QCheckBox(tr("Enable automatic text frames"), group);
+ groupLayout->addWidget(m_autoFramesEnabled);
+ m_autoFramesNew = new QRadioButton(tr("Start new chain"), group);
+ m_autoFramesContinue = new QRadioButton(tr("Continue existing chain"), group);
+ m_autoFramesNew->setChecked(true);
+ groupLayout->addWidget(m_autoFramesNew);
+ groupLayout->addWidget(m_autoFramesContinue);
+ auto* dimensions = new QHBoxLayout;
+ m_autoFramesColumns = new QSpinBox(group);
+ m_autoFramesColumns->setRange(1, 100);
+ m_autoFramesGap = new ScrSpinBox(0, 1000, group);
+ dimensions->addWidget(new QLabel(tr("Columns:"), group));
+ dimensions->addWidget(m_autoFramesColumns);
+ dimensions->addWidget(new QLabel(tr("Gap:"), group));
+ dimensions->addWidget(m_autoFramesGap);
+ dimensions->addStretch();
+ groupLayout->addLayout(dimensions);
+ group->setToolTip(tr("Settings affect newly added pages only; existing text frames remain unchanged."));
+ // Place before the existing bottom stretch.
+ auto* layout = qobject_cast<QVBoxLayout*>(layoutTab->layout());
+ layout->insertWidget(layout->count() - 1, group);
+ connect(m_autoFramesEnabled, &QCheckBox::toggled, group, [this](bool enabled) {
+ m_autoFramesNew->setEnabled(enabled);
+ m_autoFramesContinue->setEnabled(enabled && m_doc->canContinueAutomaticTextFrames());
+ m_autoFramesColumns->setEnabled(enabled);
+ m_autoFramesGap->setEnabled(enabled);
+ });
+ m_autoFramesEnabled->setChecked(m_doc->usesAutomaticTextFrames());
+ // Show the outstanding choice, without changing an already active chain.
+ if (m_doc->usesAutomaticTextFrames() && !m_doc->startsNewAutomaticTextFrameChain() && m_doc->canContinueAutomaticTextFrames())
+ m_autoFramesContinue->setChecked(true);
+ else
+ m_autoFramesNew->setChecked(true);
+ m_autoFramesColumns->setValue(qMax(1, qRound(m_doc->PageSp)));
+ m_autoFramesGap->setNewUnit(m_doc->unitIndex());
+ m_autoFramesGap->setValue(m_doc->PageSpa * unitGetRatioFromIndex(m_doc->unitIndex()));
+ m_autoFramesNew->setEnabled(m_autoFramesEnabled->isChecked());
+ m_autoFramesContinue->setEnabled(m_autoFramesEnabled->isChecked() && m_doc->canContinueAutomaticTextFrames());
+ m_autoFramesColumns->setEnabled(m_autoFramesEnabled->isChecked());
+ m_autoFramesGap->setEnabled(m_autoFramesEnabled->isChecked());
+ }
+
scrollArea->viewport()->setAutoFillBackground(false);
scrollArea->widget()->setAutoFillBackground(false);
@@ -92,6 +149,8 @@
unitRatio = unitGetRatioFromIndex(docUnitIndex);
pageWidthSpinBox->setValue(pageW * unitRatio);
pageHeightSpinBox->setValue(pageH * unitRatio);
+ if (m_autoFramesGap)
+ m_autoFramesGap->setNewUnit(docUnitIndex);
marginsWidget->setNewUnit(docUnitIndex);
marginsWidget->setPageHeight(pageH);
marginsWidget->setPageWidth(pageW);
@@ -403,3 +462,23 @@
{
emit changeToOtherSection("Prefs_PageSizes");
}
+
+bool Prefs_DocumentSetup::automaticFramesEnabled() const
+{
+ return m_autoFramesEnabled && m_autoFramesEnabled->isChecked();
+}
+
+bool Prefs_DocumentSetup::continueAutomaticChain() const
+{
+ return m_autoFramesContinue && m_autoFramesContinue->isChecked();
+}
+
+int Prefs_DocumentSetup::automaticFrameColumns() const
+{
+ return m_autoFramesColumns ? m_autoFramesColumns->value() : 1;
+}
+
+double Prefs_DocumentSetup::automaticFrameGap() const
+{
+ return m_autoFramesGap ? m_autoFramesGap->value() / unitGetRatioFromIndex(pageUnitsComboBox->currentIndex()) : 0.0;
+}
Index: scribus/ui/preferences/prefs_documentsetup.h
===================================================================
--- scribus/ui/preferences/prefs_documentsetup.h
+++ scribus/ui/preferences/prefs_documentsetup.h
@@ -14,6 +14,10 @@
#include "scribusstructs.h"
class ScribusDoc;
+class QCheckBox;
+class QRadioButton;
+class QSpinBox;
+class ScrSpinBox;
class SCRIBUS_API Prefs_DocumentSetup : public Prefs_Pane, Ui::Prefs_DocumentSetup
{
@@ -28,6 +32,10 @@
void getResizeDocumentPages(bool &resizePages, bool &resizeMasterPages, bool &resizePageMargins, bool &resizeMasterPageMargins);
void setupPageSizes(struct ApplicationPrefs *prefsData);
+ bool automaticFramesEnabled() const;
+ bool continueAutomaticChain() const;
+ int automaticFrameColumns() const;
+ double automaticFrameGap() const;
public slots:
void languageChange();
@@ -62,6 +70,11 @@
protected:
void setupPageSets();
ScribusDoc* m_doc { nullptr };
+ QCheckBox* m_autoFramesEnabled { nullptr };
+ QRadioButton* m_autoFramesNew { nullptr };
+ QRadioButton* m_autoFramesContinue { nullptr };
+ QSpinBox* m_autoFramesColumns { nullptr };
+ ScrSpinBox* m_autoFramesGap { nullptr };
double unitRatio { 1.0 };
double pageW { 1.0 };
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-08-22 21:07 | ale | New Issue | |
| 2016-01-19 12:37 | Kunda | Relationship added | related to 0001098 |
| 2026-05-16 06:26 | travisj | Note Added: 0053697 | |
| 2026-05-16 06:26 | travisj | File Added: automatic-text-frames.png | |
| 2026-05-16 06:26 | travisj | File Added: document-settings-frames.png | |
| 2026-05-16 06:26 | travisj | File Added: document-settings-frames-ideal.png | |
| 2026-05-16 18:29 | utnik | Note Added: 0053704 | |
| 2026-08-25 15:18 | buttar | Note Added: 0054296 | |
| 2026-10-09 12:02 | buttar | Note Added: 0054513 | |
| 2026-10-09 12:02 | buttar | File Added: atf1-chain-management-v1.04-fpatch.patch | |
| 2026-10-09 12:02 | buttar | File Added: atf2-ui-integration-v1.08-fpatch.patch | |
| 2026-10-09 12:02 | buttar | File Added: context-menu-atf-controls.png | |
| 2026-10-09 12:02 | buttar | File Added: doc-setup-atf-controls.png | |
| 2026-10-09 12:02 | buttar | Tag Attached: #please_test |