mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
modify tips
Change-Id: I4ba2733a45c2c9abcb15309616f1166b0af9ddb4
This commit is contained in:
parent
352a7cc426
commit
b4b28d499a
@ -20,7 +20,10 @@ DockItem::DockItem(const ItemType type, QWidget *parent)
|
||||
m_menuManagerInter(new DBusMenuManager(this))
|
||||
{
|
||||
if (!PopupTips.get())
|
||||
PopupTips.reset(new DArrowRectangle(DArrowRectangle::ArrowBottom, nullptr));
|
||||
{
|
||||
DArrowRectangle *arrowRectangle = new DArrowRectangle(DArrowRectangle::ArrowBottom, nullptr);
|
||||
PopupTips.reset(arrowRectangle);
|
||||
}
|
||||
|
||||
m_popupTipsDelayTimer->setInterval(200);
|
||||
m_popupTipsDelayTimer->setSingleShot(true);
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
signals:
|
||||
void dragStarted() const;
|
||||
void menuUnregistered() const;
|
||||
void requestWindowAutoHide(const bool autoHide) const;
|
||||
void requestPopupApplet(const QPoint &p, const QWidget *w) const;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
|
@ -22,13 +22,17 @@ PluginsItem::PluginsItem(PluginsItemInterface* const pluginInter, const QString
|
||||
{
|
||||
m_pluginType = pluginInter->pluginType(itemKey);
|
||||
|
||||
m_simpleTips->setVisible(false);
|
||||
m_simpleTips->setAlignment(Qt::AlignCenter);
|
||||
m_simpleTips->setStyleSheet("QLabel {"
|
||||
"color:white;"
|
||||
"padding:5px 10px;"
|
||||
"font-size:14px;"
|
||||
"}");
|
||||
|
||||
if (m_pluginType == PluginsItemInterface::Simple)
|
||||
return;
|
||||
|
||||
m_simpleTips->setAlignment(Qt::AlignCenter);
|
||||
m_simpleTips->setStyleSheet("color:white;"
|
||||
"font-size:12px;");
|
||||
|
||||
// construct complex widget layout
|
||||
QWidget *centeralWidget = m_pluginInter->itemWidget(itemKey);
|
||||
Q_ASSERT(centeralWidget);
|
||||
@ -148,6 +152,7 @@ QWidget *PluginsItem::popupTips()
|
||||
return nullptr;
|
||||
|
||||
m_simpleTips->setText(tips);
|
||||
|
||||
return m_simpleTips;
|
||||
}
|
||||
|
||||
@ -179,12 +184,12 @@ void PluginsItem::startDrag()
|
||||
void PluginsItem::mouseClicked()
|
||||
{
|
||||
const QString command = m_pluginInter->itemCommand(m_itemKey);
|
||||
if (command.isEmpty())
|
||||
return;
|
||||
if (!command.isEmpty())
|
||||
{
|
||||
QProcess *proc = new QProcess(this);
|
||||
|
||||
QProcess *proc = new QProcess(this);
|
||||
connect(proc, static_cast<void (QProcess::*)(int)>(&QProcess::finished), proc, &QProcess::deleteLater);
|
||||
|
||||
connect(proc, static_cast<void (QProcess::*)(int)>(&QProcess::finished), proc, &QProcess::deleteLater);
|
||||
|
||||
proc->startDetached(command);
|
||||
proc->startDetached(command);
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +165,6 @@ void MainPanel::initItemConnection(DockItem *item)
|
||||
{
|
||||
connect(item, &DockItem::dragStarted, this, &MainPanel::itemDragStarted);
|
||||
connect(item, &DockItem::menuUnregistered, this, &MainPanel::requestRefershWindowVisible);
|
||||
connect(item, &DockItem::requestWindowAutoHide, this, &MainPanel::requestWindowAutoHide);
|
||||
}
|
||||
|
||||
DockItem *MainPanel::itemAt(const QPoint &point)
|
||||
|
@ -29,7 +29,6 @@ public:
|
||||
|
||||
signals:
|
||||
void requestRefershWindowVisible() const;
|
||||
void requestWindowAutoHide(const bool autoHide) const;
|
||||
|
||||
private:
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
@ -125,7 +125,6 @@ void MainWindow::initConnections()
|
||||
connect(m_settings, &DockSettings::autoHideChanged, this, &MainWindow::updatePanelVisible);
|
||||
|
||||
connect(m_mainPanel, &MainPanel::requestRefershWindowVisible, this, &MainWindow::updatePanelVisible, Qt::QueuedConnection);
|
||||
connect(m_mainPanel, &MainPanel::requestWindowAutoHide, m_settings, &DockSettings::setAutoHide);
|
||||
|
||||
connect(m_positionUpdateTimer, &QTimer::timeout, this, &MainWindow::updatePosition, Qt::QueuedConnection);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user