View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016403 | Scribus | User Interface | public | 2021-01-02 20:11 | 2021-03-21 15:23 |
Reporter | bubu | Assigned To | jghali | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.7.svn | ||||
Fixed in Version | 1.5.7.svn | ||||
Summary | 0016403: Unify margins for New document (startup)/New document dialog | ||||
Description | In this patch I propose to use standard 9px margin and 6px spacing in New document dialog. This is my first non trivial patch: for fixing non startup variant I had to add some logic to the code. I hope I found the right solution. Other changes are only the usual 9px/6px modifications. Please review the patch. Thanks. This is 4/5 part of 0016383. This patch overwrites that proposal. | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
new.diff (4,342 bytes)
diff --git a/scribus/ui/newdocdialog.cpp b/scribus/ui/newdocdialog.cpp index 337ddc5d94d6308cb866cdec12e253935630664a..da5a08d673d212d90f211415972fff890f98e61a 100644 --- a/scribus/ui/newdocdialog.cpp +++ b/scribus/ui/newdocdialog.cpp @@ -102,14 +102,20 @@ NewDocDialog::NewDocDialog(QWidget* parent, const QStringList& recentDocs, bool setWindowTitle( tr( "New Document" ) ); setWindowIcon(IconManager::instance().loadIcon("AppIcon.png")); + if (startUp) + setContentsMargins(0, 0, 0, 0); + else + setContentsMargins(9, 9, 9, 9); TabbedNewDocLayout = new QVBoxLayout( this ); - TabbedNewDocLayout->setMargin(10); - TabbedNewDocLayout->setSpacing(5); if (startUp) - tabWidget = new QTabWidget( this ); + TabbedNewDocLayout->setContentsMargins(9, 9, 9, 9); + else + TabbedNewDocLayout->setContentsMargins(0, 0, 0, 0); + TabbedNewDocLayout->setSpacing(6); createNewDocPage(); if (startUp) { + tabWidget = new QTabWidget( this ); tabWidget->addTab(newDocFrame, tr("&New Document")); createNewFromTempPage(); nftGui->setupSettings(lang); @@ -125,8 +131,8 @@ NewDocDialog::NewDocDialog(QWidget* parent, const QStringList& recentDocs, bool TabbedNewDocLayout->addWidget(newDocFrame); Layout1 = new QHBoxLayout; - Layout1->setSpacing( 5 ); - Layout1->setMargin( 0 ); + Layout1->setContentsMargins(0, 0, 0, 0); + Layout1->setSpacing(6); if (startUp) { startUpDialog = new QCheckBox( tr( "Do not show this dialog again" ), this ); @@ -180,8 +186,8 @@ void NewDocDialog::createNewDocPage() pageSizeGroupBox = new QGroupBox(newDocFrame ); pageSizeGroupBox->setTitle( tr( "Document Layout" ) ); pageSizeGroupBoxLayout = new QGridLayout( pageSizeGroupBox ); - pageSizeGroupBoxLayout->setMargin(10); - pageSizeGroupBoxLayout->setSpacing(5); + pageSizeGroupBoxLayout->setContentsMargins(9, 9, 9, 9); + pageSizeGroupBoxLayout->setSpacing(6); pageSizeGroupBoxLayout->setAlignment( Qt::AlignTop ); layoutsView = new PageLayoutsWidget( pageSizeGroupBox ); @@ -275,8 +281,8 @@ void NewDocDialog::createNewDocPage() optionsGroupBox = new QGroupBox( newDocFrame ); optionsGroupBox->setTitle( tr( "Options" ) ); optionsGroupBoxLayout = new QGridLayout( optionsGroupBox ); - optionsGroupBoxLayout->setSpacing( 5 ); - optionsGroupBoxLayout->setMargin( 10 ); + optionsGroupBoxLayout->setSpacing(6); + optionsGroupBoxLayout->setContentsMargins(9, 9, 9, 9); optionsGroupBoxLayout->setAlignment( Qt::AlignTop ); pageCountLabel = new QLabel( tr( "N&umber of Pages:" ), optionsGroupBox ); @@ -332,8 +338,11 @@ void NewDocDialog::createNewDocPage() optionsGroupBoxLayout->addWidget(startDocSetup, 5, 0, 1, 2, Qt::AlignLeft); NewDocLayout = new QGridLayout( newDocFrame ); - NewDocLayout->setMargin(10); - NewDocLayout->setSpacing(5); + if (m_onStartup) + NewDocLayout->setContentsMargins(9, 9, 9, 9); + else + NewDocLayout->setContentsMargins(0, 0, 0, 0); + NewDocLayout->setSpacing(6); NewDocLayout->addWidget( marginGroup, 1, 0 ); NewDocLayout->addWidget( optionsGroupBox, 1, 1 ); NewDocLayout->addWidget( pageSizeGroupBox, 0, 0, 1, 2); @@ -343,6 +352,7 @@ void NewDocDialog::createNewFromTempPage() { newFromTempFrame = new QFrame(this); verticalLayout = new QVBoxLayout(newFromTempFrame); + verticalLayout->setContentsMargins(0, 0, 0, 0); nftGui = new nftwidget(newFromTempFrame); verticalLayout->addWidget(nftGui); } @@ -360,8 +370,8 @@ void NewDocDialog::createOpenDocPage() // formats.remove("PDF (*.pdf *.PDF);;"); openDocFrame = new QFrame(this); openDocLayout = new QVBoxLayout(openDocFrame); - openDocLayout->setMargin(5); - openDocLayout->setSpacing(5); + openDocLayout->setContentsMargins(0, 0, 0, 0); + openDocLayout->setSpacing(6); m_selectedFile = ""; // With Qt 5.15 we have to be in careful so that new document dialog doesn't display too large on startup. @@ -410,8 +420,8 @@ void NewDocDialog::createRecentDocPage() { recentDocFrame = new QFrame(this); recentDocLayout = new QVBoxLayout(recentDocFrame); - recentDocLayout->setMargin(5); - recentDocLayout->setSpacing(5); + recentDocLayout->setContentsMargins(9, 9, 9, 9); + recentDocLayout->setSpacing(6); recentDocListBox = new QListWidget(recentDocFrame); recentDocLayout->addWidget(recentDocListBox); int max = qMin(prefsManager.appPrefs.uiPrefs.recentDocCount, recentDocList.count()); |
|
Applied, thanks! |
|
Thanks! Fixed in 1.5.7.svn (24368) |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-02 20:11 | bubu | New Issue | |
2021-01-02 20:11 | bubu | File Added: new.diff | |
2021-01-02 20:11 | bubu | File Added: new_document.gif | |
2021-01-02 20:11 | bubu | File Added: new_startup.gif | |
2021-01-02 21:03 | PeterBenedek | Description Updated | |
2021-01-02 21:04 | PeterBenedek | Relationship added | related to 0016383 |
2021-01-02 21:05 | PeterBenedek | Relationship added | child of 0013906 |
2021-01-02 21:08 | PeterBenedek | Description Updated | |
2021-01-02 23:29 | jghali | Assigned To | => jghali |
2021-01-02 23:29 | jghali | Status | new => resolved |
2021-01-02 23:29 | jghali | Resolution | open => fixed |
2021-01-02 23:29 | jghali | Fixed in Version | => 1.5.7.svn |
2021-01-02 23:29 | jghali | Note Added: 0048613 | |
2021-03-21 15:23 | FirasH | Status | resolved => closed |
2021-03-21 15:23 | FirasH | Note Added: 0049017 |