diff --git a/resources/iconsets/1_5_1/16/flip-object-horizontal.png b/resources/iconsets/1_5_1/16/flip-object-horizontal.png index b5053fa7f..32b36a363 100644 Binary files a/resources/iconsets/1_5_1/16/flip-object-horizontal.png and b/resources/iconsets/1_5_1/16/flip-object-horizontal.png differ diff --git a/resources/iconsets/1_5_1/16/flip-object-vertical.png b/resources/iconsets/1_5_1/16/flip-object-vertical.png index d94b746f7..6602230d6 100644 Binary files a/resources/iconsets/1_5_1/16/flip-object-vertical.png and b/resources/iconsets/1_5_1/16/flip-object-vertical.png differ diff --git a/resources/iconsets/1_5_1/16/level-bottom.png b/resources/iconsets/1_5_1/16/level-bottom.png new file mode 100644 index 000000000..d97871f60 Binary files /dev/null and b/resources/iconsets/1_5_1/16/level-bottom.png differ diff --git a/resources/iconsets/1_5_1/16/level-down.png b/resources/iconsets/1_5_1/16/level-down.png new file mode 100644 index 000000000..a7022c426 Binary files /dev/null and b/resources/iconsets/1_5_1/16/level-down.png differ diff --git a/resources/iconsets/1_5_1/16/level-top.png b/resources/iconsets/1_5_1/16/level-top.png new file mode 100644 index 000000000..f0a4400cb Binary files /dev/null and b/resources/iconsets/1_5_1/16/level-top.png differ diff --git a/resources/iconsets/1_5_1/16/level-up.png b/resources/iconsets/1_5_1/16/level-up.png new file mode 100644 index 000000000..7d64fe3b7 Binary files /dev/null and b/resources/iconsets/1_5_1/16/level-up.png differ diff --git a/resources/iconsets/1_5_1/rotation.png b/resources/iconsets/1_5_1/rotation.png new file mode 100644 index 000000000..4288effc9 Binary files /dev/null and b/resources/iconsets/1_5_1/rotation.png differ diff --git a/scribus/CMakeLists.txt b/scribus/CMakeLists.txt index a92433cb1..29dd78740 100644 --- a/scribus/CMakeLists.txt +++ b/scribus/CMakeLists.txt @@ -157,6 +157,7 @@ set(SCRIBUS_UI_SRC ui/prefs_pdfexportbase.ui ui/prefs_tableofcontentsbase.ui ui/prefs_documentitemattributesbase.ui + ui/basepointwidgetbase.ui ui/printdialogbase.ui ui/propertiespalette_groupbase.ui ui/propertiespalette_imagebase.ui diff --git a/scribus/ui/basepointwidget.cpp b/scribus/ui/basepointwidget.cpp index c6dca8f09..d9af4482d 100644 --- a/scribus/ui/basepointwidget.cpp +++ b/scribus/ui/basepointwidget.cpp @@ -7,197 +7,84 @@ for which a new license (GPL+exception) is in place. #include "basepointwidget.h" -BasePointWidget::BasePointWidget(QWidget *pa, int mode) : QWidget(pa) -{ - m_mode = mode; - if (m_mode == 0) - { - setMinimumSize(QSize(48, 48)); - setMaximumSize(QSize(48, 48)); - } - else - { - setMinimumSize(QSize(48, 16)); - setMaximumSize(QSize(48, 16)); - } - setMouseTracking(true); - selectedBase = 0; - hooveredBase = -1; - Mpressed = false; -} +#include +#include "iconmanager.h" -void BasePointWidget::paintEvent(QPaintEvent *e) +BasePointWidget::BasePointWidget(QWidget *parent) : QWidget(parent) { - QPainter p; - p.begin(this); - p.setRenderHint(QPainter::Antialiasing, true); - p.setBrush(palette().color(QPalette::Window)); - p.setPen(Qt::NoPen); - p.drawRect(0, 0, width(), height()); - p.setBrush(Qt::black); - p.setPen(QPen(palette().color(QPalette::WindowText), 1)); - if (m_mode == 0) - { - p.drawEllipse( 4, 4, 10, 10); - p.drawEllipse(34, 4, 10, 10); - p.drawEllipse(19, 19, 10, 10); - p.drawEllipse( 4, 34, 10, 10); - p.drawEllipse(34, 34, 10, 10); - } - else - { - p.drawEllipse( 4, 4, 10, 10); - p.drawEllipse(19, 4, 10, 10); - p.drawEllipse(34, 4, 10, 10); - } - p.setPen(QPen(palette().color(QPalette::WindowText), 2)); - if (m_mode == 0) - { - p.drawLine(8, 8, 33, 8); - p.drawLine(8, 38, 33, 38); - p.drawLine(8, 8, 8, 33); - p.drawLine(38, 8, 38, 33); - } - else - p.drawLine(8, 8, 33, 8); - p.setBrush(Qt::white); - p.setPen(QPen(palette().color(QPalette::WindowText), 2)); - if (m_mode == 0) - { - p.drawEllipse( 3, 3, 10, 10); - p.drawEllipse(33, 3, 10, 10); - p.drawEllipse(18, 18, 10, 10); - p.drawEllipse( 3, 33, 10, 10); - p.drawEllipse(33, 33, 10, 10); - } - else - { - p.drawEllipse( 3, 3, 10, 10); - p.drawEllipse(18, 3, 10, 10); - p.drawEllipse(33, 3, 10, 10); - } - if (hooveredBase > -1) - { - p.setBrush(Qt::NoBrush); - p.setPen(QPen(palette().color(QPalette::Highlight), 1)); - if (hooveredBase == 0) - p.drawEllipse( 4, 4, 8, 8); - else if (hooveredBase == 1) - p.drawEllipse(34, 4, 8, 8); - else if (hooveredBase == 2) - { - if (m_mode == 0) - p.drawEllipse(19, 19, 8, 8); - else - p.drawEllipse(19, 4, 8, 8); - } - else if (hooveredBase == 3) - p.drawEllipse( 4, 34, 8, 8); - else if (hooveredBase == 4) - p.drawEllipse(34, 34, 8, 8); - } - p.setBrush(palette().color(QPalette::WindowText)); - p.setPen(Qt::NoPen); - if (selectedBase == 0) - p.drawEllipse( 5, 5, 6, 6); - else if (selectedBase == 1) - p.drawEllipse(35, 5, 6, 6); - else if (selectedBase == 2) - { - if (m_mode == 0) - p.drawEllipse(20, 20, 6, 6); - else - p.drawEllipse(20, 5, 6, 6); - } - else if (selectedBase == 3) - p.drawEllipse( 5, 35, 6, 6); - else if (selectedBase == 4) - p.drawEllipse(35, 35, 6, 6); - p.end(); -} + setupUi(this); -void BasePointWidget::mousePressEvent(QMouseEvent *m) -{ - m->accept(); - Mpressed = true; -} + auto group = new QButtonGroup(this); + group->addButton(buttonNE); + group->addButton(buttonNW); + group->addButton(buttonCenter); + group->addButton(buttonSE); + group->addButton(buttonSW); -void BasePointWidget::mouseReleaseEvent(QMouseEvent *m) -{ - m->accept(); - if (Mpressed) - { - QPoint p = m->pos(); - if (m_mode == 0) - { - if (QRect( 3, 3, 10, 10).contains(p)) - selectedBase = 0; - else if (QRect(33, 3, 10, 10).contains(p)) - selectedBase = 1; - else if (QRect(18, 18, 10, 10).contains(p)) - selectedBase = 2; - else if (QRect( 3, 33, 10, 10).contains(p)) - selectedBase = 3; - else if (QRect(33, 33, 10, 10).contains(p)) - selectedBase = 4; - } - else - { - if (QRect( 3, 3, 9, 9).contains(p)) - selectedBase = 0; - else if (QRect(33, 3, 10, 10).contains(p)) - selectedBase = 1; - else if (QRect(18, 3, 10, 10).contains(p)) - selectedBase = 2; - } - emit buttonClicked(selectedBase); - } - update(); -} + buttonE->setEnabled(false); + buttonN->setEnabled(false); + buttonW->setEnabled(false); + buttonS->setEnabled(false); -void BasePointWidget::mouseMoveEvent(QMouseEvent *m) -{ - m->accept(); - QPoint p = m->pos(); - hooveredBase = -1; - if (m_mode == 0) - { - if (QRect( 3, 3, 10, 10).contains(p)) - hooveredBase = 0; - else if (QRect(33, 3, 10, 10).contains(p)) - hooveredBase = 1; - else if (QRect(18, 18, 10, 10).contains(p)) - hooveredBase = 2; - else if (QRect( 3, 33, 10, 10).contains(p)) - hooveredBase = 3; - else if (QRect(33, 33, 10, 10).contains(p)) - hooveredBase = 4; - } - else - { - if (QRect( 3, 3, 10, 10).contains(p)) - hooveredBase = 0; - else if (QRect(33, 3, 10, 10).contains(p)) - hooveredBase = 1; - else if (QRect(18, 3, 10, 10).contains(p)) - hooveredBase = 2; - } - update(); -} + IconManager& im=IconManager::instance(); + + loadIcon(im, buttonNE); + loadIcon(im, buttonN); + loadIcon(im, buttonNW); + loadIcon(im, buttonE); + loadIcon(im, buttonCenter); + loadIcon(im, buttonW); + loadIcon(im, buttonSE); + loadIcon(im, buttonS); + loadIcon(im, buttonSW); -void BasePointWidget::leaveEvent(QEvent*) + connect(buttonNE, &QToolButton::clicked, [this]() { emit buttonClicked(0); }); + connect(buttonNW, &QToolButton::clicked, [this]() { emit buttonClicked(1); }); + connect(buttonCenter, &QToolButton::clicked, [this]() { emit buttonClicked(2); }); + connect(buttonSE, &QToolButton::clicked, [this]() { emit buttonClicked(3); }); + connect(buttonSW, &QToolButton::clicked, [this]() { emit buttonClicked(4); }); +} + +void BasePointWidget::loadIcon(IconManager& im, QToolButton* button) { - hooveredBase = -1; - update(); + QIcon icon = QIcon(); + icon.addPixmap(im.loadPixmap("16/baseline-checked.png"), QIcon::Normal, QIcon::On); + icon.addPixmap(im.loadPixmap("16/baseline-unchecked.png"), QIcon::Normal, QIcon::Off); + button->setIcon(icon); } int BasePointWidget::checkedId() { - return selectedBase; + if (buttonNE->isChecked()) + return 0; + else if (buttonNW->isChecked()) + return 1; + else if (buttonCenter->isChecked()) + return 2; + else if (buttonSE->isChecked()) + return 3; + else if (buttonSW->isChecked()) + return 4; + return 0; } void BasePointWidget::setCheckedId(int id) { - selectedBase = id; - update(); + switch (id) { + case 0: + buttonNE->setChecked(true); + break; + case 1: + buttonNW->setChecked(true); + break; + case 2: + buttonCenter->setChecked(true); + break; + case 3: + buttonSE->setChecked(true); + break; + case 4: + buttonSE->setChecked(true); + break; + } } diff --git a/scribus/ui/basepointwidget.h b/scribus/ui/basepointwidget.h index abfde3c9f..0ae85bd2c 100644 --- a/scribus/ui/basepointwidget.h +++ b/scribus/ui/basepointwidget.h @@ -7,18 +7,19 @@ for which a new license (GPL+exception) is in place. #ifndef BASEPOINTWIDGET_H #define BASEPOINTWIDGET_H +#include "ui_basepointwidgetbase.h" + #include -#include -#include -#include #include "scribusapi.h" -class SCRIBUS_API BasePointWidget : public QWidget +class IconManager; + +class SCRIBUS_API BasePointWidget : public QWidget, public Ui::BasePointWidgetBase { Q_OBJECT public: - BasePointWidget(QWidget *pa, int mode = 0); + BasePointWidget(QWidget *parent); ~BasePointWidget() {} /** BasePoint values: @@ -30,16 +31,8 @@ public: */ int checkedId(); void setCheckedId(int id); - void paintEvent(QPaintEvent *e); - void mousePressEvent(QMouseEvent *m); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *m); - void leaveEvent(QEvent*); private: - int m_mode; - int selectedBase; - int hooveredBase; - bool Mpressed; + void loadIcon(IconManager& im, QToolButton* button); signals: void buttonClicked(int); }; diff --git a/scribus/ui/basepointwidgetbase.ui b/scribus/ui/basepointwidgetbase.ui new file mode 100644 index 000000000..66d3a24f0 --- /dev/null +++ b/scribus/ui/basepointwidgetbase.ui @@ -0,0 +1,248 @@ + + + BasePointWidgetBase + + + + 0 + 0 + 62 + 51 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + 1 + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + + 16 + 16 + + + + + 16 + 16 + + + + ... + + + true + + + + + + + buttonNE + buttonN + buttonNW + buttonE + buttonCenter + buttonW + buttonSE + buttonS + buttonSW + + + + diff --git a/scribus/ui/propertiespalette_xyz.cpp b/scribus/ui/propertiespalette_xyz.cpp index 62be16af1..8666a0188 100644 --- a/scribus/ui/propertiespalette_xyz.cpp +++ b/scribus/ui/propertiespalette_xyz.cpp @@ -61,32 +61,35 @@ PropertiesPalette_XYZ::PropertiesPalette_XYZ( QWidget* parent) : QWidget(parent) connect(userActionSniffer, SIGNAL(actionStart()), this, SLOT(spinboxStartUserAction())); connect(userActionSniffer, SIGNAL(actionEnd()), this, SLOT(spinboxFinishUserAction())); - nameEdit->setFocusPolicy(Qt::ClickFocus); - installSniffer(xposSpin); installSniffer(yposSpin); installSniffer(widthSpin); installSniffer(heightSpin); - keepFrameWHRatioButton->setCheckable( true ); - keepFrameWHRatioButton->setAutoRaise( true ); - keepFrameWHRatioButton->setMaximumSize( QSize( 15, 32767 ) ); + IconManager& im=IconManager::instance(); + + // keepFrameWHRatioButton->setCheckable(true); + // { + // QIcon icon = QIcon(); + // icon.addPixmap(im.loadPixmap("chain-small-closed.png"), QIcon::Normal, QIcon::On); + // icon.addPixmap(im.loadPixmap("chain-small-open.png"), QIcon::Normal, QIcon::Off); + // keepFrameWHRatioButton->setIcon(icon); + // } + + keepFrameWHRatioButton->setCheckable(true); + keepFrameWHRatioButton->setAutoRaise(true); + keepFrameWHRatioButton->setMaximumSize(QSize(15, 32767)); keepFrameWHRatioButton->setChecked(false); + // rotation->setPixmap(im.loadPixmap("rotation.png")); // TODO: using the unicode char might even be better... but i did not manage to load the pixmap in the label rotationSpin->setNewUnit(6); rotationSpin->setWrapping( true ); installSniffer(rotationSpin); - rotationLabel->setBuddy(rotationSpin); - - IconManager& im=IconManager::instance(); - levelUp->setIcon(im.loadIcon("16/go-up.png")); - levelDown->setIcon(im.loadIcon("16/go-down.png")); - levelTop->setIcon(im.loadIcon("16/go-top.png")); - levelBottom->setIcon(im.loadIcon("16/go-bottom.png")); - levelLabel->setAlignment( Qt::AlignCenter ); - doGroup->setIcon(im.loadIcon("group.png")); - doUnGroup->setIcon(im.loadIcon("ungroup.png")); + levelUp->setIcon(IconManager::instance().loadIcon("16/level-up.png")); + levelDown->setIcon(IconManager::instance().loadIcon("16/level-down.png")); + levelTop->setIcon(IconManager::instance().loadIcon("16/level-top.png")); + levelBottom->setIcon(IconManager::instance().loadIcon("16/level-bottom.png")); flipH->setIcon(im.loadIcon("16/flip-object-horizontal.png")); flipH->setCheckable( true ); @@ -99,12 +102,6 @@ PropertiesPalette_XYZ::PropertiesPalette_XYZ( QWidget* parent) : QWidget(parent) a.addPixmap(im.loadPixmap("16/lock-unlocked.png"), QIcon::Normal, QIcon::Off); doLock->setIcon(a); - noPrint->setCheckable( true ); - QIcon a2 = QIcon(); - a2.addPixmap(im.loadPixmap("NoPrint.png"), QIcon::Normal, QIcon::On); - a2.addPixmap(im.loadPixmap("16/document-print.png"), QIcon::Normal, QIcon::Off); - noPrint->setIcon(a2); - noResize->setCheckable( true ); QIcon a3 = QIcon(); a3.addPixmap(im.loadPixmap("framenoresize.png"), QIcon::Normal, QIcon::On); @@ -128,12 +125,8 @@ PropertiesPalette_XYZ::PropertiesPalette_XYZ( QWidget* parent) : QWidget(parent) connect(levelBottom, SIGNAL(clicked()), this, SLOT(handleBack())); connect(basePointWidget, SIGNAL(buttonClicked(int)), this, SLOT(handleBasePoint(int))); - connect(nameEdit , SIGNAL(Leaved()) , this, SLOT(handleNewName())); connect(doLock , SIGNAL(clicked()), this, SLOT(handleLock())); - connect(noPrint , SIGNAL(clicked()), this, SLOT(handlePrint())); connect(noResize , SIGNAL(clicked()), this, SLOT(handleLockSize())); - connect(doGroup , SIGNAL(clicked()), this, SLOT(handleGrouping()) ); - connect(doUnGroup, SIGNAL(clicked()), this, SLOT(handleUngrouping()) ); m_haveItem = false; xposSpin->showValue(0); @@ -203,19 +196,16 @@ void PropertiesPalette_XYZ::unsetDoc() m_haveItem = false; m_doc = nullptr; m_item = nullptr; - nameEdit->clear(); xposSpin->setConstants(nullptr); yposSpin->setConstants(nullptr); widthSpin->setConstants(nullptr); heightSpin->setConstants(nullptr); - doGroup->setEnabled(false); - doUnGroup->setEnabled(false); flipH->setEnabled(false); flipV->setEnabled(false); - xposLabel->setText( tr( "&X-Pos:" ) ); - yposLabel->setText( tr( "&Y-Pos:" ) ); - widthLabel->setText( tr( "&Width:" ) ); - heightLabel->setText( tr( "&Height:" ) ); + xposLabel->setText(tr("&X")); + yposLabel->setText(tr("&Y")); + widthLabel->setText(tr("&W")); + heightLabel->setText(tr("&H")); xposSpin->showValue(0); yposSpin->showValue(0); widthSpin->showValue(0); @@ -235,20 +225,20 @@ void PropertiesPalette_XYZ::setLineMode(int lineMode) { if (lineMode == 0) { - xposLabel->setText( tr( "&X-Pos:" ) ); - yposLabel->setText( tr( "&Y-Pos:" ) ); - widthLabel->setText( tr( "&Width:" ) ); - heightLabel->setText( tr( "&Height:" ) ); + xposLabel->setText(tr("&X")); + yposLabel->setText(tr("&Y")); + widthLabel->setText(tr("&W")); + heightLabel->setText(tr("&H")); rotationSpin->setEnabled(true); heightSpin->setEnabled(false); m_lineMode = false; } else { - xposLabel->setText( tr( "&X1:" ) ); - yposLabel->setText( tr( "Y&1:" ) ); - widthLabel->setText( tr( "X&2:" ) ); - heightLabel->setText( tr( "&Y2:" ) ); + xposLabel->setText(tr("&X1:")); + yposLabel->setText(tr("Y&1:")); + widthLabel->setText(tr("X&2:")); + heightLabel->setText(tr("&Y2:")); rotationSpin->setEnabled(false); heightSpin->setEnabled(true); m_lineMode = true; @@ -288,23 +278,17 @@ void PropertiesPalette_XYZ::setCurrentItem(PageItem *item) if (!m_doc) setDoc(item->doc()); - disconnect(nameEdit, SIGNAL(Leaved()), this, SLOT(handleNewName())); - m_haveItem = false; m_item = item; - nameEdit->setText(m_item->itemName()); levelLabel->setText( QString::number(m_item->level()) ); - connect(nameEdit, SIGNAL(Leaved()), this, SLOT(handleNewName())); - //CB replaces old emits from PageItem::emitAllToGUI() disconnect(xposSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewX())); disconnect(yposSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewY())); disconnect(widthSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewW())); disconnect(heightSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewH())); disconnect(doLock, SIGNAL(clicked()), this, SLOT(handleLock())); - disconnect(noPrint, SIGNAL(clicked()), this, SLOT(handlePrint())); disconnect(noResize, SIGNAL(clicked()), this, SLOT(handleLockSize())); disconnect(flipH, SIGNAL(clicked()), this, SLOT(handleFlipH())); disconnect(flipV, SIGNAL(clicked()), this, SLOT(handleFlipV())); @@ -323,7 +307,6 @@ void PropertiesPalette_XYZ::setCurrentItem(PageItem *item) flipH->setCheckable(checkableFlip); flipV->setCheckable(checkableFlip); - noPrint->setChecked(!item->printEnabled()); showFlippedH(item->imageFlippedH()); showFlippedV(item->imageFlippedV()); double rr = item->rotation(); @@ -338,35 +321,39 @@ void PropertiesPalette_XYZ::setCurrentItem(PageItem *item) connect(widthSpin , SIGNAL(valueChanged(double)), this, SLOT(handleNewW()), Qt::UniqueConnection); connect(heightSpin , SIGNAL(valueChanged(double)), this, SLOT(handleNewH()), Qt::UniqueConnection); connect(doLock , SIGNAL(clicked()), this, SLOT(handleLock()), Qt::UniqueConnection); - connect(noPrint , SIGNAL(clicked()), this, SLOT(handlePrint()), Qt::UniqueConnection); connect(noResize, SIGNAL(clicked()), this, SLOT(handleLockSize()), Qt::UniqueConnection); connect(flipH , SIGNAL(clicked()), this, SLOT(handleFlipH()), Qt::UniqueConnection); connect(flipV , SIGNAL(clicked()), this, SLOT(handleFlipV()), Qt::UniqueConnection); connect(rotationSpin, SIGNAL(valueChanged(double)), this, SLOT(handleRotation()), Qt::UniqueConnection); - bool setter = false; - xposSpin->setEnabled(!setter); - yposSpin->setEnabled(!setter); - bool haveSameParent = m_doc->m_Selection->objectsHaveSameParent(); - levelGroup->setEnabled(haveSameParent && !item->locked()); + xposSpin->setEnabled(true); + yposSpin->setEnabled(true); + { + bool enabled = m_doc->m_Selection->objectsHaveSameParent() && !item->locked(); + levelTop->setEnabled(enabled); + levelUp->setEnabled(enabled); + levelDown->setEnabled(enabled); + levelBottom->setEnabled(enabled); + } + // TODO: what is doing this? if ((m_item->isGroup()) && (!m_item->isSingleSel)) { setEnabled(true); } if ((m_item->itemType() == PageItem::Line) && m_lineMode) { - xposLabel->setText( tr( "&X1:" ) ); - yposLabel->setText( tr( "Y&1:" ) ); - widthLabel->setText( tr( "X&2:" ) ); - heightLabel->setText( tr( "&Y2:" ) ); + xposLabel->setText(tr("&X1")); + yposLabel->setText(tr("Y&1")); + widthLabel->setText(tr("X&2")); + heightLabel->setText(tr("&Y2")); rotationSpin->setEnabled(false); } else { - xposLabel->setText( tr( "&X-Pos:" ) ); - yposLabel->setText( tr( "&Y-Pos:" ) ); - widthLabel->setText( tr( "&Width:" ) ); - heightLabel->setText( tr( "&Height:" ) ); + xposLabel->setText(tr("&X")); + yposLabel->setText(tr("&Y")); + widthLabel->setText(tr("&W")); + heightLabel->setText(tr("&H")); rotationSpin->setEnabled(true); } m_haveItem = true; @@ -389,14 +376,6 @@ void PropertiesPalette_XYZ::setCurrentItem(PageItem *item) rrR = 360 - rrR; noResize->setEnabled(!m_item->isArc()); - doGroup->setEnabled(false); - doUnGroup->setEnabled(false); - if ((m_doc->m_Selection->count() > 1) && (haveSameParent)) - doGroup->setEnabled(true); - if (m_doc->m_Selection->count() == 1) - doUnGroup->setEnabled(m_item->isGroup()); - if ((m_doc->appMode == modeEditClip) && (m_item->isGroup())) - doUnGroup->setEnabled(false); if (m_item->asOSGFrame()) { setEnabled(true); @@ -413,7 +392,6 @@ void PropertiesPalette_XYZ::handleAppModeChanged(int oldMode, int mode) { if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) return; - doUnGroup->setEnabled(mode != modeEdit && mode != modeEditClip && m_item->isGroup()); doLock->setEnabled(mode != modeEditClip); } @@ -422,8 +400,6 @@ void PropertiesPalette_XYZ::handleSelectionChanged() if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning()) return; - nameEdit->setEnabled(m_doc->m_Selection->count() == 1); - PageItem* currItem = currentItemFromSelection(); if (m_doc->m_Selection->count() > 1) { @@ -441,10 +417,10 @@ void PropertiesPalette_XYZ::handleSelectionChanged() m_ScMW->view->RCenter = FPoint(gx, gy + gh); else if (bp == 4) m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh); - xposLabel->setText( tr( "&X-Pos:" ) ); - yposLabel->setText( tr( "&Y-Pos:" ) ); - widthLabel->setText( tr( "&Width:" ) ); - heightLabel->setText( tr( "&Height:" ) ); + xposLabel->setText(tr("&X")); + yposLabel->setText(tr("&Y")); + widthLabel->setText(tr("&W")); + heightLabel->setText(tr("&H")); xposSpin->showValue(gx); yposSpin->showValue(gy); @@ -458,7 +434,6 @@ void PropertiesPalette_XYZ::handleSelectionChanged() heightSpin->setEnabled(true); rotationSpin->setEnabled(true); - nameEdit->setEnabled(false); flipH->setCheckable( false ); flipV->setCheckable( false ); flipH->setChecked(false); @@ -474,12 +449,6 @@ void PropertiesPalette_XYZ::handleSelectionChanged() int itemType = currItem ? (int) currItem->itemType() : -1; m_haveItem = (itemType!=-1); - if (itemType == -1) - { - doGroup->setEnabled(false); - doUnGroup->setEnabled(false); - } - nameEdit->setEnabled(true); basePointWidget->setEnabled(true); setEnabled(true); @@ -509,10 +478,10 @@ void PropertiesPalette_XYZ::handleSelectionChanged() switch (itemType) { case -1: - xposLabel->setText( tr( "&X-Pos:" ) ); - yposLabel->setText( tr( "&Y-Pos:" ) ); - widthLabel->setText( tr( "&Width:" ) ); - heightLabel->setText( tr( "&Height:" ) ); + xposLabel->setText(tr("&X")); + yposLabel->setText(tr("&Y")); + widthLabel->setText(tr("&W")); + heightLabel->setText(tr("&H")); xposSpin->showValue(0); yposSpin->showValue(0); @@ -1166,13 +1135,6 @@ void PropertiesPalette_XYZ::handleLockSize() m_ScMW->scrActions["itemLockSize"]->toggle(); } -void PropertiesPalette_XYZ::handlePrint() -{ - if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - m_ScMW->scrActions["itemPrintingEnabled"]->toggle(); -} - void PropertiesPalette_XYZ::handleFlipH() { if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -1187,6 +1149,7 @@ void PropertiesPalette_XYZ::handleFlipV() m_ScMW->scrActions["itemFlipV"]->toggle(); } +/* void PropertiesPalette_XYZ::handleNewName() { if (m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem) @@ -1233,6 +1196,7 @@ void PropertiesPalette_XYZ::handleNewName() } } } +*/ void PropertiesPalette_XYZ::installSniffer(ScrSpinBox *spinBox) { @@ -1345,11 +1309,6 @@ void PropertiesPalette_XYZ::showSizeLocked(bool isSizeLocked) noResize->setChecked(isSizeLocked); } -void PropertiesPalette_XYZ::showPrintingEnabled(bool isPrintingEnabled) -{ - noPrint->setChecked(!isPrintingEnabled); -} - void PropertiesPalette_XYZ::showFlippedH(bool isFlippedH) { flipH->setChecked(isFlippedH); @@ -1359,20 +1318,3 @@ void PropertiesPalette_XYZ::showFlippedV(bool isFlippedV) { flipV->setChecked(isFlippedV); } - -void PropertiesPalette_XYZ::handleGrouping() -{ - m_ScMW->GroupObj(); - doGroup->setEnabled(false); - doUnGroup->setEnabled(true); - handleSelectionChanged(); - //FIXME - //TabStack->setItemEnabled(idShapeItem, false); -} - -void PropertiesPalette_XYZ::handleUngrouping() -{ - m_ScMW->UnGroupObj(); - m_doc->invalidateAll(); - m_doc->regionsChanged()->update(QRect()); -} diff --git a/scribus/ui/propertiespalette_xyz.h b/scribus/ui/propertiespalette_xyz.h index 7892c5043..4c2c2c3be 100644 --- a/scribus/ui/propertiespalette_xyz.h +++ b/scribus/ui/propertiespalette_xyz.h @@ -14,10 +14,10 @@ for which a new license (GPL+exception) is in place. #include "linkbutton.h" #include "sclistboxpixmap.h" #include "scguardedptr.h" +#include "pageitem.h" class BasePointWidget; class NameWidget; -class PageItem; class ScribusDoc; class Selection; class ScribusMainWindow; @@ -61,7 +61,6 @@ public slots: void showRotation(double r); void showLocked(bool); void showSizeLocked(bool); - void showPrintingEnabled(bool); void showFlippedH(bool); void showFlippedV(bool); @@ -83,10 +82,6 @@ private slots: void handleBasePoint(int m); void handleLock(); void handleLockSize(); - void handlePrint(); - void handleNewName(); - void handleGrouping(); - void handleUngrouping(); protected slots: //virtual void reject(); diff --git a/scribus/ui/propertiespalette_xyzbase.ui b/scribus/ui/propertiespalette_xyzbase.ui index 06e9c35d5..f97d98476 100644 --- a/scribus/ui/propertiespalette_xyzbase.ui +++ b/scribus/ui/propertiespalette_xyzbase.ui @@ -30,404 +30,265 @@ 0 - - - - 0 - 0 - - - - Name - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - Qt::ClickFocus - - - Name of selected object - - - - - - - - - - - 0 - 0 - - - - Geometry - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - 5 - - - 5 - - - 5 - - - 5 - - - 4 - - - - - &X-Pos: - - - xposSpin - - - - - - - - 0 - 0 - - - - Horizontal position of current basepoint - - - - - - - &Width: - - - widthSpin - - - - - - - &Y-Pos: - - - yposSpin - - - - - - - Vertical position of current basepoint - - - - - - - Width of current selection - - - - - - - &Height: - - - heightSpin - - - - - - - Height of current selection - - - - - - - &Rotation: - - - - - - - Rotation of object at current basepoint - - - true - - - - - - - Point from which measurements or rotation angles are referenced - - - Basepoint: - - - - - - - - - - - 15 - 32767 - - - - Keep the aspect ratio - - - ... - - - true - - - true - - - - - - - - - - - - - - Level + + + + + &X: + + + xposSpin - - - 5 - - - 5 - - - 5 - - - 5 - - - 4 - - - - - - 22 - 22 - - - - Move one level up - - - - - - - - - - - 22 - 22 - - - - Move one level down - - - - - - - - - - - 22 - 22 - - - - Move to front - - - - - - - - - - - 22 - 22 - - - - Move to back - - - - - - - - - - Indicates the level the object is on, 1 means the object is at the bottom - - - 0 - - - - - - - - Qt::Horizontal + + + + + 0 + 0 + - - - 40 - 20 - + + Horizontal position of current basepoint - + - - - - + + + + + + Rotation of object at current basepoint + + + true + + + + + - Group the selected objects + Flip horizontally - - + + - Ungroup the selected group + Flip vertically - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Lock or unlock the size of the object + + + + + + + + + + + + + + + + + + + + 22 + 22 + + - Flip horizontally + Move to back - - + + + + + 22 + 22 + + - Flip vertically + Move one level down - - + + + + + 22 + 22 + + - Lock or unlock the object + Move one level up - - + + + + + 22 + 22 + + - Enable or disable exporting of the object + Move to front - - + + - Lock or unlock the size of the object + Indicates the level the object is on, 1 means the object is at the bottom - + 0 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Y: + + + yposSpin + + + + + + + Vertical position of current basepoint + + + + + + + &W + + + widthSpin + + + + + + + &H + + + heightSpin + + + + + + + Width of current selection + + + + + + + Height of current selection + + + + + + + Lock or unlock the object + + + + + + + + + + + 8 + 43 + + + + ... + + + true + + + + + + @@ -446,11 +307,6 @@ - - NameWidget - QLineEdit -
ui/propertiespalette_utils.h
-
ScrSpinBox QDoubleSpinBox @@ -468,6 +324,21 @@
ui/linkbutton.h
+ + xposSpin + yposSpin + widthSpin + heightSpin + keepFrameWHRatioButton + rotationSpin + flipH + levelBottom + levelDown + levelUp + levelTop + doLock + noResize +