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