mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
changed dbus interface
Change-Id: Ic8a42e2574aaa766ffc5200e75a3a4ebc561d429
This commit is contained in:
parent
dc07ffba04
commit
a5e99b83f8
@ -88,9 +88,9 @@ public Q_SLOTS: // METHODS
|
||||
}
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void TitlesChanged(const quint32 xid, const QString &title);
|
||||
// begin property changed signals
|
||||
void ActiveChanged();
|
||||
void TitlesChanged();
|
||||
void DataChanged();
|
||||
void IdChanged();
|
||||
void TitleChanged();
|
||||
|
@ -22,9 +22,8 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent)
|
||||
|
||||
m_titles = m_itemEntry->titles();
|
||||
m_id = m_itemEntry->id();
|
||||
qDebug() << m_titles;
|
||||
|
||||
connect(m_itemEntry,&DBusDockEntry::TitlesChanged, this, &AppItem::entryDataChanged);
|
||||
connect(m_itemEntry, &DBusDockEntry::TitlesChanged, this, &AppItem::titlesChanged);
|
||||
connect(m_itemEntry, &DBusDockEntry::ActiveChanged, this, static_cast<void (AppItem::*)()>(&AppItem::update));
|
||||
}
|
||||
|
||||
@ -51,24 +50,11 @@ void AppItem::paintEvent(QPaintEvent *e)
|
||||
QPainter painter(this);
|
||||
|
||||
if (m_itemEntry->active())
|
||||
{
|
||||
painter.fillRect(rect(), Qt::blue);
|
||||
} else {
|
||||
else if (!m_titles.isEmpty())
|
||||
painter.fillRect(rect(), Qt::cyan);
|
||||
else
|
||||
painter.fillRect(rect(), Qt::gray);
|
||||
}
|
||||
|
||||
// // draw current active background
|
||||
// if (m_windows.contains(ActiveWindowId))
|
||||
// {
|
||||
// painter.fillRect(rect(), Qt::blue);
|
||||
// } else if (m_data[APP_STATUS_KEY] == APP_ACTIVE_STATUS)
|
||||
// {
|
||||
// // draw active background
|
||||
// painter.fillRect(rect(), Qt::cyan);
|
||||
// } else {
|
||||
// // draw normal background
|
||||
// painter.fillRect(rect(), Qt::gray);
|
||||
// }
|
||||
|
||||
// draw icon
|
||||
painter.fillRect(iconRect, Qt::yellow);
|
||||
@ -136,7 +122,9 @@ void AppItem::initClientManager()
|
||||
// });
|
||||
}
|
||||
|
||||
void AppItem::entryDataChanged(const quint32 xid, const QString &title)
|
||||
void AppItem::titlesChanged()
|
||||
{
|
||||
qDebug() << "title changed: " << xid << title;
|
||||
m_titles = m_itemEntry->titles();
|
||||
|
||||
update();
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ private:
|
||||
|
||||
void startDrag();
|
||||
void initClientManager();
|
||||
void entryDataChanged(const quint32 xid, const QString &title);
|
||||
void titlesChanged();
|
||||
|
||||
private:
|
||||
DBusDockEntry *m_itemEntry;
|
||||
|
@ -9,6 +9,9 @@ MainPanel::MainPanel(QWidget *parent)
|
||||
|
||||
m_itemController(DockItemController::instance(this))
|
||||
{
|
||||
m_itemLayout->setSpacing(0);
|
||||
m_itemLayout->setContentsMargins(5, 5, 5, 5);
|
||||
|
||||
setAcceptDrops(true);
|
||||
setObjectName("MainPanel");
|
||||
setStyleSheet("QWidget #MainPanel {"
|
||||
|
@ -13,7 +13,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
m_positionUpdateTimer(new QTimer(this))
|
||||
{
|
||||
setWindowFlags(Qt::X11BypassWindowManagerHint);
|
||||
setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowDoesNotAcceptFocus);
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
||||
initComponents();
|
||||
|
Loading…
x
Reference in New Issue
Block a user