|
|
@ -144,7 +144,7 @@ void DelegateButton::startShowProgress() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent, bool respectRatio, bool canRotate, bool useToolBar) |
|
|
|
UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent, bool respectRatio, bool canRotate, bool useToolBar, bool showGoContentButton) |
|
|
|
: QObject(parent) |
|
|
|
: QObject(parent) |
|
|
|
, mDelegated(pDelegated) |
|
|
|
, mDelegated(pDelegated) |
|
|
|
, mDeleteButton(NULL) |
|
|
|
, mDeleteButton(NULL) |
|
|
@ -164,6 +164,7 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec |
|
|
|
, mMimeData(NULL) |
|
|
|
, mMimeData(NULL) |
|
|
|
, mFlippable(false) |
|
|
|
, mFlippable(false) |
|
|
|
, mToolBarUsed(useToolBar) |
|
|
|
, mToolBarUsed(useToolBar) |
|
|
|
|
|
|
|
, mShowGoContentButton(showGoContentButton) |
|
|
|
{ |
|
|
|
{ |
|
|
|
connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged())); |
|
|
|
connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged())); |
|
|
|
} |
|
|
|
} |
|
|
@ -189,6 +190,13 @@ void UBGraphicsItemDelegate::init() |
|
|
|
connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu())); |
|
|
|
connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu())); |
|
|
|
mButtons << mMenuButton; |
|
|
|
mButtons << mMenuButton; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mShowGoContentButton) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mContentSourceButton = new DelegateButton(":/images/home.svg", mDelegated, mFrame, Qt::TopLeftSection); |
|
|
|
|
|
|
|
connect(mContentSourceButton, SIGNAL(clicked()), this, SLOT(gotoContentSource())); |
|
|
|
|
|
|
|
mButtons << mContentSourceButton; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mZOrderUpButton = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection); |
|
|
|
mZOrderUpButton = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection); |
|
|
|
mZOrderUpButton->setShowProgressIndicator(true); |
|
|
|
mZOrderUpButton->setShowProgressIndicator(true); |
|
|
|
connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp())); |
|
|
|
connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp())); |
|
|
@ -550,10 +558,8 @@ void UBGraphicsItemDelegate::showHide(bool show) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsItemDelegate::gotoContentSource(bool checked) |
|
|
|
void UBGraphicsItemDelegate::gotoContentSource() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_UNUSED(checked) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBItem* item = dynamic_cast<UBItem*>(mDelegated); |
|
|
|
UBItem* item = dynamic_cast<UBItem*>(mDelegated); |
|
|
|
|
|
|
|
|
|
|
|
if(item && !item->sourceUrl().isEmpty()) |
|
|
|
if(item && !item->sourceUrl().isEmpty()) |
|
|
@ -624,13 +630,6 @@ void UBGraphicsItemDelegate::decorateMenu(QMenu* menu) |
|
|
|
showIcon.addPixmap(QPixmap(":/images/eyeOpened.svg"), QIcon::Normal, QIcon::On); |
|
|
|
showIcon.addPixmap(QPixmap(":/images/eyeOpened.svg"), QIcon::Normal, QIcon::On); |
|
|
|
showIcon.addPixmap(QPixmap(":/images/eyeClosed.svg"), QIcon::Normal, QIcon::Off); |
|
|
|
showIcon.addPixmap(QPixmap(":/images/eyeClosed.svg"), QIcon::Normal, QIcon::Off); |
|
|
|
mShowOnDisplayAction->setIcon(showIcon); |
|
|
|
mShowOnDisplayAction->setIcon(showIcon); |
|
|
|
|
|
|
|
|
|
|
|
mGotoContentSourceAction = menu->addAction(tr("Go to Content Source"), this, SLOT(gotoContentSource(bool))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QIcon sourceIcon; |
|
|
|
|
|
|
|
sourceIcon.addPixmap(QPixmap(":/images/toolbar/internet.png"), QIcon::Normal, QIcon::On); |
|
|
|
|
|
|
|
mGotoContentSourceAction->setIcon(sourceIcon); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsItemDelegate::updateMenuActionState() |
|
|
|
void UBGraphicsItemDelegate::updateMenuActionState() |
|
|
|