Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tmp blocked uosai plugin in quickpanel #976

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions frame/window/quickpluginwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <QGuiApplication>
#include <QMenu>
#include <QDragLeaveEvent>
#include <algorithm>
#include <QSize>

#define ITEMSIZE 22
#define STARTSPACE 6
Expand Down Expand Up @@ -707,7 +709,9 @@ void QuickDockItem::setPosition(Dock::Position position)
if (m_mainLayout) {
QWidget *itemWidget = m_pluginItem->itemWidget(m_itemKey);
if (itemWidget && m_mainLayout->indexOf(itemWidget) < 0) {
itemWidget->setFixedSize(suitableSize());
auto size= suitableSize();
auto minSize = std::min(size.height(), size.width());
itemWidget->setFixedSize(QSize(minSize, minSize));
}
}
}
Expand Down Expand Up @@ -877,7 +881,9 @@ void QuickDockItem::showEvent(QShowEvent *event)
QWidget *itemWidget = m_pluginItem->itemWidget(m_itemKey);
if (itemWidget && m_mainLayout->indexOf(itemWidget) < 0) {
itemWidget->show();
itemWidget->setFixedSize(suitableSize());
auto size= suitableSize();
auto minSize = std::min(size.height(), size.width());
itemWidget->setFixedSize(QSize(minSize, minSize));
m_mainLayout->addWidget(itemWidget);
}
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/pluginmanager/quicksettingitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <QPushButton>
#include <QFontMetrics>
#include <QPainter>
#include <QStringLiteral>

#define ICONWIDTH 24
#define ICONHEIGHT 24
Expand Down Expand Up @@ -115,6 +116,7 @@ QColor QuickSettingItem::foregroundColor() const

QuickSettingItem *QuickSettingFactory::createQuickWidget(PluginsItemInterface * const pluginInter, const QString &itemKey)
{
if (pluginInter->pluginName() == QStringLiteral("uosai")) return nullptr;
// 如果显示在面板的图标或者Widget为空,则不让显示(例如电池插件)
if (!(pluginInter->flags() & PluginFlag::Type_Common))
return nullptr;
Expand Down
Loading