Clear up AbstractDockItem

This commit is contained in:
杨万青 2015-07-02 16:15:45 +08:00
parent 3ee411c038
commit 15011129c1
4 changed files with 5 additions and 30 deletions

View File

@ -55,9 +55,11 @@ private:
private:
DockModeData *dockCons = DockModeData::getInstants();
AppBackground * appBackground = NULL;
QPoint nextPos;
QLabel * m_appIcon = NULL;
bool m_isCurrentOpened = false;
QString m_itemTitle = "";
QString m_itemIconPath = "";
};
#endif // APPITEM_H

View File

@ -40,11 +40,6 @@ void DockLayout::moveItem(int from, int to)
relayout();
}
void DockLayout::setItemMoveable(int index, bool moveable)
{
appList.at(index)->setMoveable(moveable);
}
void DockLayout::setSpacing(qreal spacing)
{
this->itemSpacing = spacing;

View File

@ -23,7 +23,6 @@ public:
void insertItem(AbstractDockItem *item, int index);
void removeItem(int index);
void moveItem(int from, int to);
void setItemMoveable(int index, bool moveable);
void setSpacing(qreal spacing);
void setSortDirection(DockLayout::Direction value);
int indexOf(AbstractDockItem * item);

View File

@ -16,22 +16,8 @@ public:
virtual QWidget * getContents() { return NULL; }
virtual void setTitle(const QString &title) { m_itemTitle = title; }
virtual void setIcon(const QString &iconPath, int size = 42) {
m_appIcon = new AppIcon(iconPath, this);
m_appIcon->resize(size, size);
m_appIcon->move((width() - m_appIcon->width()) / 2,
(height() - m_appIcon->height()) / 2);
}
virtual void setMoveable(bool value) { m_itemMoveable = value; }
virtual bool moveable() { return m_itemMoveable; }
virtual void setActived(bool value) { m_isActived = value; }
virtual bool moveable() { return m_moveable; }
virtual bool actived() { return m_isActived; }
virtual void setHovered(bool value) { m_isHovered = value; }
virtual bool hovered() { return m_isHovered; }
virtual void setIndex(int value) { m_itemIndex = value; }
virtual int index() { return m_itemIndex; }
void resize(int width,int height){
QFrame::resize(width,height);
@ -59,18 +45,11 @@ signals:
void widthChanged();
protected:
QLabel * m_appIcon = NULL;
bool m_itemMoveable = true;
bool m_moveable = true;
bool m_isActived = false;
bool m_isHovered = false;
QString m_itemTitle = "";
QString m_itemIconPath = "";
QPoint m_itemNextPos;
int m_itemIndex = 0;
};
#endif // ABSTRACTDOCKITEM_H