mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fixed(tray):method and signal to tray item count
This commit is contained in:
parent
357b141594
commit
b616162d69
@ -179,10 +179,7 @@ bool AbstractContainer::isEmpty()
|
||||
|
||||
int AbstractContainer::itemCount()
|
||||
{
|
||||
if(expand())
|
||||
return m_wrapperList.count();
|
||||
else
|
||||
return 0;
|
||||
return m_wrapperList.count();
|
||||
}
|
||||
|
||||
bool AbstractContainer::containsWrapper(FashionTrayWidgetWrapper *wrapper)
|
||||
|
@ -23,12 +23,12 @@ public:
|
||||
virtual void setDockPosition(const Dock::Position pos);
|
||||
virtual void setExpand(const bool expand);
|
||||
virtual QSize totalSize() const;
|
||||
virtual int itemCount();
|
||||
// QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||
|
||||
void clearWrapper();
|
||||
void saveCurrentOrderToConfig();
|
||||
bool isEmpty();
|
||||
int itemCount();
|
||||
bool containsWrapper(FashionTrayWidgetWrapper *wrapper);
|
||||
bool containsWrapperByTrayWidget(AbstractTrayWidget *trayWidget);
|
||||
FashionTrayWidgetWrapper *wrapperByTrayWidget(AbstractTrayWidget *trayWidget);
|
||||
|
@ -118,6 +118,14 @@ void NormalContainer::adjustMaxSize(const QSize size)
|
||||
}
|
||||
}
|
||||
|
||||
int NormalContainer::itemCount()
|
||||
{
|
||||
if(expand())
|
||||
return AbstractContainer::itemCount();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NormalContainer::setExpand(const bool expand)
|
||||
{
|
||||
for (auto w : wrapperList()) {
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
void addWrapper(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
void refreshVisible() Q_DECL_OVERRIDE;
|
||||
void setExpand(const bool expand) Q_DECL_OVERRIDE;
|
||||
int itemCount() override;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
protected:
|
||||
@ -30,6 +31,7 @@ private:
|
||||
|
||||
private:
|
||||
mutable QVariantAnimation *m_sizeAnimation;
|
||||
|
||||
};
|
||||
|
||||
#endif // NORMALCONTAINER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user