plugin/versionUpdate: 添加在 Windows 下的插件 icon 图标资源

This commit is contained in:
zinface 2023-03-26 20:21:46 +08:00
parent d7d44985a6
commit 93a6b86cd0
5 changed files with 11 additions and 2 deletions

View File

@ -19,7 +19,7 @@ if(TRUE)
.
StatusWidget
)
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources} "plugin.qrc")
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/cceditor

View File

@ -73,7 +73,7 @@ void StatusWidget::initializeIcon()
void StatusWidget::setIcon(QPixmap iconPixmap)
{
ui->icon->setPixmap(iconPixmap);
ui->icon->setPixmap(iconPixmap.scaled(ui->icon->size()));
}
QPixmap StatusWidget::getIcon() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -23,7 +23,11 @@ NddPluginImplement::NddPluginImplement(QWidget *parent, QsciScintilla *pEdit) :
statusWidget->setDirection(StatusWidget::TopIn, StatusWidget::RightOut);
statusWidget->start(false);
statusWidget->show();
#ifdef Q_OS_WIN
statusWidget->setIcon(QPixmap("://assets/5.png"));
#else
statusWidget->setIcon(QIcon::fromTheme("notepad--").pixmap(32,32));
#endif
statusWidget->setStyleSheet("border-radius: 8px");
QNetworkAccessManager manager;
QEventLoop loop;

View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>assets/5.png</file>
</qresource>
</RCC>