View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017393 | Scribus | User Interface | public | 2025-01-30 08:04 | 2025-02-21 18:51 |
Reporter | ale | Assigned To | ale | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | 1.7.1.svn | ||||
Fixed in Version | 1.7.1.svn | ||||
Summary | 0017393: Make the Align and distribute tool more comfortable to use | ||||
Description | TLDR: "Relative to", "Selected guide", and "Align sides" by should be three groups of tool buttons in a single row. With informational labels below them. No tabs, one panel with sections likes in the PP kerneling's counting of the clicks is a bit off, but it's not completely wrong: https://forums.scribus.net/index.php/topic,5859.msg25433.html#msg25433 we can do better! first, if there are not new feature waiting to get into the tool, we can remove the tabs: align, distribute, and snap on top of each other using the same type of expanding sections like in the PP and CP. put the labels ("Relative to:", "Selected guide", ...) below the buttons and hide them when the informational labels are not shown. (remove the accelerators from the labels: in my setup, only the alt+s for "selected guide" seems to work anyway) use tool buttons instead of dropdowns. (we need icons...) "Selected guide" could also be a button that changes state when a guide is selected. it might show an "animation" each time a guide gets selected: it's light gray when no guides is selected, dark gray when selected, and fades from light gray to dark gray each time a guide is selected. the coordinates of the selected guide can be in the tooltip. Some of the tooltips need to be redone to carry real information. @jghali @mrb : are you ok with such a change? @nitramr : do you want to do this? should i do it? | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
related to | 0017428 | new | Make the Align and distribute tool more comfortable to use (v2) |
|
@ale feel free to take it. I'm currently still busy with the node editing improvements. Other topics on my list are the "custom toolbar / context toolbar" and "apply properties to all selected items" in PP. In settings window there are some UI inconsistencies too. So, I have already some to-dos :) BTW: I found a 3 years old mockup about the alignment and distribution palette. It is very close to your description. |
|
Note to self: we don't need a separate button for the guide being selected. We can apply the effect to the button for aligning to the guide. |
|
oh! the the ten buttons on one line do not really make the widget wider... i wonder what is better, when one wants to reach the right one... |
|
I'll present the task at this evening Hackergarten (https://www.meetup.com/hackergarten-zurich/events/305130435/): - Use the Image content palette as a reference - Use sections instead of tabs - Use tool buttons instead of drop downs - Use informational labels - Add the "fade" effect on the "align to guide" tool button. - (Design new icons for the tool buttons) |
|
so, we worked on the align and distribute tool and, in at designer it now looks just as good as the image panel of the content properties. the problem is that, then, the image panel looks correct in scribus but our .ui file is displayed just like in designer. @nitramr : during the weekend, would you have time for teaching me how to use the new folding widget? |
|
@ale did you compiled the SectionContainer widget as designer plugin? In main folder you can find the ScribusDesignerPlugins.pro file 1. Just compile the project as library 2. copy the library in Qt designer plugin folder. For me, it this path: Qt/Tools/QtCreator/lib/Qt/plugins/designer 3. restart qt designer The used Qt version to compile the plugin should <= the version used to compile Qt designer The plugin contains the SectionContainer Widget and FormWidget. If everything is correct, it should look like this. |
|
ok, no! i'm for sure missing the plugin! i will install it. we compared the the xml in the .ui and somehow managed to get something to work... the current state is here: https://gitlab.com/a.l.e/scribus/-/tree/align-and-distribute?ref_type=heads but, before you look at it, i need to add the plugin to the qt designer and check if everything is ok in the .ui file. |
|
Too late, I already looked at it. :D So, the ui files looks correct in designer. At the bottom of the screenshot, you see the compiled palette in Scribus. It looks broken, but after I saved the ui file again it looks correct in Scribus too. |
|
ok, now both show up ok in designer. do you have any hint why in Scribus everything is still on the same line? : - ) |
|
You can try to save the ui file in designer again. Looks like the geometry property of both page widgets occurs the issue. On the left side you can see the file from GitLab, on the right side the file I just saved again in designer without changes. |
|
oh yeah! i've made a small change in the .ui, saved it, compiled and now it shows ok in scribus, too. perfect. during the weekend i will be able to continue my work on it! thanks for your support! |
|
|
|
Great. I should describe using the Designer plugin somewhere. I don't know if you've seen it, but the UI widgets in the Designer also have properties that you can easily change directly there. Let me know if you need new icons. |
|
i've put my notes in here: https://github.com/aoloe/scribus-manual-development/blob/master/content/qt-designer/NOTES.md one day i should take some time to make most of my small manuals a bit more coherent and setup a workflow to create html / epub out of them.... |
|
voilĂ , with the qt designer plugin installed, working with the new scribus widgets is much more pleasant (it's still a bit quirky... but that's on designer!) it's my first experience with the new widgets introduced by martin, and i have to say: they make it "easy" to create pleasant UIs! i attach the intermediate result. with and without informational labels. what is missing: add a (decent) "color animation" on the "align by guide" button, when it is active and a guide is clicked (the coordinates now being in the tooltip of the button itself). if needed, we can make it more "vertically" compact by merging some rows, @nitramr : - any hint on how i can introduce a small gap in the first line, between the Reference and Mode "groups"? - i'd need nine new icons and/or instructions on how to add (temporary) new svg icons - the five align relative to checkable buttons: - first selected - last selected - page - margins - guide - selection - the two checkable align modes: - move - resize - "reverse distribution" in "by distance" (also checkable) |
|
voilĂ : a patch. - the tabs are moved to expandable sections - the comboboxes are now groups of toolbuttons - when the "relative to guide" option is checked, the button pulses when selecting the guide (the coordinates are then in the tooltip) - the icons for the "new" buttons are missing. if martin can't provide them, i can provide a (temporary) set (i'm for slower than him in creating them, but i should be able to come up with something "usable"...). align-and-distribute-into-sections.diff (72,429 bytes)
From 656df5ad3a7573abce175b22b4849b9316254851 Mon Sep 17 00:00:00 2001 From: ale rimoldi <ale@graphicslab.org> Date: Sun, 2 Feb 2025 14:38:38 +0100 Subject: align and distribute: use toolbuttons instead of combobox and merge the tabs into sections diff --git a/scribus/CMakeLists_Sources.txt b/scribus/CMakeLists_Sources.txt index 7b59202c4..4ba985604 100644 --- a/scribus/CMakeLists_Sources.txt +++ b/scribus/CMakeLists_Sources.txt @@ -573,6 +573,7 @@ set(SCRIBUS_SOURCES ui/widgets/pagesizepreview.cpp ui/widgets/pagesizeselector.cpp ui/widgets/popup_menu.cpp + ui/widgets/pulsing_toolbutton.cpp ui/widgets/section_container.cpp ui/widgets/stacked_container.cpp ui/widgets/switch.cpp diff --git a/scribus/ui/aligndistribute.cpp b/scribus/ui/aligndistribute.cpp index b0b057743..8e05385aa 100644 --- a/scribus/ui/aligndistribute.cpp +++ b/scribus/ui/aligndistribute.cpp @@ -22,6 +22,7 @@ for which a new license (GPL+exception) is in place. #include "aligndistribute.h" #include <QComboBox> +#include <QButtonGroup> #include <QEvent> #include <QImage> #include <QLabel> @@ -78,6 +79,21 @@ AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase( //set up scrspinboxes ad->distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0); + groupReference = new QButtonGroup(); + + groupReference->addButton(ad->buttonReferenceFirst, 0); + groupReference->addButton(ad->buttonReferenceLast, 1); + groupReference->addButton(ad->buttonReferencePage, 2); + groupReference->addButton(ad->buttonReferenceMargins, 3); + groupReference->addButton(ad->buttonReferenceGuide, 4); + groupReference->addButton(ad->buttonReferenceSelection, 5); + ad->buttonReferenceFirst->setChecked(true); + + groupMode = new QButtonGroup(); + groupMode->addButton(ad->buttonModeMove, 0); + groupMode->addButton(ad->buttonModeResize, 1); + ad->buttonModeMove->setChecked(true); + resize( QSize(100, 100).expandedTo(minimumSizeHint()) ); languageChange(); init(); @@ -85,6 +101,7 @@ AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase( connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void AlignDistributePalette::changeEvent(QEvent *e) @@ -101,26 +118,18 @@ void AlignDistributePalette::languageChange() { ad->retranslateUi(this); - int alignComboValue = ad->alignRelativeToCombo->currentIndex(); - ad->alignRelativeToCombo->clear(); - ad->alignRelativeToCombo->addItem( tr( "First Selected" ) ); - ad->alignRelativeToCombo->addItem( tr( "Last Selected" ) ); - ad->alignRelativeToCombo->addItem( tr( "Page" ) ); - ad->alignRelativeToCombo->addItem( tr( "Margins" ) ); - ad->alignRelativeToCombo->addItem( tr( "Guide" ) ); - ad->alignRelativeToCombo->addItem( tr( "Selection" ) ); - ad->alignRelativeToCombo->setCurrentIndex(alignComboValue); - ad->alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) ); - alignToChanged(alignComboValue); - - int alignMethodValue = ad->alignMoveOrResizeCombo->currentIndex(); - ad->alignMoveOrResizeCombo->clear(); - ad->alignMoveOrResizeCombo->addItem( tr("Move") ); - ad->alignMoveOrResizeCombo->addItem( tr("Resize") ); - ad->alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" )); - alignMethodChanged(alignMethodValue); - - ad->alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) ); + referenceGuideTooltipTemplate = tr("Align relative to a guide%1"); + + ad->buttonReferenceFirst->setToolTip(tr("Align relative to the first selected item")); + ad->buttonReferenceLast->setToolTip(tr("Align relative to the last selected item")); + ad->buttonReferencePage->setToolTip(tr("Align relative to the current page")); + ad->buttonReferenceMargins->setToolTip(tr("Align relative to the margins of the current page")); + ad->buttonReferenceGuide->setToolTip(referenceGuideTooltipTemplate); + ad->buttonReferenceSelection->setToolTip(tr("Align relative the selection")); + + ad->buttonModeMove->setToolTip(tr("When aligning one side of an item, always move the other side too (preserve existing width and height)")); + ad->buttonModeResize->setToolTip(tr("When aligning one side of an item, whenever possible keep the other side fixed (resize the item instead of moving it)")); + ad->alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) ); ad->alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) ); ad->alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) ); @@ -149,20 +158,33 @@ void AlignDistributePalette::languageChange() ad->distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) ); ad->distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) ); - ad->reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") ); - - guideInfoTextNone = tr("None Selected"); + ad->reverseDistributionButton->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") ); ad->swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) ); ad->swapRightToolButton->setToolTip( tr( "Swap items to the right" ) ); } +void AlignDistributePalette::toggleLabelVisibility(bool v) +{ + ad->alignReferenceLabel->setLabelVisibility(v); + ad->alignModeLabel->setLabelVisibility(v); + ad->alignHorizontalLabel->setLabelVisibility(v); + ad->alignVerticalLabel->setLabelVisibility(v); + ad->swapLabel->setLabelVisibility(v); + ad->distributeHorizontalLabel->setLabelVisibility(v); + ad->distributeVerticalLabel->setLabelVisibility(v); + ad->distributeByGapLabel->setLabelVisibility(v); + ad->distributeByDistanceLabel->setLabelVisibility(v); +} + void AlignDistributePalette::init() { undoManager = UndoManager::instance(); iconSetChange(); + connect(groupReference, &QButtonGroup::idClicked, this, &AlignDistributePalette::alignToChanged); + connect(groupMode, &QButtonGroup::idClicked, this, &AlignDistributePalette::alignMethodChanged); connect(ad->alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut())); connect(ad->alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut())); connect(ad->alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn())); @@ -190,17 +212,11 @@ void AlignDistributePalette::init() connect(ad->swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft())); connect(ad->swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight())); - ad->alignRelativeToCombo->setCurrentIndex(0); alignToChanged(0); alignMethodChanged(0); - connect(ad->alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int))); - connect(ad->alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int))); unitRatio = 1.0; guideDirection = -1; - - guideInfoText = guideInfoTextNone; - ad->alignGuideLineEdit->setText(guideInfoTextNone); } void AlignDistributePalette::iconSetChange() @@ -342,7 +358,7 @@ void AlignDistributePalette::distributeRight() void AlignDistributePalette::distributeDistH(bool usingDistance) { if (currDoc != nullptr) - currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked()); + currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionButton->isChecked()); } void AlignDistributePalette::distributeDistValH() @@ -397,7 +413,7 @@ void AlignDistributePalette::distributeTop() void AlignDistributePalette::distributeDistV(bool usingDistance) { if (currDoc != nullptr) - currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked()); + currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionButton->isChecked()); } void AlignDistributePalette::distributeDistValV() @@ -432,10 +448,9 @@ void AlignDistributePalette::alignMethodChanged(int newAlignMethod) void AlignDistributePalette::setGuide(int direction, qreal position) { - //direction 0 = H, 1 = V -// qDebug() << "AlignDistributePalette::setGuide(" << direction << "" << position << ")"; guideDirection = direction; guidePosition = position; + ad->buttonReferenceGuide->animatePulsing(); enableGuideButtons(); } @@ -449,6 +464,7 @@ void AlignDistributePalette::localeChange() void AlignDistributePalette::enableGuideButtons() { QString suffix; + QString guidePositionText; double unitRatio = 1.0; int precision = 1; if (currDoc != nullptr) @@ -462,17 +478,16 @@ void AlignDistributePalette::enableGuideButtons() switch (guideDirection) { case -1: - guideInfoText = guideInfoTextNone; if (currAlignTo == ScribusDoc::alignGuide) setterH = setterV = false; break; case 0: - guideInfoText = tr("Y: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); + guidePositionText = tr(": Y: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); if (currAlignTo == ScribusDoc::alignGuide) setterV = false; break; case 1: - guideInfoText = tr("X: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); + guidePositionText = tr(": X: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); if (currAlignTo == ScribusDoc::alignGuide) setterH = false; break; @@ -493,6 +508,6 @@ void AlignDistributePalette::enableGuideButtons() ad->alignBottomOutToolButton->setEnabled(setterO); ad->alignCenterVerToolButton->setEnabled(setterH); - ad->alignGuideLineEdit->setText(guideInfoText); + ad->buttonReferenceGuide->setToolTip(referenceGuideTooltipTemplate.arg(guidePositionText == "" ? "" : guidePositionText)); } diff --git a/scribus/ui/aligndistribute.h b/scribus/ui/aligndistribute.h index 0b7934f2c..96f6ace9e 100644 --- a/scribus/ui/aligndistribute.h +++ b/scribus/ui/aligndistribute.h @@ -76,10 +76,13 @@ public: public slots: void setGuide(int, qreal); void localeChange(); + void toggleLabelVisibility(bool v); protected: ScribusView *currView { nullptr }; AlignDistribute * ad {nullptr}; + QButtonGroup* groupReference; + QButtonGroup* groupMode; // UserActionSniffer *userActionSniffer; // void installSniffer(ScrSpinBox *spinBox); @@ -133,8 +136,7 @@ private: qreal unitRatio { 1.0 }; int guideDirection { -1 }; qreal guidePosition { 0.0 }; - QString guideInfoText; - QString guideInfoTextNone; + QString referenceGuideTooltipTemplate; signals: void documentChanged(); diff --git a/scribus/ui/aligndistribute.ui b/scribus/ui/aligndistribute.ui index dcb3273a5..31eb4b9da 100644 --- a/scribus/ui/aligndistribute.ui +++ b/scribus/ui/aligndistribute.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>247</width> - <height>456</height> + <width>308</width> + <height>567</height> </rect> </property> <property name="windowTitle"> @@ -27,19 +27,11 @@ <number>3</number> </property> <item> - <widget class="SectionContainer" name="sectionAlign" native="true"> + <widget class="SectionContainer" name="sectionAlign"> <property name="title" stdset="0"> <string>Align</string> </property> <widget class="QWidget" name="page"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>282</width> - <height>107</height> - </rect> - </property> <layout class="QVBoxLayout" name="verticalLayout_4"> <property name="leftMargin"> <number>8</number> @@ -54,243 +46,477 @@ <number>8</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLineEdit" name="alignGuideLineEdit"/> - </item> - <item> - <widget class="QComboBox" name="alignRelativeToCombo"/> - </item> - <item> - <widget class="QComboBox" name="alignMoveOrResizeCombo"/> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QToolButton" name="alignRightInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="alignReferenceLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Reference</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_13"> + <item> + <widget class="QToolButton" name="buttonReferenceFirst"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceLast"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferencePage"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceMargins"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="PulsingToolButton" name="buttonReferenceGuide"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceSelection"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="alignCenterHorToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="alignModeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Mode</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <item> + <widget class="QToolButton" name="buttonModeMove"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonModeResize"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="alignLeftInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="maximumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>24</width> - <height>24</height> + <width>40</width> + <height>20</height> </size> </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="alignLeftOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="alignRightOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> + </spacer> </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> + <layout class="QHBoxLayout" name="horizontalLayout_18"> <item> - <widget class="QToolButton" name="alignBottomInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="alignCenterVerToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="alignHorizontalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Horizontal</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_15"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QToolButton" name="alignRightInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignCenterHorToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignLeftInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignLeftOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignRightOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="alignTopInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="maximumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>24</width> - <height>24</height> + <width>40</width> + <height>20</height> </size> </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> + </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_19"> <item> - <widget class="QToolButton" name="alignTopOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="alignVerticalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Vertical</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <item> + <widget class="QToolButton" name="alignBottomInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignCenterVerToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignTopInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignTopOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignBottomOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="alignBottomOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="maximumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>24</width> - <height>24</height> + <width>40</width> + <height>20</height> </size> </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> + </spacer> </item> </layout> </item> @@ -299,19 +525,11 @@ </widget> </item> <item> - <widget class="SectionContainer" name="sectionDistribute" native="true"> + <widget class="SectionContainer" name="sectionDistribute"> <property name="title" stdset="0"> <string>Distribute</string> </property> <widget class="QWidget" name="page_2"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>176</width> - <height>233</height> - </rect> - </property> <layout class="QVBoxLayout" name="verticalLayout_7"> <property name="leftMargin"> <number>8</number> @@ -326,417 +544,629 @@ <number>8</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> + <layout class="QHBoxLayout" name="horizontalLayout_24"> <item> - <widget class="QToolButton" name="distributeDistValueVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="distributeHorizontalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Horizontal</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_21"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="QToolButton" name="distributeDistHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeRightToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeCenterHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeLeftToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="distributeDistValueHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="iconSize"> + <property name="sizeHint" stdset="0"> <size> - <width>22</width> - <height>22</height> + <width>40</width> + <height>20</height> </size> </property> - </widget> + </spacer> </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QToolButton" name="distributeDistHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="distributeRightToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> + <layout class="QHBoxLayout" name="horizontalLayout_25"> <item> - <widget class="QToolButton" name="distributeCenterHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="distributeVerticalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Vertical</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_22"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QToolButton" name="distributeCenterVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeBottomToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeTopToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="distributeLeftToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="iconSize"> + <property name="sizeHint" stdset="0"> <size> - <width>22</width> - <height>22</height> + <width>40</width> + <height>20</height> </size> </property> - </widget> + </spacer> </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> + <layout class="QHBoxLayout" name="horizontalLayout_26"> <item> - <widget class="QToolButton" name="distributeCenterVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="distributeByGapLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>By gap</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_23"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <item> + <widget class="QToolButton" name="distributeDownPageToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeAcrossPageToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDownMarginsToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="distributeBottomToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="iconSize"> + <property name="sizeHint" stdset="0"> <size> - <width>22</width> - <height>22</height> + <width>40</width> + <height>20</height> </size> </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="distributeDistVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="distributeTopToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> + </spacer> </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <widget class="QToolButton" name="distributeDownPageToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="distributeAcrossPageToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> + <layout class="QHBoxLayout" name="horizontalLayout_10"> <item> - <widget class="QToolButton" name="distributeDownMarginsToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="distributeByDistanceLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>By distance</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_20"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <item> + <widget class="QToolButton" name="distributeDistValueVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistValueHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="ScrSpinBox" name="distributeDistSpinBox"> + <property name="minimumSize"> + <size> + <width>50</width> + <height>24</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="reverseDistributionButton"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="maximumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>24</width> - <height>24</height> + <width>40</width> + <height>20</height> </size> </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> + </spacer> </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_11"> - <item> - <widget class="QToolButton" name="swapRightToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QToolButton" name="swapLeftToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> + <widget class="FormWidget" name="swapLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Swap</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <item> + <widget class="QToolButton" name="swapRightToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="swapLeftToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_10"> <item> - <widget class="QCheckBox" name="checkBoxAlignSpacing"> - <property name="text"> - <string>Use Spacing</string> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - </widget> - </item> - <item> - <widget class="ScrSpinBox" name="distributeDistSpinBox"> - <property name="minimumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>50</width> - <height>24</height> + <width>40</width> + <height>20</height> </size> </property> - </widget> + </spacer> </item> </layout> </item> - <item> - <widget class="QCheckBox" name="reverseDistributionCheckBox"> - <property name="text"> - <string>Reverse Distribution</string> - </property> - </widget> - </item> </layout> </widget> </widget> @@ -758,16 +1188,28 @@ </widget> <customwidgets> <customwidget> - <class>ScrSpinBox</class> - <extends>QDoubleSpinBox</extends> - <header>ui/scrspinbox.h</header> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> </customwidget> <customwidget> <class>SectionContainer</class> <extends>QWidget</extends> <header>ui/widgets/section_container.h</header> + <addpagemethod>setWidget</addpagemethod> <container>1</container> </customwidget> + <customwidget> + <class>ScrSpinBox</class> + <extends>QDoubleSpinBox</extends> + <header>ui/scrspinbox.h</header> + </customwidget> + <customwidget> + <class>PulsingToolButton</class> + <extends>QToolButton</extends> + <header>ui/widgets/pulsing_toolbutton.h</header> + </customwidget> </customwidgets> <includes> <include location="local">ui/scrspinbox.h</include> diff --git a/scribus/ui/widgets/pulsing_toolbutton.cpp b/scribus/ui/widgets/pulsing_toolbutton.cpp new file mode 100644 index 000000000..106ffc8b0 --- /dev/null +++ b/scribus/ui/widgets/pulsing_toolbutton.cpp @@ -0,0 +1,79 @@ +#include "pulsing_toolbutton.h" + +#include <QBrush> +#include <QColor> +#include <QPaintEvent> +#include <QPalette> +#include <QStyle> +#include <QStyleOptionButton> +#include <QStylePainter> +#include <QString> +#include <QToolButton> +#include <QVariant> +#include <QVariantAnimation> +#include <QWidget> + +PulsingToolButton::PulsingToolButton(QWidget *parent): + QToolButton(parent), + m_transition(nullptr) +{ +} + +void PulsingToolButton::paintEvent(QPaintEvent* event) +{ + if (m_transition == nullptr) + { + QToolButton::paintEvent(event); + } + else + { + QStylePainter p(this); + QStyleOptionToolButton opt; + initStyleOption(&opt); + p.drawComplexControl(QStyle::CC_ToolButton, opt); + + m_currentColor.setAlpha(100); + p.setBrush(m_currentColor); + p.setPen(Qt::NoPen); + p.drawRect(0,0,width(),height()); + } +} + +// https://stackoverflow.com/questions/53084981/how-to-add-a-hover-transition-to-qpushbutton +// https://forum.qt.io/post/538500 +void PulsingToolButton::animatePulsing() +{ + if (!isChecked()) + { + return; + } + if (m_transition != nullptr) + { + // too fast, don't show a second animation + return; + // m_transition->stop(); + } + + m_transition = new QVariantAnimation(this); + m_transition->setDuration(1000); // TODO: this should be a class const + + QColor startColor = palette().button().color(); + QColor endColor = palette().shadow().color(); + + m_transition->setStartValue(startColor); + m_transition->setEndValue(endColor); + + connect(m_transition, &QVariantAnimation::valueChanged, + this, [this](const QVariant &value){ + m_currentColor = value.value<QColor>(); + repaint(); + }); + + connect(m_transition, &QVariantAnimation::destroyed, + this, [this](){ + m_transition = nullptr; + repaint(); + }); + + m_transition->start(QAbstractAnimation::DeleteWhenStopped); +} diff --git a/scribus/ui/widgets/pulsing_toolbutton.h b/scribus/ui/widgets/pulsing_toolbutton.h new file mode 100644 index 000000000..c071fa483 --- /dev/null +++ b/scribus/ui/widgets/pulsing_toolbutton.h @@ -0,0 +1,40 @@ +#ifndef PULSING_TOOLBUTTON_H +#define PULSING_TOOLBUTTON_H + +/** + * Change the background color of the ToolButton to the opposite among checked and unchecked, + * then animate the transition back to the original color. + * Currently, done by draing a semitransparent rectangle on top of the button. + * + * In the future, the widget can be extend to pulse in a loop until mouseover, or other + * fancy gadgets. + * + * The current minimal implementation is tailored for the buttonReferenceGuide button in + * the align and distribute dialog: + * - It only pulses once. + * - It only pulses when it's checked. + * - The animation time is a constant. + */ + +#include <QColor> +#include <QToolButton> + +class QVariantAnimation; +class QWidget; + +class PulsingToolButton : public QToolButton +{ + Q_OBJECT +public: + explicit PulsingToolButton(QWidget *parent = nullptr); + void animatePulsing(); + +protected: + void paintEvent(QPaintEvent *) override; + +private: + QVariantAnimation *m_transition; + QColor m_currentColor; +}; + +#endif |
|
p.s.: i still need hints from martin, on how to add a gap between the two groups in the first row... |
|
@ale Here you can find information about the icon set and how to use it (just basic infos) https://wiki.scribus.net/canvas/IndigoDevelopment#SVG_based_Icon_System Here I write a small Style Guide for the UI. Basic too at the moment. https://wiki.scribus.net/canvas/IndigoUI_Style_Guide |
|
here is the .ui file, with the spacing set according to the specs. replaces the one in the diff. aligndistribute.ui (40,799 bytes)
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>AlignDistribute</class> <widget class="QWidget" name="AlignDistribute"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>308</width> <height>567</height> </rect> </property> <property name="windowTitle"> <string>Align and Distribute</string> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> <property name="spacing"> <number>0</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="SectionContainer" name="sectionAlign"> <property name="title" stdset="0"> <string>Align</string> </property> <widget class="QWidget" name="page"> <layout class="QVBoxLayout" name="verticalLayout_4"> <property name="leftMargin"> <number>8</number> </property> <property name="topMargin"> <number>8</number> </property> <property name="rightMargin"> <number>8</number> </property> <property name="bottomMargin"> <number>8</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="spacing"> <number>16</number> </property> <item> <widget class="FormWidget" name="alignReferenceLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>Reference</string> </property> <layout class="QHBoxLayout" name="horizontalLayout"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_13"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="buttonReferenceFirst"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferenceLast"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferencePage"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferenceMargins"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="PulsingToolButton" name="buttonReferenceGuide"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferenceSelection"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <widget class="FormWidget" name="alignModeLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>Mode</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_12"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_14"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="buttonModeMove"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonModeResize"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_18"> <item> <widget class="FormWidget" name="alignHorizontalLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>Horizontal</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_15"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_4"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="alignRightInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignCenterHorToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignLeftInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignLeftOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignRightOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_19"> <item> <widget class="FormWidget" name="alignVerticalLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>Vertical</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_16"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_5"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="alignBottomInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignCenterVerToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignTopInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignTopOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignBottomOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_3"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> </widget> </item> <item> <widget class="SectionContainer" name="sectionDistribute"> <property name="title" stdset="0"> <string>Distribute</string> </property> <widget class="QWidget" name="page_2"> <layout class="QVBoxLayout" name="verticalLayout_7"> <property name="spacing"> <number>8</number> </property> <property name="leftMargin"> <number>8</number> </property> <property name="topMargin"> <number>8</number> </property> <property name="rightMargin"> <number>8</number> </property> <property name="bottomMargin"> <number>8</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_24"> <item> <widget class="FormWidget" name="distributeHorizontalLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>Horizontal</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_21"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_6"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="distributeDistHToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeRightToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeCenterHToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeLeftToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_6"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_25"> <item> <widget class="FormWidget" name="distributeVerticalLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>Vertical</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_22"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_7"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="distributeCenterVToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeBottomToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDistVToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeTopToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_7"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_26"> <item> <widget class="FormWidget" name="distributeByGapLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>By gap</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_23"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_8"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="distributeDownPageToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeAcrossPageToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDownMarginsToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_8"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_10"> <item> <widget class="FormWidget" name="distributeByDistanceLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>By distance</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_20"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_9"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="distributeDistValueVToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDistValueHToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="ScrSpinBox" name="distributeDistSpinBox"> <property name="minimumSize"> <size> <width>50</width> <height>24</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="reverseDistributionButton"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_4"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> <widget class="FormWidget" name="swapLabel"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="label" stdset="0"> <string>Swap</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_17"> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_11"> <property name="spacing"> <number>4</number> </property> <item> <widget class="QToolButton" name="swapRightToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="swapLeftToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_5"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> </widget> </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </item> </layout> </widget> <customwidgets> <customwidget> <class>FormWidget</class> <extends>QWidget</extends> <header>ui/widgets/form_widget.h</header> <container>1</container> </customwidget> <customwidget> <class>SectionContainer</class> <extends>QWidget</extends> <header>ui/widgets/section_container.h</header> <addpagemethod>setWidget</addpagemethod> <container>1</container> </customwidget> <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> <header>ui/scrspinbox.h</header> </customwidget> <customwidget> <class>PulsingToolButton</class> <extends>QToolButton</extends> <header>ui/widgets/pulsing_toolbutton.h</header> </customwidget> </customwidgets> <includes> <include location="local">ui/scrspinbox.h</include> </includes> <resources/> <connections/> </ui> |
|
ok, i gave the icons creation a try, but inkscape does not seem to be the right tool. any hint on how to create the files in a similar clean state as yours? |
|
I used Figma for the icon creation, because it has a great icon optimization on export. Unfortunately, it has limited collaboration features in the free version. Because of that, I wanted to export the project to Penpot (open source), but the import was not great. But Penpot has the same lossless export than Inkscape. At one day I will move everything to Penpot (as soon as the importer works correctly). BTW: I added some icon specs on the wiki page too. |
|
Here are some icon suggestions. I'm worried that the icons are all too similar to the others in the palette. Maybe we can add an icon extension in bottom right corner? If we don't want all the options to be visible, we can use a dropdown button instead of the dropdown widget. There is also a corresponding widget in ui -> widgets -> DropDownButton. I also used that in the View Toolbar. |
|
is there a way for scribus to recognize the new ids in resources/iconsets/1_7_0/1_7_0.xml without doing a full build from scratch? the last icon for reversing the anchor when distributing by a distance is missing. do we have a way to set a different icon when the the button is checked? (i've tried to do it by attaching some css with "QToolButton:checked {url(...)}" but i could not find a path that works in url...) if it's the case i would suggest the two icons attached (based on your icons, of course!) p.s.: since i could not find anything fitting, i'm creating my own icon's editor... still a bit rough, but i could create the two icons below : - ) |
|
>> is there a way for scribus to recognize the new ids in resources/iconsets/1_7_0/1_7_0.xml without doing a full build from scratch? You mean after you build Scribus they are not there? If this is a case, you can delete the resources folder in your build folder and build Scribus again. >> do we have a way to set a different icon when the the button is checked? Just create an QIcon by yourself and load the different pixmaps for each state. QIcon icoPrint; icoPrint.addPixmap(im.loadPixmap("NoPrint.png"), QIcon::Normal, QIcon::On); icoPrint.addPixmap(im.loadPixmap("16/document-print.png"), QIcon::Normal, QIcon::Off); noPrint->setIcon(icoPrint); |
|
@nitramr is there a reason why you have put the "go to left" actions to the right and the "go to right" ones on the left? it feels counterintuitive to me and i would prefer to go back to the order we had in 1.6... |
|
- Uses sections instead of tabs (all buttons are always visible) - Uses groups of toolbuttons instead of comboboxes (all options are always visible) - Replaces the input box with the position of the reference guide by a pulsing effect on the specific "reference" button (only when the button is checked); the tooltip of the button contains the position of the guide used as a reference - Restores the left to right and top down order of the actions, as it was in 1.6. |
|
can also be viewed (and reviewed!) on gitlab https://gitlab.com/scribus/scribus/-/merge_requests/47 align-and-distribute-into-sections-20250226.diff (89,438 bytes)
diff --git a/resources/iconsets/1_7_0/1_7_0.xml b/resources/iconsets/1_7_0/1_7_0.xml index 6bdabe870..4c4dd42b0 100644 --- a/resources/iconsets/1_7_0/1_7_0.xml +++ b/resources/iconsets/1_7_0/1_7_0.xml @@ -173,6 +173,16 @@ On Dark: #e580ff; rgb(229, 128, 255); hsl(288, 100, 75) <icon onLight="#68B259" onDark="#88CC7A" id="ok.png" file="16/alert-ok.svg" /> <!-- Align & Distribute --> + <icon id="22/align-to-first-selected.png" file="16/align-to-first-selected.svg" /> + <icon id="22/align-to-guides.png" file="16/align-to-guides.svg" /> + <icon id="22/align-to-last-selected-1.png" file="16/align-to-last-selected-1.svg" /> + <icon id="22/align-to-last-selected.png" file="16/align-to-last-selected.svg" /> + <icon id="22/align-to-margin.png" file="16/align-to-margin.svg" /> + <icon id="22/align-to-page.png" file="16/align-to-page.svg" /> + <icon id="22/align-mode-move.png" file="16/align-mode-move.svg" /> + <icon id="22/align-mode-resize.png" file="16/align-mode-resize.svg" /> + <icon id="22/align-reverse-distribution-right.png" file="16/align-reverse-distribution-right.svg" /> + <icon id="22/align-reverse-distribution-left.png" file="16/align-reverse-distribution-left.svg" /> <icon id="22/align-horizontal-center.png" file="16/align-item-horizontal-center.svg" /> <icon id="22/align-horizontal-left-out.png" file="16/align-item-horizontal-left-out.svg" /> <icon id="22/align-horizontal-left.png" file="16/align-item-horizontal-left.svg" /> diff --git a/scribus/CMakeLists_Sources.txt b/scribus/CMakeLists_Sources.txt index 7b59202c4..4ba985604 100644 --- a/scribus/CMakeLists_Sources.txt +++ b/scribus/CMakeLists_Sources.txt @@ -573,6 +573,7 @@ set(SCRIBUS_SOURCES ui/widgets/pagesizepreview.cpp ui/widgets/pagesizeselector.cpp ui/widgets/popup_menu.cpp + ui/widgets/pulsing_toolbutton.cpp ui/widgets/section_container.cpp ui/widgets/stacked_container.cpp ui/widgets/switch.cpp diff --git a/scribus/ui/aligndistribute.cpp b/scribus/ui/aligndistribute.cpp index 7a0ccc374..c1f270c7d 100644 --- a/scribus/ui/aligndistribute.cpp +++ b/scribus/ui/aligndistribute.cpp @@ -22,6 +22,7 @@ for which a new license (GPL+exception) is in place. #include "aligndistribute.h" #include <QComboBox> +#include <QButtonGroup> #include <QEvent> #include <QImage> #include <QLabel> @@ -45,11 +46,19 @@ for which a new license (GPL+exception) is in place. #include "undomanager.h" #include "units.h" -//TODO Distribute with - AlignDistribute::AlignDistribute(QWidget* parent) : QWidget(parent) { setupUi(this); + + sectionAlign->expand(); + sectionAlign->setCanSaveState(true); + sectionAlign->restorePreferences(); + + sectionDistribute->expand(); + sectionDistribute->setCanSaveState(true); + sectionDistribute->restorePreferences(); + + } @@ -66,6 +75,21 @@ AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase( //set up scrspinboxes ad->distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0); + groupReference = new QButtonGroup(); + + groupReference->addButton(ad->buttonReferenceFirst, 0); + groupReference->addButton(ad->buttonReferenceLast, 1); + groupReference->addButton(ad->buttonReferencePage, 2); + groupReference->addButton(ad->buttonReferenceMargins, 3); + groupReference->addButton(ad->buttonReferenceGuide, 4); + groupReference->addButton(ad->buttonReferenceSelection, 5); + ad->buttonReferenceFirst->setChecked(true); + + groupMode = new QButtonGroup(); + groupMode->addButton(ad->buttonModeMove, 0); + groupMode->addButton(ad->buttonModeResize, 1); + ad->buttonModeMove->setChecked(true); + resize( QSize(100, 100).expandedTo(minimumSizeHint()) ); languageChange(); init(); @@ -73,6 +97,7 @@ AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase( connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void AlignDistributePalette::changeEvent(QEvent *e) @@ -89,26 +114,18 @@ void AlignDistributePalette::languageChange() { ad->retranslateUi(this); - int alignComboValue = ad->alignRelativeToCombo->currentIndex(); - ad->alignRelativeToCombo->clear(); - ad->alignRelativeToCombo->addItem( tr( "First Selected" ) ); - ad->alignRelativeToCombo->addItem( tr( "Last Selected" ) ); - ad->alignRelativeToCombo->addItem( tr( "Page" ) ); - ad->alignRelativeToCombo->addItem( tr( "Margins" ) ); - ad->alignRelativeToCombo->addItem( tr( "Guide" ) ); - ad->alignRelativeToCombo->addItem( tr( "Selection" ) ); - ad->alignRelativeToCombo->setCurrentIndex(alignComboValue); - ad->alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) ); - alignToChanged(alignComboValue); - - int alignMethodValue = ad->alignMoveOrResizeCombo->currentIndex(); - ad->alignMoveOrResizeCombo->clear(); - ad->alignMoveOrResizeCombo->addItem( tr("Move") ); - ad->alignMoveOrResizeCombo->addItem( tr("Resize") ); - ad->alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" )); - alignMethodChanged(alignMethodValue); - - ad->alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) ); + referenceGuideTooltipTemplate = tr("Align relative to a guide%1"); + + ad->buttonReferenceFirst->setToolTip(tr("Align relative to the first selected item")); + ad->buttonReferenceLast->setToolTip(tr("Align relative to the last selected item")); + ad->buttonReferencePage->setToolTip(tr("Align relative to the current page")); + ad->buttonReferenceMargins->setToolTip(tr("Align relative to the margins of the current page")); + ad->buttonReferenceGuide->setToolTip(referenceGuideTooltipTemplate); + ad->buttonReferenceSelection->setToolTip(tr("Align relative the selection")); + + ad->buttonModeMove->setToolTip(tr("When aligning one side of an item, always move the other side too (preserve existing width and height)")); + ad->buttonModeResize->setToolTip(tr("When aligning one side of an item, whenever possible keep the other side fixed (resize the item instead of moving it)")); + ad->alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) ); ad->alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) ); ad->alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) ); @@ -137,20 +154,33 @@ void AlignDistributePalette::languageChange() ad->distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) ); ad->distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) ); - ad->reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") ); - - guideInfoTextNone = tr("None Selected"); + ad->reverseDistributionButton->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") ); ad->swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) ); ad->swapRightToolButton->setToolTip( tr( "Swap items to the right" ) ); } +void AlignDistributePalette::toggleLabelVisibility(bool v) +{ + ad->alignReferenceLabel->setLabelVisibility(v); + ad->alignModeLabel->setLabelVisibility(v); + ad->alignHorizontalLabel->setLabelVisibility(v); + ad->alignVerticalLabel->setLabelVisibility(v); + ad->swapLabel->setLabelVisibility(v); + ad->distributeHorizontalLabel->setLabelVisibility(v); + ad->distributeVerticalLabel->setLabelVisibility(v); + ad->distributeByGapLabel->setLabelVisibility(v); + ad->distributeByDistanceLabel->setLabelVisibility(v); +} + void AlignDistributePalette::init() { undoManager = UndoManager::instance(); iconSetChange(); + connect(groupReference, &QButtonGroup::idClicked, this, &AlignDistributePalette::alignToChanged); + connect(groupMode, &QButtonGroup::idClicked, this, &AlignDistributePalette::alignMethodChanged); connect(ad->alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut())); connect(ad->alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut())); connect(ad->alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn())); @@ -178,23 +208,37 @@ void AlignDistributePalette::init() connect(ad->swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft())); connect(ad->swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight())); - ad->alignRelativeToCombo->setCurrentIndex(0); alignToChanged(0); alignMethodChanged(0); - connect(ad->alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int))); - connect(ad->alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int))); unitRatio = 1.0; guideDirection = -1; - - guideInfoText = guideInfoTextNone; - ad->alignGuideLineEdit->setText(guideInfoTextNone); } void AlignDistributePalette::iconSetChange() { IconManager& im = IconManager::instance(); + ad->alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png")); + ad->buttonReferenceFirst->setIcon(im.loadIcon("22/align-to-first-selected.png")); + ad->buttonReferenceLast->setIcon(im.loadIcon("22/align-to-last-selected.png")); + ad->buttonReferencePage->setIcon(im.loadIcon("22/align-to-page.png")); + ad->buttonReferenceMargins->setIcon(im.loadIcon("22/align-to-margin.png")); + ad->buttonReferenceGuide->setIcon(im.loadIcon("22/align-to-guides.png")); + ad->buttonReferenceSelection->setIcon(im.loadIcon("22/align-to-last-selected-1.png")); + ad->buttonModeMove->setIcon(im.loadIcon("22/align-mode-move.png")); + ad->buttonModeResize->setIcon(im.loadIcon("22/align-mode-resize.png")); + QIcon reverseDistributionIcon; + reverseDistributionIcon.addPixmap(im.loadPixmap( + "22/align-reverse-distribution-right.png"), + QIcon::Normal, + QIcon::On); + reverseDistributionIcon.addPixmap(im.loadPixmap( + "22/align-reverse-distribution-left.png"), + QIcon::Normal, + QIcon::Off); + ad->reverseDistributionButton->setIcon(reverseDistributionIcon); + ad->alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png")); ad->alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png")); ad->alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png")); @@ -330,7 +374,7 @@ void AlignDistributePalette::distributeRight() void AlignDistributePalette::distributeDistH(bool usingDistance) { if (currDoc != nullptr) - currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked()); + currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionButton->isChecked()); } void AlignDistributePalette::distributeDistValH() @@ -385,7 +429,7 @@ void AlignDistributePalette::distributeTop() void AlignDistributePalette::distributeDistV(bool usingDistance) { if (currDoc != nullptr) - currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked()); + currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionButton->isChecked()); } void AlignDistributePalette::distributeDistValV() @@ -420,10 +464,9 @@ void AlignDistributePalette::alignMethodChanged(int newAlignMethod) void AlignDistributePalette::setGuide(int direction, qreal position) { - //direction 0 = H, 1 = V -// qDebug() << "AlignDistributePalette::setGuide(" << direction << "" << position << ")"; guideDirection = direction; guidePosition = position; + ad->buttonReferenceGuide->animatePulsing(); enableGuideButtons(); } @@ -437,6 +480,7 @@ void AlignDistributePalette::localeChange() void AlignDistributePalette::enableGuideButtons() { QString suffix; + QString guidePositionText; double unitRatio = 1.0; int precision = 1; if (currDoc != nullptr) @@ -450,17 +494,16 @@ void AlignDistributePalette::enableGuideButtons() switch (guideDirection) { case -1: - guideInfoText = guideInfoTextNone; if (currAlignTo == ScribusDoc::alignGuide) setterH = setterV = false; break; case 0: - guideInfoText = tr("Y: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); + guidePositionText = tr(": Y: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); if (currAlignTo == ScribusDoc::alignGuide) setterV = false; break; case 1: - guideInfoText = tr("X: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); + guidePositionText = tr(": X: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); if (currAlignTo == ScribusDoc::alignGuide) setterH = false; break; @@ -481,6 +524,6 @@ void AlignDistributePalette::enableGuideButtons() ad->alignBottomOutToolButton->setEnabled(setterO); ad->alignCenterVerToolButton->setEnabled(setterH); - ad->alignGuideLineEdit->setText(guideInfoText); + ad->buttonReferenceGuide->setToolTip(referenceGuideTooltipTemplate.arg(guidePositionText == "" ? "" : guidePositionText)); } diff --git a/scribus/ui/aligndistribute.h b/scribus/ui/aligndistribute.h index 5d1cd42e0..799eebaee 100644 --- a/scribus/ui/aligndistribute.h +++ b/scribus/ui/aligndistribute.h @@ -76,10 +76,13 @@ public: public slots: void setGuide(int, qreal); void localeChange(); + void toggleLabelVisibility(bool v); protected: ScribusView *currView { nullptr }; AlignDistribute * ad {nullptr}; + QButtonGroup* groupReference; + QButtonGroup* groupMode; void changeEvent(QEvent *e) override; @@ -129,8 +132,7 @@ private: qreal unitRatio { 1.0 }; int guideDirection { -1 }; qreal guidePosition { 0.0 }; - QString guideInfoText; - QString guideInfoTextNone; + QString referenceGuideTooltipTemplate; signals: void documentChanged(); diff --git a/scribus/ui/aligndistribute.ui b/scribus/ui/aligndistribute.ui index 0a5bb2620..c37be3189 100644 --- a/scribus/ui/aligndistribute.ui +++ b/scribus/ui/aligndistribute.ui @@ -6,131 +6,205 @@ <rect> <x>0</x> <y>0</y> - <width>247</width> - <height>277</height> + <width>308</width> + <height>567</height> </rect> </property> <property name="windowTitle"> <string>Align and Distribute</string> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>0</number> + </property> <property name="leftMargin"> - <number>3</number> + <number>0</number> </property> <property name="topMargin"> - <number>3</number> + <number>0</number> </property> <property name="rightMargin"> - <number>3</number> + <number>0</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>0</number> </property> <item> - <widget class="QTabWidget" name="tabWidget"> - <property name="currentIndex"> - <number>0</number> + <widget class="SectionContainer" name="sectionAlign"> + <property name="title" stdset="0"> + <string>Align</string> </property> - <widget class="QWidget" name="tabAlign"> - <attribute name="title"> - <string>Align</string> - </attribute> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>3</number> - </property> + <widget class="QWidget" name="page"> + <layout class="QVBoxLayout" name="verticalLayout_4"> <property name="leftMargin"> - <number>6</number> + <number>8</number> </property> <property name="topMargin"> - <number>6</number> + <number>8</number> </property> <property name="rightMargin"> - <number>6</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>6</number> + <number>8</number> </property> <item> - <layout class="QHBoxLayout" name="_2"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="FormWidget" name="alignReferenceLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="label" stdset="0"> + <string>Reference</string> </property> - </spacer> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_13"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="buttonReferenceFirst"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceLast"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferencePage"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceMargins"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="PulsingToolButton" name="buttonReferenceGuide"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceSelection"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> </item> <item> - <layout class="QGridLayout" name="_3"> - <item row="1" column="0"> - <widget class="QLabel" name="alignGuideLabel"> - <property name="text"> - <string>&Selected Guide:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="buddy"> - <cstring>alignGuideLineEdit</cstring> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="alignRelativeToLabel"> - <property name="text"> - <string>&Relative To:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="buddy"> - <cstring>alignRelativeToCombo</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="alignGuideLineEdit"/> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="alignRelativeToCombo"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="alignMoveOrResizeLabel"> - <property name="text"> - <string>&Align Sides By:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="buddy"> - <cstring>alignMoveOrResizeCombo</cstring> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QComboBox" name="alignMoveOrResizeCombo"/> - </item> - </layout> + <widget class="FormWidget" name="alignModeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Mode</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="buttonModeMove"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonModeResize"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -143,17 +217,155 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="_4"> - <property name="spacing"> - <number>3</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_18"> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="FormWidget" name="alignHorizontalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Horizontal</string> </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <layout class="QHBoxLayout" name="horizontalLayout_15"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="alignLeftInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignCenterHorToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignRightInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignRightOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignLeftOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -163,237 +375,158 @@ </property> </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_19"> <item> - <layout class="QGridLayout" name="_5"> - <item row="1" column="3"> - <widget class="QToolButton" name="alignBottomInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QToolButton" name="alignTopInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="alignLeftInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QToolButton" name="alignRightInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="4"> - <widget class="QToolButton" name="alignBottomOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QToolButton" name="alignTopOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QToolButton" name="alignCenterVerToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QToolButton" name="alignLeftOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="4"> - <widget class="QToolButton" name="alignRightOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QToolButton" name="alignCenterHorToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - </layout> + <widget class="FormWidget" name="alignVerticalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Vertical</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="alignTopInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignCenterVerToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignBottomInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignBottomOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignTopOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer_3"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -405,400 +538,164 @@ </item> </layout> </item> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> </layout> </widget> - <widget class="QWidget" name="tabDistribute"> - <attribute name="title"> - <string>Distribute</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> + </widget> + </item> + <item> + <widget class="SectionContainer" name="sectionDistribute"> + <property name="title" stdset="0"> + <string>Distribute</string> + </property> + <widget class="QWidget" name="page_2"> + <layout class="QVBoxLayout" name="verticalLayout_7"> <property name="spacing"> - <number>3</number> + <number>8</number> </property> <property name="leftMargin"> - <number>6</number> + <number>8</number> </property> <property name="topMargin"> - <number>6</number> + <number>8</number> </property> <property name="rightMargin"> - <number>6</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>6</number> + <number>8</number> </property> <item> - <layout class="QHBoxLayout" name="_6"> - <property name="spacing"> - <number>3</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_24"> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <widget class="FormWidget" name="distributeHorizontalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>63</width> - <height>20</height> - </size> + <property name="label" stdset="0"> + <string>Horizontal</string> </property> - </spacer> - </item> - <item> - <layout class="QGridLayout" name="_7"> - <item row="0" column="3"> - <widget class="QToolButton" name="distributeDistHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QToolButton" name="distributeTopToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QToolButton" name="distributeCenterVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QToolButton" name="distributeRightToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QToolButton" name="distributeLeftToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QToolButton" name="distributeAcrossPageToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QToolButton" name="distributeDistValueHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QToolButton" name="distributeDownMarginsToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="distributeCenterHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QToolButton" name="distributeDownPageToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QToolButton" name="distributeDistValueVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QToolButton" name="distributeDistVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QToolButton" name="distributeBottomToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - </layout> + <layout class="QHBoxLayout" name="horizontalLayout_21"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="distributeLeftToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeCenterHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeRightToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer_6"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>62</width> + <width>40</width> <height>20</height> </size> </property> @@ -807,63 +704,133 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="_8"> + <layout class="QHBoxLayout" name="horizontalLayout_25"> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="FormWidget" name="distributeVerticalLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <property name="label" stdset="0"> + <string>Vertical</string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="_9"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="distributeDistLabel"> - <property name="text"> - <string>&Distance:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="indent"> - <number>-1</number> - </property> - <property name="buddy"> - <cstring>distributeDistSpinBox</cstring> - </property> - </widget> - </item> - <item> - <widget class="ScrSpinBox" name="distributeDistSpinBox"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>24</height> - </size> - </property> - </widget> - </item> - </layout> + <layout class="QHBoxLayout" name="horizontalLayout_22"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="distributeTopToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeCenterVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeBottomToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer_7"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -876,40 +843,145 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="spacing"> - <number>3</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_26"> <item> - <spacer name="spacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="FormWidget" name="distributeByGapLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QCheckBox" name="reverseDistributionCheckBox"> - <property name="text"> - <string>Reverse Distribution</string> + <property name="label" stdset="0"> + <string>By gap</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_23"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="distributeAcrossPageToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDownPageToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDownMarginsToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <spacer name="spacer_2"> + <spacer name="horizontalSpacer_8"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -922,52 +994,109 @@ </layout> </item> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="tabSwap"> - <attribute name="title"> - <string>Swap</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>6</number> - </property> - <property name="topMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>6</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> - <number>3</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_10"> <item> - <spacer name="horizontalSpacer"> + <widget class="FormWidget" name="distributeByDistanceLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>By distance</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_20"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="distributeDistValueVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistValueHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="ScrSpinBox" name="distributeDistSpinBox"> + <property name="minimumSize"> + <size> + <width>50</width> + <height>24</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="reverseDistributionButton"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -977,54 +1106,92 @@ </property> </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QToolButton" name="swapLeftToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="swapRightToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> + <widget class="FormWidget" name="swapLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> + <property name="label" stdset="0"> + <string>Swap</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="swapLeftToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="swapRightToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </item> <item> - <spacer name="horizontalSpacer_2"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -1036,65 +1203,87 @@ </item> </layout> </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> </layout> </widget> </widget> </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <customwidgets> + <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>SectionContainer</class> + <extends>QWidget</extends> + <header>ui/widgets/section_container.h</header> + <addpagemethod>setWidget</addpagemethod> + <container>1</container> + </customwidget> <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> <header>ui/scrspinbox.h</header> </customwidget> + <customwidget> + <class>PulsingToolButton</class> + <extends>QToolButton</extends> + <header>ui/widgets/pulsing_toolbutton.h</header> + </customwidget> </customwidgets> <tabstops> - <tabstop>alignRelativeToCombo</tabstop> - <tabstop>alignGuideLineEdit</tabstop> - <tabstop>alignMoveOrResizeCombo</tabstop> - <tabstop>alignLeftOutToolButton</tabstop> + <tabstop>buttonReferenceFirst</tabstop> + <tabstop>buttonReferenceLast</tabstop> + <tabstop>buttonReferencePage</tabstop> + <tabstop>buttonReferenceMargins</tabstop> + <tabstop>buttonReferenceGuide</tabstop> + <tabstop>buttonReferenceSelection</tabstop> + <tabstop>buttonModeMove</tabstop> + <tabstop>buttonModeResize</tabstop> <tabstop>alignLeftInToolButton</tabstop> <tabstop>alignCenterHorToolButton</tabstop> <tabstop>alignRightInToolButton</tabstop> <tabstop>alignRightOutToolButton</tabstop> - <tabstop>alignTopOutToolButton</tabstop> + <tabstop>alignLeftOutToolButton</tabstop> <tabstop>alignTopInToolButton</tabstop> <tabstop>alignCenterVerToolButton</tabstop> <tabstop>alignBottomInToolButton</tabstop> <tabstop>alignBottomOutToolButton</tabstop> + <tabstop>alignTopOutToolButton</tabstop> <tabstop>distributeLeftToolButton</tabstop> <tabstop>distributeCenterHToolButton</tabstop> <tabstop>distributeRightToolButton</tabstop> <tabstop>distributeDistHToolButton</tabstop> - <tabstop>distributeBottomToolButton</tabstop> - <tabstop>distributeCenterVToolButton</tabstop> <tabstop>distributeTopToolButton</tabstop> + <tabstop>distributeCenterVToolButton</tabstop> + <tabstop>distributeBottomToolButton</tabstop> <tabstop>distributeDistVToolButton</tabstop> <tabstop>distributeAcrossPageToolButton</tabstop> <tabstop>distributeDownPageToolButton</tabstop> <tabstop>distributeAcrossMarginsToolButton</tabstop> <tabstop>distributeDownMarginsToolButton</tabstop> - <tabstop>distributeDistValueHToolButton</tabstop> <tabstop>distributeDistValueVToolButton</tabstop> + <tabstop>distributeDistValueHToolButton</tabstop> <tabstop>distributeDistSpinBox</tabstop> - <tabstop>reverseDistributionCheckBox</tabstop> + <tabstop>reverseDistributionButton</tabstop> <tabstop>swapLeftToolButton</tabstop> <tabstop>swapRightToolButton</tabstop> - <tabstop>tabWidget</tabstop> </tabstops> <includes> <include location="local">ui/scrspinbox.h</include> diff --git a/scribus/ui/widgets/pulsing_toolbutton.cpp b/scribus/ui/widgets/pulsing_toolbutton.cpp new file mode 100644 index 000000000..405860c91 --- /dev/null +++ b/scribus/ui/widgets/pulsing_toolbutton.cpp @@ -0,0 +1,79 @@ +#include "pulsing_toolbutton.h" + +#include <QBrush> +#include <QColor> +#include <QPaintEvent> +#include <QPalette> +#include <QStyle> +#include <QStyleOptionButton> +#include <QStylePainter> +#include <QString> +#include <QToolButton> +#include <QVariant> +#include <QVariantAnimation> +#include <QWidget> + +PulsingToolButton::PulsingToolButton(QWidget *parent): + QToolButton(parent), + m_transition(nullptr) +{ +} + +void PulsingToolButton::paintEvent(QPaintEvent* event) +{ + if (m_transition == nullptr) + { + QToolButton::paintEvent(event); + } + else + { + QStylePainter p(this); + QStyleOptionToolButton opt; + initStyleOption(&opt); + p.drawComplexControl(QStyle::CC_ToolButton, opt); + + m_currentColor.setAlpha(100); + p.setBrush(m_currentColor); + p.setPen(Qt::NoPen); + p.drawRect(0,0,width(),height()); + } +} + +// https://stackoverflow.com/questions/53084981/how-to-add-a-hover-transition-to-qpushbutton +// https://forum.qt.io/post/538500 +void PulsingToolButton::animatePulsing() +{ + if (!isChecked()) + { + return; + } + if (m_transition != nullptr) + { + // too fast, don't show a second animation + return; + // m_transition->stop(); + } + + m_transition = new QVariantAnimation(this); + m_transition->setDuration(1000); // TODO: this should be a class const + + QColor startColor = palette().button().color(); + QColor endColor = palette().shadow().color(); + + m_transition->setStartValue(startColor); + m_transition->setEndValue(endColor); + + connect(m_transition, &QVariantAnimation::valueChanged, + this, [this](const QVariant &value){ + m_currentColor = value.value<QColor>(); + repaint(); + }); + + connect(m_transition, &QVariantAnimation::destroyed, + this, [this](){ + m_transition = nullptr; + repaint(); + }); + + m_transition->start(QAbstractAnimation::DeleteWhenStopped); +} diff --git a/scribus/ui/widgets/pulsing_toolbutton.h b/scribus/ui/widgets/pulsing_toolbutton.h new file mode 100644 index 000000000..5cec70e43 --- /dev/null +++ b/scribus/ui/widgets/pulsing_toolbutton.h @@ -0,0 +1,40 @@ +#ifndef PULSING_TOOLBUTTON_H +#define PULSING_TOOLBUTTON_H + +/** + * Change the background color of the ToolButton to the opposite among checked and unchecked, + * then animate the transition back to the original color. + * Currently, done by draing a semitransparent rectangle on top of the button. + * + * In the future, the widget can be extend to pulse in a loop until mouseover, or other + * fancy gadgets. + * + * The current minimal implementation is tailored for the buttonReferenceGuide button in + * the align and distribute dialog: + * - It only pulses once. + * - It only pulses when it's checked. + * - The animation time is a constant. + */ + +#include <QColor> +#include <QToolButton> + +class QVariantAnimation; +class QWidget; + +class PulsingToolButton : public QToolButton +{ + Q_OBJECT +public: + explicit PulsingToolButton(QWidget *parent = nullptr); + void animatePulsing(); + +protected: + void paintEvent(QPaintEvent *) override; + +private: + QVariantAnimation *m_transition; + QColor m_currentColor; +}; + +#endif |
|
>> is there a reason why you have put the "go to left" actions to the right and the "go to right" ones on the left? I can't remember. Perhaps because the "go left" align the object on the right side of the reference object. I made a few more changes to your implementation. Icons: I think the arrows of the distribution direction icons should be flipped, because they point in the wrong direction. Layout: I made the layout a bit more compact. BTW: I also removed the horizontal layout inside the FormWidget. There is no need for this because the FormWidget already has a horizontal layout by default. aligndistribute-2.ui (34,805 bytes)
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>AlignDistribute</class> <widget class="QWidget" name="AlignDistribute"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>322</width> <height>332</height> </rect> </property> <property name="windowTitle"> <string>Align and Distribute</string> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> <property name="spacing"> <number>0</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="SectionContainer" name="sectionAlign"> <property name="title" stdset="0"> <string>Align</string> </property> <widget class="QWidget" name="page"> <layout class="QVBoxLayout" name="verticalLayout_4"> <property name="spacing"> <number>8</number> </property> <property name="leftMargin"> <number>8</number> </property> <property name="topMargin"> <number>8</number> </property> <property name="rightMargin"> <number>8</number> </property> <property name="bottomMargin"> <number>8</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="spacing"> <number>16</number> </property> <item> <widget class="FormWidget" name="alignReferenceLabel"> <property name="label" stdset="0"> <string>Reference</string> </property> <layout class="QHBoxLayout" name="horizontalLayout"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="buttonReferenceFirst"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferenceSelection"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferenceLast"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferencePage"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonReferenceMargins"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="PulsingToolButton" name="buttonReferenceGuide"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> </layout> </widget> </item> <item> <widget class="FormWidget" name="alignModeLabel"> <property name="label" stdset="0"> <string>Mode</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_12"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="buttonModeMove"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QToolButton" name="buttonModeResize"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>0</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_18"> <property name="spacing"> <number>16</number> </property> <item> <widget class="FormWidget" name="alignHorizontalLabel"> <property name="label" stdset="0"> <string>Horizontal</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_15"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="alignLeftInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignCenterHorToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignRightInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignRightOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignLeftOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </widget> </item> <item> <widget class="FormWidget" name="alignVerticalLabel"> <property name="label" stdset="0"> <string>Vertical</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_16"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="alignTopInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignCenterVerToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignBottomInToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignBottomOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="alignTopOutToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>0</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> </widget> </item> <item> <widget class="SectionContainer" name="sectionDistribute"> <property name="title" stdset="0"> <string>Distribute</string> </property> <widget class="QWidget" name="page_2"> <layout class="QVBoxLayout" name="verticalLayout_7"> <property name="spacing"> <number>8</number> </property> <property name="leftMargin"> <number>8</number> </property> <property name="topMargin"> <number>8</number> </property> <property name="rightMargin"> <number>8</number> </property> <property name="bottomMargin"> <number>8</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_24"> <property name="spacing"> <number>16</number> </property> <item> <widget class="FormWidget" name="distributeHorizontalLabel"> <property name="label" stdset="0"> <string>Horizontal</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_21"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="distributeRightToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeCenterHToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeLeftToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDistHToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </widget> </item> <item> <widget class="FormWidget" name="distributeVerticalLabel"> <property name="label" stdset="0"> <string>Vertical</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_22"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="distributeTopToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeCenterVToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeBottomToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDistVToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_6"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>0</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_26"> <property name="spacing"> <number>16</number> </property> <item> <widget class="FormWidget" name="distributeByGapLabel"> <property name="label" stdset="0"> <string>By gap</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_23"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="distributeAcrossPageToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDownPageToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDownMarginsToolButton"> <property name="enabled"> <bool>true</bool> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </widget> </item> <item> <widget class="FormWidget" name="swapLabel"> <property name="label" stdset="0"> <string>Swap</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_17"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="swapLeftToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="swapRightToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_8"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>0</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <property name="spacing"> <number>16</number> </property> <item> <widget class="FormWidget" name="distributeByDistanceLabel"> <property name="label" stdset="0"> <string>By distance</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_20"> <property name="spacing"> <number>4</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QToolButton" name="distributeDistValueVToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="QToolButton" name="distributeDistValueHToolButton"> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="maximumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="iconSize"> <size> <width>22</width> <height>22</height> </size> </property> </widget> </item> <item> <widget class="ScrSpinBox" name="distributeDistSpinBox"/> </item> <item> <widget class="QToolButton" name="reverseDistributionButton"> <property name="text"> <string/> </property> <property name="checkable"> <bool>true</bool> </property> </widget> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_5"> <property name="orientation"> <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>0</width> <height>20</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> </widget> </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>0</height> </size> </property> </spacer> </item> </layout> </widget> <customwidgets> <customwidget> <class>FormWidget</class> <extends>QWidget</extends> <header>ui/widgets/form_widget.h</header> <container>1</container> </customwidget> <customwidget> <class>SectionContainer</class> <extends>QWidget</extends> <header>ui/widgets/section_container.h</header> <addpagemethod>setWidget</addpagemethod> <container>1</container> </customwidget> <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> <header location="global">ui/scrspinbox.h</header> </customwidget> <customwidget> <class>PulsingToolButton</class> <extends>QToolButton</extends> <header>ui/widgets/pulsing_toolbutton.h</header> </customwidget> </customwidgets> <includes> <include location="local">ui/scrspinbox.h</include> </includes> <resources/> <connections/> </ui> |
|
I like the pulsating button when you select a guide. I also think it makes sense to show the effect even when the mode is not selected. |
|
ok, for replacing the icons! i'm not sure about putting all the align (and distribute) icons on one line. i kept it as an option, but i to prefer keeping two rows for now. on my computer, the new row seems to be wider than the current default width of the left panel. have you checked if the width changes with the single row? anyway: if it fits in the same width, it will be one row. third point: i also wondered, if the button should always pulsate or only when the align to guide is active. for now, i'd prefer to only do the animation when "align to guide" is active: it's an action that is almost never used, and i'd prefer to have as few distraction as possible. but if the actual users have a reason for wishing to extend the animation, i'm ok to later remove the condition! |
|
here is the final (?) version of the patch. - for now, i've kept the horizontal and vertical buttons on separate rows. it feel slightly easier to reach the right action and when they are on the same line the left panel gets slightly wider. i'm not against putting them on the same row in the future (as an example if the left panel gets anyway slightly wider) - now it's all left to right and top down. - the new icons are in the zip. 47.diff (94,135 bytes)
diff --git a/resources/iconsets/1_7_0/16/align-mode-move.svg b/resources/iconsets/1_7_0/16/align-mode-move.svg new file mode 100644 index 0000000000000000000000000000000000000000..aaeeda16404d0d24d1a725172958d2b6ffb4d964 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-mode-move.svg @@ -0,0 +1,6 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<rect x="1" y="1" width="1" height="14" class="success"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M6 10L3 12.5L6 15V13H9V12H6V10Z" class="error"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M15 2H8V10H15V2ZM14 3H9V9H14V3Z"/> +<rect x="9" y="3" width="5" height="6" fill-opacity="0.4"/> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-mode-resize.svg b/resources/iconsets/1_7_0/16/align-mode-resize.svg new file mode 100644 index 0000000000000000000000000000000000000000..1ebb06f0ee0a49ecb047700c2247d9814974494d --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-mode-resize.svg @@ -0,0 +1,11 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<rect x="1" y="1" width="1" height="14" class="success"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M3 14V11H4V12H8V11H9V14H8V13H4V14H3Z" class="error"/> +<path d="M3 2H5V3H4V4H3V2Z"/> +<path d="M6 9H8V10H6V9Z"/> +<path d="M3 8V10H5V9H4V8H3Z"/> +<path d="M3 5H4V7H3V5Z"/> +<path d="M6 2V3H8V2H6Z"/> +<path d="M9 2V3H14V9H9V10H15V2H9Z"/> +<rect x="4" y="3" width="10" height="6" fill-opacity="0.4"/> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-reverse-distribution-left.svg b/resources/iconsets/1_7_0/16/align-reverse-distribution-left.svg new file mode 100644 index 0000000000000000000000000000000000000000..856d9d4d47d20a9a0efa0cd598aef6d2cfd5e533 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-reverse-distribution-left.svg @@ -0,0 +1,4 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<path d="M2 1H1V15H2V1Z" class="success"/> +<path d="M15 7.5L12 5V7H3V8H12V10L15 7.5Z" class="error"/> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-reverse-distribution-right.svg b/resources/iconsets/1_7_0/16/align-reverse-distribution-right.svg new file mode 100644 index 0000000000000000000000000000000000000000..31df322b9c136cc2b1a4897377bb62a90fa38496 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-reverse-distribution-right.svg @@ -0,0 +1,4 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<path d="M15 1H14V15H15V1Z" class="success"/> +<path d="M1 7.5L4 5V7H13V8H4V10L1 7.5Z" class="error"/> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-to-first-selected.svg b/resources/iconsets/1_7_0/16/align-to-first-selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..38b240996057beb8f891651945639ad944f62836 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-to-first-selected.svg @@ -0,0 +1,21 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<rect x="3" y="5" width="3" height="6"/> +<rect x="7" y="5" width="2" height="6" fill-opacity="0.4"/> +<rect x="10" y="5" width="3" height="6" fill-opacity="0.4"/> +<path d="M3 1H1V3H2V2H3V1Z" fill-opacity="0.4"/> +<path d="M6 1H4V2H6V1Z" fill-opacity="0.4"/> +<path d="M7 1H9V2H7V1Z" fill-opacity="0.4"/> +<path d="M12 1H10V2H12V1Z" fill-opacity="0.4"/> +<path d="M13 1H15V3H14V2H13V1Z" fill-opacity="0.4"/> +<path d="M15 4H14V6H15V4Z" fill-opacity="0.4"/> +<path d="M14 7H15V9H14V7Z" fill-opacity="0.4"/> +<path d="M15 10H14V12H15V10Z" fill-opacity="0.4"/> +<path d="M14 14V13H15V15H13V14H14Z" fill-opacity="0.4"/> +<path d="M12 14H10V15H12V14Z" fill-opacity="0.4"/> +<path d="M7 14H9V15H7V14Z" fill-opacity="0.4"/> +<path d="M6 14H4V15H6V14Z" fill-opacity="0.4"/> +<path d="M1 13H2V14H3V15H1V13Z" fill-opacity="0.4"/> +<path d="M2 10H1V12H2V10Z" fill-opacity="0.4"/> +<path d="M1 7H2V9H1V7Z" fill-opacity="0.4"/> +<path d="M2 4H1V6H2V4Z" fill-opacity="0.4"/> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-to-guides.svg b/resources/iconsets/1_7_0/16/align-to-guides.svg new file mode 100644 index 0000000000000000000000000000000000000000..342bf97d700b76e3287a63a9932eca09bdaf7833 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-to-guides.svg @@ -0,0 +1,11 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<g clip-path="url(#clip0_1556_49)"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79289 0H16V16H0V3.79289L3.79289 0ZM4.20711 1L1 4.20711V15H15V1H4.20711Z"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M6 1H5V5H1V6H5V15H6V6H15V5H6V1Z" class="info"/> +</g> +<defs> +<clipPath id="clip0_1556_49"> +<rect width="16" height="16" fill="white"/> +</clipPath> +</defs> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-to-last-selected-1.svg b/resources/iconsets/1_7_0/16/align-to-last-selected-1.svg new file mode 100644 index 0000000000000000000000000000000000000000..7c19e642e440053016f81b509467901b30a977f5 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-to-last-selected-1.svg @@ -0,0 +1,19 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<path fill-rule="evenodd" clip-rule="evenodd" d="M6 5H3V11H6V5ZM7 5H9V11H7V5ZM10 5H13V11H10V5Z"/> +<path d="M3 1H1V3H2V2H3V1Z" fill-opacity="0.4"/> +<path d="M6 1H4V2H6V1Z" fill-opacity="0.4"/> +<path d="M7 1H9V2H7V1Z" fill-opacity="0.4"/> +<path d="M12 1H10V2H12V1Z" fill-opacity="0.4"/> +<path d="M13 1H15V3H14V2H13V1Z" fill-opacity="0.4"/> +<path d="M15 4H14V6H15V4Z" fill-opacity="0.4"/> +<path d="M14 7H15V9H14V7Z" fill-opacity="0.4"/> +<path d="M15 10H14V12H15V10Z" fill-opacity="0.4"/> +<path d="M14 14V13H15V15H13V14H14Z" fill-opacity="0.4"/> +<path d="M12 14H10V15H12V14Z" fill-opacity="0.4"/> +<path d="M7 14H9V15H7V14Z" fill-opacity="0.4"/> +<path d="M6 14H4V15H6V14Z" fill-opacity="0.4"/> +<path d="M1 13H2V14H3V15H1V13Z" fill-opacity="0.4"/> +<path d="M2 10H1V12H2V10Z" fill-opacity="0.4"/> +<path d="M1 7H2V9H1V7Z" fill-opacity="0.4"/> +<path d="M2 4H1V6H2V4Z" fill-opacity="0.4"/> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-to-last-selected.svg b/resources/iconsets/1_7_0/16/align-to-last-selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..93b822242d4f839cb67826d042dbe9d45db968e3 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-to-last-selected.svg @@ -0,0 +1,21 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<rect x="10" y="5" width="3" height="6"/> +<rect x="7" y="5" width="2" height="6" fill-opacity="0.4"/> +<rect x="3" y="5" width="3" height="6" fill-opacity="0.4"/> +<path d="M3 1H1V3H2V2H3V1Z" fill-opacity="0.4"/> +<path d="M6 1H4V2H6V1Z" fill-opacity="0.4"/> +<path d="M7 1H9V2H7V1Z" fill-opacity="0.4"/> +<path d="M12 1H10V2H12V1Z" fill-opacity="0.4"/> +<path d="M13 1H15V3H14V2H13V1Z" fill-opacity="0.4"/> +<path d="M15 4H14V6H15V4Z" fill-opacity="0.4"/> +<path d="M14 7H15V9H14V7Z" fill-opacity="0.4"/> +<path d="M15 10H14V12H15V10Z" fill-opacity="0.4"/> +<path d="M14 14V13H15V15H13V14H14Z" fill-opacity="0.4"/> +<path d="M12 14H10V15H12V14Z" fill-opacity="0.4"/> +<path d="M7 14H9V15H7V14Z" fill-opacity="0.4"/> +<path d="M6 14H4V15H6V14Z" fill-opacity="0.4"/> +<path d="M1 13H2V14H3V15H1V13Z" fill-opacity="0.4"/> +<path d="M2 10H1V12H2V10Z" fill-opacity="0.4"/> +<path d="M1 7H2V9H1V7Z" fill-opacity="0.4"/> +<path d="M2 4H1V6H2V4Z" fill-opacity="0.4"/> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-to-margin.svg b/resources/iconsets/1_7_0/16/align-to-margin.svg new file mode 100644 index 0000000000000000000000000000000000000000..475fc4ba2f6e19aaebaec64f3f4b5c72b62b303b --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-to-margin.svg @@ -0,0 +1,11 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<g clip-path="url(#clip0_1556_40)"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M14 2H2V14H14V2ZM13 3H3V13H13V3Z" class="info"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79289 0H16V16H0V3.79289L3.79289 0ZM4.20711 1L1 4.20711V15H15V1H4.20711Z"/> +</g> +<defs> +<clipPath id="clip0_1556_40"> +<rect width="16" height="16" fill="white"/> +</clipPath> +</defs> +</svg> diff --git a/resources/iconsets/1_7_0/16/align-to-page.svg b/resources/iconsets/1_7_0/16/align-to-page.svg new file mode 100644 index 0000000000000000000000000000000000000000..383be5f786cb85b777ec72a768c4df642ddc3134 --- /dev/null +++ b/resources/iconsets/1_7_0/16/align-to-page.svg @@ -0,0 +1,10 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style> +<g clip-path="url(#clip0_1556_34)"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79289 0H16V16H0V3.79289L3.79289 0ZM4.20711 1L1 4.20711V15H15V1H4.20711Z"/> +</g> +<defs> +<clipPath id="clip0_1556_34"> +<rect width="16" height="16" fill="white"/> +</clipPath> +</defs> +</svg> diff --git a/resources/iconsets/1_7_0/1_7_0.xml b/resources/iconsets/1_7_0/1_7_0.xml index cf449813aa5c6d4cbd662c59c99db60629df2e80..59accc2f40f7de13f48dcd5a4f8bd43b88e6e4c8 100644 --- a/resources/iconsets/1_7_0/1_7_0.xml +++ b/resources/iconsets/1_7_0/1_7_0.xml @@ -173,6 +173,16 @@ On Dark: #e580ff; rgb(229, 128, 255); hsl(288, 100, 75) <icon onLight="#68B259" onDark="#88CC7A" id="ok.png" file="16/alert-ok.svg" /> <!-- Align & Distribute --> + <icon id="22/align-to-first-selected.png" file="16/align-to-first-selected.svg" /> + <icon id="22/align-to-guides.png" file="16/align-to-guides.svg" /> + <icon id="22/align-to-last-selected-1.png" file="16/align-to-last-selected-1.svg" /> + <icon id="22/align-to-last-selected.png" file="16/align-to-last-selected.svg" /> + <icon id="22/align-to-margin.png" file="16/align-to-margin.svg" /> + <icon id="22/align-to-page.png" file="16/align-to-page.svg" /> + <icon id="22/align-mode-move.png" file="16/align-mode-move.svg" /> + <icon id="22/align-mode-resize.png" file="16/align-mode-resize.svg" /> + <icon id="22/align-reverse-distribution-right.png" file="16/align-reverse-distribution-right.svg" /> + <icon id="22/align-reverse-distribution-left.png" file="16/align-reverse-distribution-left.svg" /> <icon id="22/align-horizontal-center.png" file="16/align-item-horizontal-center.svg" /> <icon id="22/align-horizontal-left-out.png" file="16/align-item-horizontal-left-out.svg" /> <icon id="22/align-horizontal-left.png" file="16/align-item-horizontal-left.svg" /> diff --git a/scribus/CMakeLists_Sources.txt b/scribus/CMakeLists_Sources.txt index 7b59202c430b056461f3ec83380b4a15db7c7cb9..4ba985604d5eb17183168a910c0527f968207652 100644 --- a/scribus/CMakeLists_Sources.txt +++ b/scribus/CMakeLists_Sources.txt @@ -573,6 +573,7 @@ set(SCRIBUS_SOURCES ui/widgets/pagesizepreview.cpp ui/widgets/pagesizeselector.cpp ui/widgets/popup_menu.cpp + ui/widgets/pulsing_toolbutton.cpp ui/widgets/section_container.cpp ui/widgets/stacked_container.cpp ui/widgets/switch.cpp diff --git a/scribus/ui/aligndistribute.cpp b/scribus/ui/aligndistribute.cpp index 7a0ccc374c6db9f3b51a5577189e94088ecb1bd6..c1f270c7dd9949912bab6ec6ee6e4747ea9412c9 100644 --- a/scribus/ui/aligndistribute.cpp +++ b/scribus/ui/aligndistribute.cpp @@ -22,6 +22,7 @@ for which a new license (GPL+exception) is in place. #include "aligndistribute.h" #include <QComboBox> +#include <QButtonGroup> #include <QEvent> #include <QImage> #include <QLabel> @@ -45,11 +46,19 @@ for which a new license (GPL+exception) is in place. #include "undomanager.h" #include "units.h" -//TODO Distribute with - AlignDistribute::AlignDistribute(QWidget* parent) : QWidget(parent) { setupUi(this); + + sectionAlign->expand(); + sectionAlign->setCanSaveState(true); + sectionAlign->restorePreferences(); + + sectionDistribute->expand(); + sectionDistribute->setCanSaveState(true); + sectionDistribute->restorePreferences(); + + } @@ -66,6 +75,21 @@ AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase( //set up scrspinboxes ad->distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0); + groupReference = new QButtonGroup(); + + groupReference->addButton(ad->buttonReferenceFirst, 0); + groupReference->addButton(ad->buttonReferenceLast, 1); + groupReference->addButton(ad->buttonReferencePage, 2); + groupReference->addButton(ad->buttonReferenceMargins, 3); + groupReference->addButton(ad->buttonReferenceGuide, 4); + groupReference->addButton(ad->buttonReferenceSelection, 5); + ad->buttonReferenceFirst->setChecked(true); + + groupMode = new QButtonGroup(); + groupMode->addButton(ad->buttonModeMove, 0); + groupMode->addButton(ad->buttonModeResize, 1); + ad->buttonModeMove->setChecked(true); + resize( QSize(100, 100).expandedTo(minimumSizeHint()) ); languageChange(); init(); @@ -73,6 +97,7 @@ AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase( connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void AlignDistributePalette::changeEvent(QEvent *e) @@ -89,26 +114,18 @@ void AlignDistributePalette::languageChange() { ad->retranslateUi(this); - int alignComboValue = ad->alignRelativeToCombo->currentIndex(); - ad->alignRelativeToCombo->clear(); - ad->alignRelativeToCombo->addItem( tr( "First Selected" ) ); - ad->alignRelativeToCombo->addItem( tr( "Last Selected" ) ); - ad->alignRelativeToCombo->addItem( tr( "Page" ) ); - ad->alignRelativeToCombo->addItem( tr( "Margins" ) ); - ad->alignRelativeToCombo->addItem( tr( "Guide" ) ); - ad->alignRelativeToCombo->addItem( tr( "Selection" ) ); - ad->alignRelativeToCombo->setCurrentIndex(alignComboValue); - ad->alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) ); - alignToChanged(alignComboValue); - - int alignMethodValue = ad->alignMoveOrResizeCombo->currentIndex(); - ad->alignMoveOrResizeCombo->clear(); - ad->alignMoveOrResizeCombo->addItem( tr("Move") ); - ad->alignMoveOrResizeCombo->addItem( tr("Resize") ); - ad->alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" )); - alignMethodChanged(alignMethodValue); - - ad->alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) ); + referenceGuideTooltipTemplate = tr("Align relative to a guide%1"); + + ad->buttonReferenceFirst->setToolTip(tr("Align relative to the first selected item")); + ad->buttonReferenceLast->setToolTip(tr("Align relative to the last selected item")); + ad->buttonReferencePage->setToolTip(tr("Align relative to the current page")); + ad->buttonReferenceMargins->setToolTip(tr("Align relative to the margins of the current page")); + ad->buttonReferenceGuide->setToolTip(referenceGuideTooltipTemplate); + ad->buttonReferenceSelection->setToolTip(tr("Align relative the selection")); + + ad->buttonModeMove->setToolTip(tr("When aligning one side of an item, always move the other side too (preserve existing width and height)")); + ad->buttonModeResize->setToolTip(tr("When aligning one side of an item, whenever possible keep the other side fixed (resize the item instead of moving it)")); + ad->alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) ); ad->alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) ); ad->alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) ); @@ -137,20 +154,33 @@ void AlignDistributePalette::languageChange() ad->distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) ); ad->distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) ); - ad->reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") ); - - guideInfoTextNone = tr("None Selected"); + ad->reverseDistributionButton->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") ); ad->swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) ); ad->swapRightToolButton->setToolTip( tr( "Swap items to the right" ) ); } +void AlignDistributePalette::toggleLabelVisibility(bool v) +{ + ad->alignReferenceLabel->setLabelVisibility(v); + ad->alignModeLabel->setLabelVisibility(v); + ad->alignHorizontalLabel->setLabelVisibility(v); + ad->alignVerticalLabel->setLabelVisibility(v); + ad->swapLabel->setLabelVisibility(v); + ad->distributeHorizontalLabel->setLabelVisibility(v); + ad->distributeVerticalLabel->setLabelVisibility(v); + ad->distributeByGapLabel->setLabelVisibility(v); + ad->distributeByDistanceLabel->setLabelVisibility(v); +} + void AlignDistributePalette::init() { undoManager = UndoManager::instance(); iconSetChange(); + connect(groupReference, &QButtonGroup::idClicked, this, &AlignDistributePalette::alignToChanged); + connect(groupMode, &QButtonGroup::idClicked, this, &AlignDistributePalette::alignMethodChanged); connect(ad->alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut())); connect(ad->alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut())); connect(ad->alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn())); @@ -178,23 +208,37 @@ void AlignDistributePalette::init() connect(ad->swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft())); connect(ad->swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight())); - ad->alignRelativeToCombo->setCurrentIndex(0); alignToChanged(0); alignMethodChanged(0); - connect(ad->alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int))); - connect(ad->alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int))); unitRatio = 1.0; guideDirection = -1; - - guideInfoText = guideInfoTextNone; - ad->alignGuideLineEdit->setText(guideInfoTextNone); } void AlignDistributePalette::iconSetChange() { IconManager& im = IconManager::instance(); + ad->alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png")); + ad->buttonReferenceFirst->setIcon(im.loadIcon("22/align-to-first-selected.png")); + ad->buttonReferenceLast->setIcon(im.loadIcon("22/align-to-last-selected.png")); + ad->buttonReferencePage->setIcon(im.loadIcon("22/align-to-page.png")); + ad->buttonReferenceMargins->setIcon(im.loadIcon("22/align-to-margin.png")); + ad->buttonReferenceGuide->setIcon(im.loadIcon("22/align-to-guides.png")); + ad->buttonReferenceSelection->setIcon(im.loadIcon("22/align-to-last-selected-1.png")); + ad->buttonModeMove->setIcon(im.loadIcon("22/align-mode-move.png")); + ad->buttonModeResize->setIcon(im.loadIcon("22/align-mode-resize.png")); + QIcon reverseDistributionIcon; + reverseDistributionIcon.addPixmap(im.loadPixmap( + "22/align-reverse-distribution-right.png"), + QIcon::Normal, + QIcon::On); + reverseDistributionIcon.addPixmap(im.loadPixmap( + "22/align-reverse-distribution-left.png"), + QIcon::Normal, + QIcon::Off); + ad->reverseDistributionButton->setIcon(reverseDistributionIcon); + ad->alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png")); ad->alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png")); ad->alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png")); @@ -330,7 +374,7 @@ void AlignDistributePalette::distributeRight() void AlignDistributePalette::distributeDistH(bool usingDistance) { if (currDoc != nullptr) - currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked()); + currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionButton->isChecked()); } void AlignDistributePalette::distributeDistValH() @@ -385,7 +429,7 @@ void AlignDistributePalette::distributeTop() void AlignDistributePalette::distributeDistV(bool usingDistance) { if (currDoc != nullptr) - currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked()); + currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionButton->isChecked()); } void AlignDistributePalette::distributeDistValV() @@ -420,10 +464,9 @@ void AlignDistributePalette::alignMethodChanged(int newAlignMethod) void AlignDistributePalette::setGuide(int direction, qreal position) { - //direction 0 = H, 1 = V -// qDebug() << "AlignDistributePalette::setGuide(" << direction << "" << position << ")"; guideDirection = direction; guidePosition = position; + ad->buttonReferenceGuide->animatePulsing(); enableGuideButtons(); } @@ -437,6 +480,7 @@ void AlignDistributePalette::localeChange() void AlignDistributePalette::enableGuideButtons() { QString suffix; + QString guidePositionText; double unitRatio = 1.0; int precision = 1; if (currDoc != nullptr) @@ -450,17 +494,16 @@ void AlignDistributePalette::enableGuideButtons() switch (guideDirection) { case -1: - guideInfoText = guideInfoTextNone; if (currAlignTo == ScribusDoc::alignGuide) setterH = setterV = false; break; case 0: - guideInfoText = tr("Y: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); + guidePositionText = tr(": Y: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); if (currAlignTo == ScribusDoc::alignGuide) setterV = false; break; case 1: - guideInfoText = tr("X: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); + guidePositionText = tr(": X: %1%2").arg(guidePosition * unitRatio, 0, 'f', precision).arg(suffix); if (currAlignTo == ScribusDoc::alignGuide) setterH = false; break; @@ -481,6 +524,6 @@ void AlignDistributePalette::enableGuideButtons() ad->alignBottomOutToolButton->setEnabled(setterO); ad->alignCenterVerToolButton->setEnabled(setterH); - ad->alignGuideLineEdit->setText(guideInfoText); + ad->buttonReferenceGuide->setToolTip(referenceGuideTooltipTemplate.arg(guidePositionText == "" ? "" : guidePositionText)); } diff --git a/scribus/ui/aligndistribute.h b/scribus/ui/aligndistribute.h index 5d1cd42e0c51ee0ec05a23de5a8e2994621b9957..799eebaeedc04198d48b32b8563f516ffc3713e6 100644 --- a/scribus/ui/aligndistribute.h +++ b/scribus/ui/aligndistribute.h @@ -76,10 +76,13 @@ public: public slots: void setGuide(int, qreal); void localeChange(); + void toggleLabelVisibility(bool v); protected: ScribusView *currView { nullptr }; AlignDistribute * ad {nullptr}; + QButtonGroup* groupReference; + QButtonGroup* groupMode; void changeEvent(QEvent *e) override; @@ -129,8 +132,7 @@ private: qreal unitRatio { 1.0 }; int guideDirection { -1 }; qreal guidePosition { 0.0 }; - QString guideInfoText; - QString guideInfoTextNone; + QString referenceGuideTooltipTemplate; signals: void documentChanged(); diff --git a/scribus/ui/aligndistribute.ui b/scribus/ui/aligndistribute.ui index 0a5bb2620ffe7121c441bdcfee5802ffb3331009..0f59ef964fe110300cb1a2d0aaa6c4b86eba09bf 100644 --- a/scribus/ui/aligndistribute.ui +++ b/scribus/ui/aligndistribute.ui @@ -6,135 +6,192 @@ <rect> <x>0</x> <y>0</y> - <width>247</width> - <height>277</height> + <width>322</width> + <height>426</height> </rect> </property> <property name="windowTitle"> <string>Align and Distribute</string> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>0</number> + </property> <property name="leftMargin"> - <number>3</number> + <number>0</number> </property> <property name="topMargin"> - <number>3</number> + <number>0</number> </property> <property name="rightMargin"> - <number>3</number> + <number>0</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>0</number> </property> <item> - <widget class="QTabWidget" name="tabWidget"> - <property name="currentIndex"> - <number>0</number> + <widget class="SectionContainer" name="sectionAlign"> + <property name="title" stdset="0"> + <string>Align</string> </property> - <widget class="QWidget" name="tabAlign"> - <attribute name="title"> - <string>Align</string> - </attribute> - <layout class="QVBoxLayout"> + <widget class="QWidget" name="page"> + <layout class="QVBoxLayout" name="verticalLayout_4"> <property name="spacing"> - <number>3</number> + <number>8</number> </property> <property name="leftMargin"> - <number>6</number> + <number>8</number> </property> <property name="topMargin"> - <number>6</number> + <number>8</number> </property> <property name="rightMargin"> - <number>6</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>6</number> + <number>8</number> </property> <item> - <layout class="QHBoxLayout" name="_2"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <widget class="FormWidget" name="alignReferenceLabel"> + <property name="label" stdset="0"> + <string>Reference</string> </property> - </spacer> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="buttonReferenceFirst"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceSelection"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceLast"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferencePage"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonReferenceMargins"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="PulsingToolButton" name="buttonReferenceGuide"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <layout class="QGridLayout" name="_3"> - <item row="1" column="0"> - <widget class="QLabel" name="alignGuideLabel"> - <property name="text"> - <string>&Selected Guide:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="buddy"> - <cstring>alignGuideLineEdit</cstring> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="alignRelativeToLabel"> - <property name="text"> - <string>&Relative To:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="buddy"> - <cstring>alignRelativeToCombo</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="alignGuideLineEdit"/> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="alignRelativeToCombo"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="alignMoveOrResizeLabel"> - <property name="text"> - <string>&Align Sides By:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="buddy"> - <cstring>alignMoveOrResizeCombo</cstring> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QComboBox" name="alignMoveOrResizeCombo"/> - </item> - </layout> + <widget class="FormWidget" name="alignModeLabel"> + <property name="label" stdset="0"> + <string>Mode</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="buttonModeMove"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="buttonModeResize"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> @@ -143,257 +200,299 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="_4"> + <layout class="QHBoxLayout" name="horizontalLayout_18"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="FormWidget" name="alignHorizontalLabel"> + <property name="label" stdset="0"> + <string>Horizontal</string> </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <layout class="QHBoxLayout" name="horizontalLayout_15"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="alignLeftInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignCenterHorToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignRightInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignRightOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignLeftOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> - <layout class="QGridLayout" name="_5"> - <item row="1" column="3"> - <widget class="QToolButton" name="alignBottomInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QToolButton" name="alignTopInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="alignLeftInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QToolButton" name="alignRightInToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="4"> - <widget class="QToolButton" name="alignBottomOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QToolButton" name="alignTopOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QToolButton" name="alignCenterVerToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QToolButton" name="alignLeftOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="4"> - <widget class="QToolButton" name="alignRightOutToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QToolButton" name="alignCenterHorToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - </layout> + <widget class="FormWidget" name="alignVerticalLabel"> + <property name="label" stdset="0"> + <string>Vertical</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="alignTopInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignCenterVerToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignBottomInToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignBottomOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="alignTopOutToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer_4"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -405,400 +504,157 @@ </item> </layout> </item> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> </layout> </widget> - <widget class="QWidget" name="tabDistribute"> - <attribute name="title"> - <string>Distribute</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> + </widget> + </item> + <item> + <widget class="SectionContainer" name="sectionDistribute"> + <property name="title" stdset="0"> + <string>Distribute</string> + </property> + <widget class="QWidget" name="page_2"> + <layout class="QVBoxLayout" name="verticalLayout_7"> <property name="spacing"> - <number>3</number> + <number>8</number> </property> <property name="leftMargin"> - <number>6</number> + <number>8</number> </property> <property name="topMargin"> - <number>6</number> + <number>8</number> </property> <property name="rightMargin"> - <number>6</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>6</number> + <number>8</number> </property> <item> - <layout class="QHBoxLayout" name="_6"> + <layout class="QHBoxLayout" name="horizontalLayout_24"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>63</width> - <height>20</height> - </size> + <widget class="FormWidget" name="distributeHorizontalLabel"> + <property name="label" stdset="0"> + <string>Horizontal</string> </property> - </spacer> - </item> - <item> - <layout class="QGridLayout" name="_7"> - <item row="0" column="3"> - <widget class="QToolButton" name="distributeDistHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QToolButton" name="distributeTopToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QToolButton" name="distributeCenterVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QToolButton" name="distributeRightToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QToolButton" name="distributeLeftToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QToolButton" name="distributeAcrossPageToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QToolButton" name="distributeDistValueHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QToolButton" name="distributeDownMarginsToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="distributeCenterHToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QToolButton" name="distributeDownPageToolButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QToolButton" name="distributeDistValueVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QToolButton" name="distributeDistVToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QToolButton" name="distributeBottomToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - </layout> + <layout class="QHBoxLayout" name="horizontalLayout_21"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="distributeLeftToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeCenterHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeRightToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer_6"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>62</width> + <width>0</width> <height>20</height> </size> </property> @@ -807,63 +663,123 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="_8"> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <layout class="QHBoxLayout" name="_9"> - <property name="spacing"> - <number>3</number> + <widget class="FormWidget" name="distributeVerticalLabel"> + <property name="label" stdset="0"> + <string>Vertical</string> </property> - <item> - <widget class="QLabel" name="distributeDistLabel"> - <property name="text"> - <string>&Distance:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="indent"> - <number>-1</number> - </property> - <property name="buddy"> - <cstring>distributeDistSpinBox</cstring> - </property> - </widget> - </item> - <item> - <widget class="ScrSpinBox" name="distributeDistSpinBox"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>24</height> - </size> - </property> - </widget> - </item> - </layout> + <layout class="QHBoxLayout" name="horizontalLayout_22"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="distributeTopToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeCenterVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeBottomToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer_3"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -876,44 +792,210 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout_26"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <spacer name="spacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <widget class="FormWidget" name="distributeByGapLabel"> + <property name="label" stdset="0"> + <string>By gap</string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> + <layout class="QHBoxLayout" name="horizontalLayout_23"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="distributeAcrossMarginsToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDownPageToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeAcrossPageToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDownMarginsToolButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <widget class="QCheckBox" name="reverseDistributionCheckBox"> - <property name="text"> - <string>Reverse Distribution</string> + <widget class="FormWidget" name="swapLabel"> + <property name="label" stdset="0"> + <string>Swap</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="swapLeftToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="swapRightToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <spacer name="spacer_2"> + <spacer name="horizontalSpacer_8"> <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> @@ -922,113 +1004,99 @@ </layout> </item> <item> - <spacer> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="tabSwap"> - <attribute name="title"> - <string>Swap</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>6</number> - </property> - <property name="topMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>6</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QToolButton" name="swapLeftToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> + <widget class="FormWidget" name="distributeByDistanceLabel"> + <property name="label" stdset="0"> + <string>By distance</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_20"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="distributeDistValueVToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="distributeDistValueHToolButton"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="iconSize"> + <size> + <width>22</width> + <height>22</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="ScrSpinBox" name="distributeDistSpinBox"/> + </item> + <item> + <widget class="QToolButton" name="reverseDistributionButton"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="swapRightToolButton"> - <property name="minimumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="iconSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> @@ -1036,66 +1104,50 @@ </item> </layout> </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> </layout> </widget> </widget> </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>0</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <customwidgets> + <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>SectionContainer</class> + <extends>QWidget</extends> + <header>ui/widgets/section_container.h</header> + <addpagemethod>setWidget</addpagemethod> + <container>1</container> + </customwidget> <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> <header>ui/scrspinbox.h</header> </customwidget> + <customwidget> + <class>PulsingToolButton</class> + <extends>QToolButton</extends> + <header>ui/widgets/pulsing_toolbutton.h</header> + </customwidget> </customwidgets> - <tabstops> - <tabstop>alignRelativeToCombo</tabstop> - <tabstop>alignGuideLineEdit</tabstop> - <tabstop>alignMoveOrResizeCombo</tabstop> - <tabstop>alignLeftOutToolButton</tabstop> - <tabstop>alignLeftInToolButton</tabstop> - <tabstop>alignCenterHorToolButton</tabstop> - <tabstop>alignRightInToolButton</tabstop> - <tabstop>alignRightOutToolButton</tabstop> - <tabstop>alignTopOutToolButton</tabstop> - <tabstop>alignTopInToolButton</tabstop> - <tabstop>alignCenterVerToolButton</tabstop> - <tabstop>alignBottomInToolButton</tabstop> - <tabstop>alignBottomOutToolButton</tabstop> - <tabstop>distributeLeftToolButton</tabstop> - <tabstop>distributeCenterHToolButton</tabstop> - <tabstop>distributeRightToolButton</tabstop> - <tabstop>distributeDistHToolButton</tabstop> - <tabstop>distributeBottomToolButton</tabstop> - <tabstop>distributeCenterVToolButton</tabstop> - <tabstop>distributeTopToolButton</tabstop> - <tabstop>distributeDistVToolButton</tabstop> - <tabstop>distributeAcrossPageToolButton</tabstop> - <tabstop>distributeDownPageToolButton</tabstop> - <tabstop>distributeAcrossMarginsToolButton</tabstop> - <tabstop>distributeDownMarginsToolButton</tabstop> - <tabstop>distributeDistValueHToolButton</tabstop> - <tabstop>distributeDistValueVToolButton</tabstop> - <tabstop>distributeDistSpinBox</tabstop> - <tabstop>reverseDistributionCheckBox</tabstop> - <tabstop>swapLeftToolButton</tabstop> - <tabstop>swapRightToolButton</tabstop> - <tabstop>tabWidget</tabstop> - </tabstops> <includes> <include location="local">ui/scrspinbox.h</include> </includes> diff --git a/scribus/ui/widgets/pulsing_toolbutton.cpp b/scribus/ui/widgets/pulsing_toolbutton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..405860c91936c661014b8387f7fa4fada8bf29f3 --- /dev/null +++ b/scribus/ui/widgets/pulsing_toolbutton.cpp @@ -0,0 +1,79 @@ +#include "pulsing_toolbutton.h" + +#include <QBrush> +#include <QColor> +#include <QPaintEvent> +#include <QPalette> +#include <QStyle> +#include <QStyleOptionButton> +#include <QStylePainter> +#include <QString> +#include <QToolButton> +#include <QVariant> +#include <QVariantAnimation> +#include <QWidget> + +PulsingToolButton::PulsingToolButton(QWidget *parent): + QToolButton(parent), + m_transition(nullptr) +{ +} + +void PulsingToolButton::paintEvent(QPaintEvent* event) +{ + if (m_transition == nullptr) + { + QToolButton::paintEvent(event); + } + else + { + QStylePainter p(this); + QStyleOptionToolButton opt; + initStyleOption(&opt); + p.drawComplexControl(QStyle::CC_ToolButton, opt); + + m_currentColor.setAlpha(100); + p.setBrush(m_currentColor); + p.setPen(Qt::NoPen); + p.drawRect(0,0,width(),height()); + } +} + +// https://stackoverflow.com/questions/53084981/how-to-add-a-hover-transition-to-qpushbutton +// https://forum.qt.io/post/538500 +void PulsingToolButton::animatePulsing() +{ + if (!isChecked()) + { + return; + } + if (m_transition != nullptr) + { + // too fast, don't show a second animation + return; + // m_transition->stop(); + } + + m_transition = new QVariantAnimation(this); + m_transition->setDuration(1000); // TODO: this should be a class const + + QColor startColor = palette().button().color(); + QColor endColor = palette().shadow().color(); + + m_transition->setStartValue(startColor); + m_transition->setEndValue(endColor); + + connect(m_transition, &QVariantAnimation::valueChanged, + this, [this](const QVariant &value){ + m_currentColor = value.value<QColor>(); + repaint(); + }); + + connect(m_transition, &QVariantAnimation::destroyed, + this, [this](){ + m_transition = nullptr; + repaint(); + }); + + m_transition->start(QAbstractAnimation::DeleteWhenStopped); +} diff --git a/scribus/ui/widgets/pulsing_toolbutton.h b/scribus/ui/widgets/pulsing_toolbutton.h new file mode 100644 index 0000000000000000000000000000000000000000..5cec70e431501c28df4281665a35b2d1bfec4b75 --- /dev/null +++ b/scribus/ui/widgets/pulsing_toolbutton.h @@ -0,0 +1,40 @@ +#ifndef PULSING_TOOLBUTTON_H +#define PULSING_TOOLBUTTON_H + +/** + * Change the background color of the ToolButton to the opposite among checked and unchecked, + * then animate the transition back to the original color. + * Currently, done by draing a semitransparent rectangle on top of the button. + * + * In the future, the widget can be extend to pulse in a loop until mouseover, or other + * fancy gadgets. + * + * The current minimal implementation is tailored for the buttonReferenceGuide button in + * the align and distribute dialog: + * - It only pulses once. + * - It only pulses when it's checked. + * - The animation time is a constant. + */ + +#include <QColor> +#include <QToolButton> + +class QVariantAnimation; +class QWidget; + +class PulsingToolButton : public QToolButton +{ + Q_OBJECT +public: + explicit PulsingToolButton(QWidget *parent = nullptr); + void animatePulsing(); + +protected: + void paintEvent(QPaintEvent *) override; + +private: + QVariantAnimation *m_transition; + QColor m_currentColor; +}; + +#endif |
|
and here it is, what it looks like. p.s. it would be nice if the patch could be reviewed and accepted before the next hackergarten at the end of february (https://www.meetup.com/hackergarten-zurich/events/306051032/?eventOrigin=group_similar_events). |
|
|
|
Some issues noticed: Icon paths are still 22/ in the code. This means wrong icons are being loaded.. or the svgs need to go in a new 22 directory. I suspect the paths need changing in code. The pulsating tool button is a nice idea but we need to be careful with licensing. Stackoverflow licensing: Content contributed before 2011-04-08 (UTC) is distributed under the terms of CC BY-SA 2.5. Content contributed from 2011-04-08 up to but not including 2018-05-02 (UTC) is distributed under the terms of CC BY-SA 3.0. Content contributed on or after 2018-05-02 (UTC) is distributed under the terms of CC BY-SA 4.0. I could not locate the forums.qt.io licence (yet) The way I read it, that's not 100% GPL compatible. With the icon stuff sorted, we can commit without the pulsating icon code. |
|
on the one side, i could rewrite the pulsating code. on the other side: - my code is inspired by the code on stackoverflow and in the forums, but it's not a copy of it (the part that is similar, is probably the only way you can apply the animation: if the qt doc would have a usage example, it would look exactly like this.) - the author on SO publishes a library (which is much more work) as MIT: https://github.com/scopchanov/flat-gui ... and his snippets are also on github. without any license. i really think, that he just does not care. also, putting the name of the author of the snippet at the start of the function should cover the spirit of the cc-by-sa... - the main reason why i've put the links in the comment, is to be able to retrieve the sources that have helped me, if anything need to be changed and get the code merged. if you're ready to merge the code, the links are not useful anymore and can be removed. it's a bit absurd that they now make the merging harder... - neither of the posts is about having a pulsating icon... - so, you can remove the link or by improve the comment and write in the way that it better gives attribution the authors: /* * Inspired by a post by mrjj: * https://forum.qt.io/post/538500 */ void PulsingToolButton::paintEvent(QPaintEvent* event) /** * Inspired by: * https://stackoverflow.com/a/53089207/5239250 cc-by-sa scopchanov */ void PulsingToolButton::animatePulsing() anyway, if you have concerns about having such links in the code, really: just remove them, my code is by far not a verbatim copy of the original and none of the sources, by itself, contains a solution to the problem i had to solve. (and i've spent lot of time getting the knots tied and getting the icon to pulsate! it was really not a copy paste job!) |
|
personally, i don't know why the icons have a 22 at the beginning. the entries for the new icons are just a copy paste of the old ones. @nitramr might be able to explain why they start with a 22/ and if we need to change that NOW (or, in a near future, all the 22/ need to be changed...) anyway, as i understand it, the 22/ is part of the id, not the path. the icons will be in the 16/ that you see in the path, but, from the code, will be referenced with a 22... |
|
If the ID looks like a file path it is a leftover of the 1.5.x icon migration. To clean it up we have to replace all IDs in the source code too. |
|
Ok, committed without those confusing comments. @nitramr: can you please provide a patch to fix the icon stuff? |
|
@nitramr , I'm rather good at pattern matching.... If for the icons some systematic changes are needed, please post the instructions in a separate ticket and I can do it . If widespread changes are needed, it will be necessary to coordinate with the team and make sure that someone has time to review and apply. |
|
ps.: thanks craig for merging! |
|
I replaced all icon IDs: https://bugs.scribus.net/view.php?id=17421 |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-01-30 08:04 | ale | New Issue | |
2025-01-30 08:18 | ale | Description Updated | |
2025-01-30 10:14 | nitramr | Note Added: 0051957 | |
2025-01-30 10:14 | nitramr | File Added: Bildschirmfoto 2025-01-30 um 11.07.17.png | |
2025-01-30 11:03 | ale | Note Added: 0051960 | |
2025-01-30 11:07 | ale | Note Added: 0051961 | |
2025-01-30 11:07 | ale | File Added: align-one-line.png | |
2025-01-30 11:14 | ale | Note Edited: 0051961 | |
2025-01-30 11:19 | ale | Note Added: 0051962 | |
2025-01-30 21:00 | ale | Note Added: 0051969 | |
2025-01-30 21:00 | ale | File Added: designer-same-shit.png | |
2025-01-30 21:17 | nitramr | Note Added: 0051970 | |
2025-01-30 21:17 | nitramr | File Added: Bildschirmfoto vom 2025-01-30 22-17-09.png | |
2025-01-30 21:26 | ale | Note Added: 0051971 | |
2025-01-30 21:39 | nitramr | Note Added: 0051972 | |
2025-01-30 21:39 | nitramr | File Added: Bildschirmfoto vom 2025-01-30 22-33-47.png | |
2025-01-30 21:43 | ale | Note Added: 0051973 | |
2025-01-30 21:43 | ale | File Added: designer-much-better.png | |
2025-01-30 21:49 | nitramr | Note Added: 0051974 | |
2025-01-30 21:49 | nitramr | File Added: Bildschirmfoto vom 2025-01-30 22-46-47.png | |
2025-01-30 21:52 | ale | Note Added: 0051975 | |
2025-01-30 21:59 | ale | Note Added: 0051976 | |
2025-01-30 21:59 | ale | File Added: align-ok.png | |
2025-01-30 21:59 | nitramr | Note Added: 0051977 | |
2025-01-31 06:25 | ale | Note Added: 0051978 | |
2025-02-01 09:02 | ale | Note Added: 0051982 | |
2025-02-01 09:02 | ale | File Added: align-distribute-preliminary.png | |
2025-02-02 13:44 | ale | Note Added: 0051992 | |
2025-02-02 13:44 | ale | File Added: align-and-distribute-into-sections.diff | |
2025-02-02 13:44 | ale | Summary | Make the Align and distribute tool more comfortable to use => [PATCH] Make the Align and distribute tool more comfortable to use |
2025-02-02 13:44 | ale | Patch | No => Yes |
2025-02-02 13:49 | ale | Note Added: 0051993 | |
2025-02-02 15:27 | nitramr | Note Added: 0051994 | |
2025-02-02 17:13 | ale | Note Added: 0051995 | |
2025-02-02 17:13 | ale | File Added: aligndistribute.ui | |
2025-02-02 17:32 | ale | Note Added: 0051996 | |
2025-02-02 19:50 | nitramr | Note Added: 0051997 | |
2025-02-03 17:42 | nitramr | Note Added: 0052000 | |
2025-02-03 17:42 | nitramr | File Added: icons.zip | |
2025-02-03 17:42 | nitramr | File Added: Bildschirmfoto vom 2025-02-03 18-34-24.png | |
2025-02-03 17:42 | nitramr | File Added: icon_with_extension(anchor).png | |
2025-02-03 17:42 | nitramr | File Added: screenshot_20250203-181847.png | |
2025-02-03 20:46 | ale | Note Added: 0052003 | |
2025-02-03 20:46 | ale | File Added: reverse-left-right.png | |
2025-02-03 20:46 | ale | File Added: align-reverse-distribution-left.svg | |
2025-02-03 20:46 | ale | File Added: align-reverse-distribution-right.svg | |
2025-02-03 20:54 | nitramr | Note Added: 0052004 | |
2025-02-03 20:56 | nitramr | Note Edited: 0052004 | |
2025-02-06 07:54 | ale | Note Added: 0052016 | |
2025-02-06 16:53 | ale | Note Added: 0052019 | |
2025-02-06 16:53 | ale | File Added: icons-20250206.zip | |
2025-02-06 16:53 | ale | Note Added: 0052020 | |
2025-02-06 16:53 | ale | File Added: align-and-distribute-into-sections-20250226.diff | |
2025-02-06 16:55 | ale | Note Edited: 0052020 | |
2025-02-07 21:21 | nitramr | Note Added: 0052023 | |
2025-02-07 21:21 | nitramr | File Added: aligndistribute-2.ui | |
2025-02-07 21:21 | nitramr | File Added: align-mode-move.svg | |
2025-02-07 21:21 | nitramr | File Added: align-mode-resize.svg | |
2025-02-07 21:21 | nitramr | File Added: align-reverse-distribution-left-2.svg | |
2025-02-07 21:21 | nitramr | File Added: align-reverse-distribution-right-2.svg | |
2025-02-07 21:21 | nitramr | File Added: labels.png | |
2025-02-07 21:21 | nitramr | File Added: no labels.png | |
2025-02-07 21:26 | nitramr | Note Added: 0052024 | |
2025-02-08 13:14 | ale | Note Added: 0052027 | |
2025-02-13 15:24 | ale | Note Added: 0052045 | |
2025-02-13 15:24 | ale | File Added: 47.diff | |
2025-02-13 15:24 | ale | File Added: icons-2.zip | |
2025-02-13 15:30 | ale | Note Added: 0052046 | |
2025-02-13 15:31 | ale | Note Added: 0052047 | |
2025-02-13 15:31 | ale | File Added: align-and-distribute-both.png | |
2025-02-13 21:28 | cbradney | Note Added: 0052049 | |
2025-02-14 20:55 | ale | Note Added: 0052050 | |
2025-02-14 21:05 | ale | Note Added: 0052051 | |
2025-02-14 21:14 | nitramr | Note Added: 0052052 | |
2025-02-14 21:43 | cbradney | Note Added: 0052053 | |
2025-02-15 05:24 | ale | Note Added: 0052054 | |
2025-02-15 05:31 | ale | Note Added: 0052055 | |
2025-02-15 22:40 | nitramr | Note Added: 0052057 | |
2025-02-16 20:40 | cbradney | Assigned To | => ale |
2025-02-16 20:40 | cbradney | Status | new => resolved |
2025-02-16 20:40 | cbradney | Resolution | open => fixed |
2025-02-16 20:40 | cbradney | Fixed in Version | => 1.7.1.svn |
2025-02-19 21:37 | jghali | Summary | [PATCH] Make the Align and distribute tool more comfortable to use => Make the Align and distribute tool more comfortable to use |
2025-02-21 18:51 | nitramr | Relationship added | related to 0017428 |