|
|
@ -12,6 +12,7 @@ UBLibPalette::UBLibPalette(QWidget *parent, const char *name):UBDockPalette(pare |
|
|
|
, mNavigator(NULL) |
|
|
|
, mNavigator(NULL) |
|
|
|
, mProperties(NULL) |
|
|
|
, mProperties(NULL) |
|
|
|
, mActionBar(NULL) |
|
|
|
, mActionBar(NULL) |
|
|
|
|
|
|
|
, mDropWidget(NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setOrientation(eUBDockOrientation_Right); |
|
|
|
setOrientation(eUBDockOrientation_Right); |
|
|
|
mIcon = QPixmap(":images/paletteLibrary.png"); |
|
|
|
mIcon = QPixmap(":images/paletteLibrary.png"); |
|
|
@ -31,14 +32,17 @@ UBLibPalette::UBLibPalette(QWidget *parent, const char *name):UBDockPalette(pare |
|
|
|
mActionBar = new UBLibActionBar(this); |
|
|
|
mActionBar = new UBLibActionBar(this); |
|
|
|
mNavigator = new UBLibNavigatorWidget(this); |
|
|
|
mNavigator = new UBLibNavigatorWidget(this); |
|
|
|
mProperties = new UBLibItemProperties(this); |
|
|
|
mProperties = new UBLibItemProperties(this); |
|
|
|
|
|
|
|
//mDropWidget = new UBDropMeWidget(this);
|
|
|
|
|
|
|
|
|
|
|
|
mLayout->addWidget(mStackedWidget, 1); |
|
|
|
mLayout->addWidget(mStackedWidget, 1); |
|
|
|
mLayout->addWidget(mActionBar, 0); |
|
|
|
mLayout->addWidget(mActionBar, 0); |
|
|
|
|
|
|
|
|
|
|
|
mStackedWidget->addWidget(mNavigator); |
|
|
|
mStackedWidget->addWidget(mNavigator); |
|
|
|
mStackedWidget->addWidget(mProperties); |
|
|
|
mStackedWidget->addWidget(mProperties); |
|
|
|
|
|
|
|
//mStackedWidget->addWidget(mDropWidget);
|
|
|
|
|
|
|
|
|
|
|
|
mStackedWidget->setCurrentIndex(ID_NAVIGATOR); |
|
|
|
mStackedWidget->setCurrentIndex(ID_NAVIGATOR); |
|
|
|
|
|
|
|
miCrntStackWidget = ID_NAVIGATOR; |
|
|
|
|
|
|
|
|
|
|
|
connect(mNavigator, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(showProperties(UBLibElement*))); |
|
|
|
connect(mNavigator, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(showProperties(UBLibElement*))); |
|
|
|
connect(mProperties, SIGNAL(showFolderContent()), this, SLOT(showFolder())); |
|
|
|
connect(mProperties, SIGNAL(showFolderContent()), this, SLOT(showFolder())); |
|
|
@ -69,6 +73,11 @@ UBLibPalette::~UBLibPalette() |
|
|
|
delete mActionBar; |
|
|
|
delete mActionBar; |
|
|
|
mActionBar = NULL; |
|
|
|
mActionBar = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mDropWidget) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mDropWidget; |
|
|
|
|
|
|
|
mDropWidget = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
if(NULL != mLayout) |
|
|
|
if(NULL != mLayout) |
|
|
|
{ |
|
|
|
{ |
|
|
|
delete mLayout; |
|
|
|
delete mLayout; |
|
|
@ -93,9 +102,16 @@ void UBLibPalette::updateMaxWidth() |
|
|
|
void UBLibPalette::dragEnterEvent(QDragEnterEvent *pEvent) |
|
|
|
void UBLibPalette::dragEnterEvent(QDragEnterEvent *pEvent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setBackgroundRole(QPalette::Highlight); |
|
|
|
setBackgroundRole(QPalette::Highlight); |
|
|
|
|
|
|
|
//mStackedWidget->setCurrentIndex(ID_DROPME);
|
|
|
|
pEvent->acceptProposedAction(); |
|
|
|
pEvent->acceptProposedAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBLibPalette::dragLeaveEvent(QDragLeaveEvent *pEvent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
//mStackedWidget->setCurrentIndex(miCrntStackWidget);
|
|
|
|
|
|
|
|
pEvent->accept(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* \brief Handles the drop event |
|
|
|
* \brief Handles the drop event |
|
|
|
* @param pEvent as the drop event |
|
|
|
* @param pEvent as the drop event |
|
|
@ -104,6 +120,7 @@ void UBLibPalette::dropEvent(QDropEvent *pEvent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
processMimeData(pEvent->mimeData()); |
|
|
|
processMimeData(pEvent->mimeData()); |
|
|
|
setBackgroundRole(QPalette::Dark); |
|
|
|
setBackgroundRole(QPalette::Dark); |
|
|
|
|
|
|
|
mStackedWidget->setCurrentIndex(miCrntStackWidget); |
|
|
|
pEvent->acceptProposedAction(); |
|
|
|
pEvent->acceptProposedAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -128,6 +145,7 @@ void UBLibPalette::processMimeData(const QMimeData *pData) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "Dropped element format " << i << " = "<< qslFormats.at(i); |
|
|
|
qDebug() << "Dropped element format " << i << " = "<< qslFormats.at(i); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// mNavigator->dropMe(pData);
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -151,6 +169,7 @@ void UBLibPalette::showProperties(UBLibElement *elem) |
|
|
|
// Show the properties of this object
|
|
|
|
// Show the properties of this object
|
|
|
|
mProperties->showElement(elem); |
|
|
|
mProperties->showElement(elem); |
|
|
|
mStackedWidget->setCurrentIndex(ID_PROPERTIES); |
|
|
|
mStackedWidget->setCurrentIndex(ID_PROPERTIES); |
|
|
|
|
|
|
|
miCrntStackWidget = ID_PROPERTIES; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -158,6 +177,7 @@ void UBLibPalette::showFolder() |
|
|
|
{ |
|
|
|
{ |
|
|
|
mActionBar->setButtons(mActionBar->previousButtonSet()); |
|
|
|
mActionBar->setButtons(mActionBar->previousButtonSet()); |
|
|
|
mStackedWidget->setCurrentIndex(ID_NAVIGATOR); |
|
|
|
mStackedWidget->setCurrentIndex(ID_NAVIGATOR); |
|
|
|
|
|
|
|
miCrntStackWidget = ID_NAVIGATOR; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBLibPalette::resizeEvent(QResizeEvent *event) |
|
|
|
void UBLibPalette::resizeEvent(QResizeEvent *event) |
|
|
@ -165,3 +185,30 @@ void UBLibPalette::resizeEvent(QResizeEvent *event) |
|
|
|
UBDockPalette::resizeEvent(event); |
|
|
|
UBDockPalette::resizeEvent(event); |
|
|
|
UBSettings::settings()->libPaletteWidth->set(width()); |
|
|
|
UBSettings::settings()->libPaletteWidth->set(width()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
UBDropMeWidget::UBDropMeWidget(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
|
|
|
|
, mpLabel(NULL) |
|
|
|
|
|
|
|
, mpLayout(NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
mpLayout = new QVBoxLayout(this); |
|
|
|
|
|
|
|
setLayout(mpLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpLabel = new QLabel(tr("Drop here"), this); |
|
|
|
|
|
|
|
mpLayout->addWidget(mpLabel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBDropMeWidget::~UBDropMeWidget() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(NULL != mpLabel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mpLabel; |
|
|
|
|
|
|
|
mpLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpLayout) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mpLayout; |
|
|
|
|
|
|
|
mpLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|