Skip to content
Open
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
1 change: 1 addition & 0 deletions src/CommonUseWidget/fullcommonusewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ void FullCommonUseWidget::repaintWidget()
{
this->setFixedSize(Style::MainViewWidWidth,
Style::AppListWidHeight);
m_scrollArea->setFixedSize(Style::AppListWidWidth,this->height());
m_scrollAreaWidLayout->removeWidget(m_listView);
m_listView->setParent(nullptr);
delete m_listView;
Expand Down
16 changes: 0 additions & 16 deletions src/MainWindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,13 @@ void MainWindow::initUi()
connect(gsetting,&QGSettings::changed,
this,&MainWindow::panelChangedSlot);
}

// QDBusConnection::sessionBus().connect("com.ukui.menu","/com/ukui/menu","local.test.MainWindow",
// QString("sendStartMenuSignal"),this,SLOT(recvStartMenuSlot()));
}

void MainWindow::paintEvent(QPaintEvent *event)
{
double transparency=getTransparency();

QRect rect = this->rect();
// rect.setWidth(this->rect().width());
// rect.setHeight(this->rect().height());
// rect.setX(this->rect().x());
// rect.setY(this->rect().y());
// rect.setWidth(this->rect().width());
// rect.setHeight(this->rect().height());
QPainterPath path;

QPainter painter(this);
Expand All @@ -183,16 +174,10 @@ void MainWindow::paintEvent(QPaintEvent *event)
painter.setPen(Qt::transparent);
painter.setOpacity(transparency);
painter.drawPath(path);

// setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
else//全屏固定背景色(黑底白字)
{
// QGSettings gsetting(QString("org.mate.background").toLocal8Bit());
// QString iconPath =gsetting.get("picture-filename").toString();
// painter.drawPixmap(0,0,this->width(),this->height(),QPixmap(iconPath));

if(QGSettings::isSchemaInstalled(QString("org.ukui.control-center.personalise").toLocal8Bit()))
{
QGSettings gsetting(QString("org.ukui.control-center.personalise").toLocal8Bit());
Expand Down Expand Up @@ -231,7 +216,6 @@ void MainWindow::paintEvent(QPaintEvent *event)

QPainterPath path;
path.addRect(this->rect());
// setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
}
QMainWindow::paintEvent(event);
Expand Down
4 changes: 0 additions & 4 deletions src/UtilityFunction/fullitemdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
painter->setRenderHint(QPainter::Antialiasing);
if(option.state & QStyle::State_MouseOver)
{
// QColor color = option.palette.text().color();
// color.setAlphaF(0.15);
painter->save();
painter->setPen(QPen(Qt::NoPen));
painter->setBrush(Qt::white);
Expand Down Expand Up @@ -181,11 +179,9 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
painter->restore();

painter->save();
// painter->setPen(QPen(option.palette.text().color()));
painter->setPen(QPen(Qt::white));
painter->setBrush(Qt::NoBrush);
painter->drawText(textRect,Qt::AlignHCenter |Qt::AlignTop,appnameElidedText);
// painter->drawText(textRect,Qt::TextWordWrap |Qt::AlignHCenter,appname);
painter->restore();

if(option.state & QStyle::State_MouseOver)
Expand Down
18 changes: 1 addition & 17 deletions src/UtilityFunction/fulllistview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ void FullListView::initWidget()
viewport()->setAttribute(Qt::WA_TranslucentBackground);
this->setSelectionMode(QAbstractItemView::SingleSelection);
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
// if(module==1 || module==2)s
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->setViewMode(QListView::IconMode);
this->setContextMenuPolicy(Qt::CustomContextMenu);
this->setResizeMode(QListView::Adjust);
Expand Down Expand Up @@ -203,18 +202,3 @@ void FullListView::paintEvent(QPaintEvent *e)
}
QListView::paintEvent(e);
}

//void FullListView::mousePressEvent(QMouseEvent *event)
//{
// if(!(this->indexAt(event->pos()).isValid()) && event->button()==Qt::LeftButton)
// Q_EMIT sendHideMainWindowSignal();
// else{
// if(event->button()==Qt::LeftButton)
// Q_EMIT clicked(this->indexAt(event->pos()));
// if(event->button()==Qt::RightButton)
// {
// this->selectionModel()->setCurrentIndex(this->indexAt(event->pos()),QItemSelectionModel::SelectCurrent);
// Q_EMIT customContextMenuRequested(event->pos());
// }
// }
//}
14 changes: 0 additions & 14 deletions src/UtilityFunction/functionclassifybutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ void FunctionClassifyButton::paintEvent(QPaintEvent* e)
{
painter.save();
painter.setPen(Qt::NoPen);
// QColor color = option.palette.color(QPalette::Text);
// color.setAlphaF(0.15);
// painter.setBrush(color);
painter.setOpacity(0.15);
painter.setBrush(Qt::white);
painter.drawRoundedRect(option.rect, 4, 4);
Expand Down Expand Up @@ -234,30 +231,19 @@ void FunctionClassifyButton::updateIconState(const FunctionClassifyButton::State

void FunctionClassifyButton::updateTextState(const FunctionClassifyButton::State state)
{
// QPalette p= m_textLabel->palette();
switch (state)
{
case Enabled:
// p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1));
// m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255);");
break;
case Disabled:
// p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.25));
// m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 25%);");
break;
case Normal:
// p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.50));
// m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 50%);");
break;
case Checked:
// p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1));
// m_textLabel->setStyleSheet("background:transparent;color:rgba(255, 255, 255);");
break;
default:
break;
}
// p.setColor(QPalette::Window,Qt::transparent);
// m_textLabel->setPalette(p);
}

void FunctionClassifyButton::setLabelText()
Expand Down
4 changes: 4 additions & 0 deletions src/UtilityFunction/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#define UTILITY_H

#include <QtCore>
#define DBUS_NAME "org.ukui.panel"
#define DBUS_PATH "/panel/position"
#define DBUS_INTERFACE "org.ukui.panel"


const QPixmap loadSvg(const QString &fileName, const int size);

Expand Down