mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 22:55:41 +08:00
Support stylesheets in drop site widget
This commit is contained in:
@@ -442,6 +442,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDockWidget::ps_onStyleSheetsChanged()
|
void CDockWidget::ps_onStyleSheetsChanged()
|
||||||
{
|
{
|
||||||
|
// style sheet changes go here
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDockWidget::forceStyleSheetUpdate()
|
void CDockWidget::forceStyleSheetUpdate()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dropsite.h"
|
#include "dropsite.h"
|
||||||
|
#include "stylesheetutility.h"
|
||||||
#include <QDragEnterEvent>
|
#include <QDragEnterEvent>
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
@@ -20,6 +21,8 @@ namespace BlackGui
|
|||||||
setAlignment(Qt::AlignCenter);
|
setAlignment(Qt::AlignCenter);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
this->setInfoText(tr("<drop content>"));
|
this->setInfoText(tr("<drop content>"));
|
||||||
|
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CDropSite::ps_onStyleSheetsChanged);
|
||||||
|
this->ps_onStyleSheetsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDropSite::setInfoText(const QString &dropSiteText)
|
void CDropSite::setInfoText(const QString &dropSiteText)
|
||||||
@@ -72,4 +75,15 @@ namespace BlackGui
|
|||||||
this->resetText();
|
this->resetText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDropSite::ps_onStyleSheetsChanged()
|
||||||
|
{
|
||||||
|
// style sheet changes go here
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDropSite::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
CStyleSheetUtility::useStyleSheetInDerivedWidget(this, QStyle::PE_FrameDockWidget);
|
||||||
|
QLabel::paintEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -54,6 +54,13 @@ namespace BlackGui
|
|||||||
//! \copydoc QWidget::dropEvent
|
//! \copydoc QWidget::dropEvent
|
||||||
virtual void dropEvent(QDropEvent *event) override;
|
virtual void dropEvent(QDropEvent *event) override;
|
||||||
|
|
||||||
|
//! \copydoc QWidget::paintEvent
|
||||||
|
virtual void paintEvent(QPaintEvent *event) override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
//! Style has been changed
|
||||||
|
void ps_onStyleSheetsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Clear
|
//! Clear
|
||||||
void resetText();
|
void resetText();
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ BlackGui--COverlayMessages {
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlackGui--CDropSite {
|
||||||
|
background: black; /* background is background color here */
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
QTableView[isShowingLoadIndicator="true"] {
|
QTableView[isShowingLoadIndicator="true"] {
|
||||||
background-image: url(:/preloaders/icons/preloaders/FillingRing64.gif);
|
background-image: url(:/preloaders/icons/preloaders/FillingRing64.gif);
|
||||||
|
|||||||
Reference in New Issue
Block a user