!50 fix 137164 131083
Merge pull request !50 from limeiqi/openkylin/yangtze
This commit is contained in:
commit
d1a96c0538
|
@ -8,7 +8,7 @@
|
|||
#include <KWindowEffects>
|
||||
#include "UI/globalsignal.h"
|
||||
#include "UIControl/global/global.h"
|
||||
|
||||
#include "UI/globalsignal.h"
|
||||
|
||||
#include <ukui-log4qt.h>
|
||||
|
||||
|
@ -1058,6 +1058,7 @@ void Widget::mousePressEvent(QMouseEvent *event)
|
|||
|
||||
void Widget::slotShowMiniWidget()
|
||||
{
|
||||
g_user_signal->hideSearchResult();
|
||||
// 添加过渡动画
|
||||
QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity");
|
||||
animation->setDuration(200);
|
||||
|
@ -1086,6 +1087,13 @@ void Widget::slotShowMiniWidget()
|
|||
|
||||
m_miniWidget->setWindowOpacity(0);
|
||||
m_miniWidget->showNormal();
|
||||
|
||||
if (Global::isWayland) {
|
||||
int sw = QGuiApplication::primaryScreen()->availableGeometry().width();
|
||||
int sh = QGuiApplication::primaryScreen()->availableGeometry().height();
|
||||
kdk::WindowManager::setGeometry(m_miniWidget->windowHandle(), QRect((sw-m_miniWidget->width())/2, (sh-m_miniWidget->height())/2, m_miniWidget->width(),m_miniWidget->height() ));
|
||||
}
|
||||
|
||||
m_miniWidget->activateWindow();
|
||||
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
animation_mini->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
|
@ -1121,6 +1129,7 @@ void Widget::slotShowMinimized()
|
|||
|
||||
void Widget::slotShowMaximized()
|
||||
{
|
||||
g_user_signal->hideSearchResult();
|
||||
if (Global::isWayland) {
|
||||
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||
kdk::UkuiStyleHelper::self()->removeHeader(m_miniWidget);
|
||||
|
@ -1233,6 +1242,12 @@ void Widget::slotRecoverNormalWidget()
|
|||
this->showMaximized();
|
||||
} else {
|
||||
this->showNormal();
|
||||
if (Global::isWayland) {
|
||||
int sw = QGuiApplication::primaryScreen()->availableGeometry().width();
|
||||
int sh = QGuiApplication::primaryScreen()->availableGeometry().height();
|
||||
resize(960,640);
|
||||
kdk::WindowManager::setGeometry(this->windowHandle(), QRect((sw-this->width())/2, (sh-this->height())/2, this->width(),this->height() ));
|
||||
}
|
||||
}
|
||||
m_miniWidget->hide();
|
||||
}
|
||||
|
|
|
@ -308,6 +308,10 @@ void miniWidget::minicolor()
|
|||
|
||||
void miniWidget::init_miniWidget()
|
||||
{
|
||||
//窗体显示在中间
|
||||
QRect availableGeometry = qApp->primaryScreen()->availableGeometry();
|
||||
this->move((availableGeometry.width() - this->width())/2, (availableGeometry.height() - this->height())/2);
|
||||
|
||||
this->setAutoFillBackground(true);
|
||||
this->setBackgroundRole(QPalette::Base);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void SearchEdit::keyPressEvent(QKeyEvent *event)
|
|||
void SearchEdit::focusInEvent(QFocusEvent *event)
|
||||
{
|
||||
this->setFocus();
|
||||
|
||||
slotTextChanged();
|
||||
return QLineEdit::focusInEvent(event);
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ void SearchEdit::setWidget(QWidget *mainWidget)
|
|||
void SearchEdit::moveSearchResult()
|
||||
{
|
||||
m_result->show();
|
||||
m_result->raise();
|
||||
// m_result->raise();
|
||||
m_result->setFixedWidth(240);
|
||||
|
||||
QPoint resultPos = this->mapToGlobal(this->rect().bottomLeft());
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "ukuistylehelper/ukuistylehelper.h"
|
||||
#include "windowmanager/windowmanager.h"
|
||||
#include "UIControl/global/global.h"
|
||||
#include "UI/globalsignal.h"
|
||||
|
||||
SearchResult::SearchResult(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
@ -102,11 +103,14 @@ SearchResult::SearchResult(QWidget *parent) : QWidget(parent)
|
|||
sideLayout->setSpacing(0);
|
||||
this->setLayout(sideLayout);
|
||||
|
||||
// autoResize();
|
||||
autoResize();
|
||||
|
||||
connect(m_MusicView,&MusicSearchListview::clicked,this,&SearchResult::slotMusicItemClicked);
|
||||
connect(m_SingerView,&MusicSearchListview::clicked,this,&SearchResult::slotSingerItemClicked);
|
||||
connect(m_AlbumView,&MusicSearchListview::clicked,this,&SearchResult::slotAlbumItemClicked);
|
||||
connect(g_user_signal, &GlobalUserSignal::sigHideSearchResult, [this]{
|
||||
this->hide();
|
||||
});
|
||||
}
|
||||
|
||||
SearchResult::~SearchResult()
|
||||
|
@ -123,7 +127,7 @@ void SearchResult::keyPressEvent(QKeyEvent *event)
|
|||
// kdk::WindowManager::activateWindow(m_searchEdit->winId());
|
||||
|
||||
} else {
|
||||
m_searchEdit->activateWindow();
|
||||
// m_searchEdit->activateWindow();
|
||||
}
|
||||
// QApplication::sendEvent(m_searchEdit,event);
|
||||
|
||||
|
@ -214,12 +218,12 @@ void SearchResult::autoResize()
|
|||
if (m_searchEdit != nullptr) {
|
||||
if (m_searchEdit->text() != "") {
|
||||
this->show();
|
||||
this->raise();
|
||||
// this->raise();
|
||||
|
||||
if (Global::isWayland) {
|
||||
// kdk::WindowManager::activateWindow(kdk::WindowManager::currentActiveWindow());
|
||||
} else {
|
||||
this->activateWindow();
|
||||
// this->activateWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "UI/base/widgetstyle.h"
|
||||
#include "UI/mainwidget.h"
|
||||
#include <ukui-log4qt.h>
|
||||
#include "UI/globalsignal.h"
|
||||
|
||||
SideBarWidget::SideBarWidget(QWidget *parent) : LeftsiderbarWidget(parent)
|
||||
{
|
||||
|
@ -485,3 +486,9 @@ void SideBarWidget::slotSongListHigh()
|
|||
playListBtn->buttonListName = ALLMUSIC;
|
||||
playListBtn->defaultStyle();
|
||||
}
|
||||
|
||||
void SideBarWidget::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
g_user_signal->hideSearchResult();
|
||||
QWidget::mousePressEvent(event);
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@ public Q_SLOTS:
|
|||
void slotListSearch();
|
||||
//高亮歌曲列表按钮
|
||||
void slotSongListHigh();
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
|
||||
Q_SIGNALS:
|
||||
void playListBtnCliced(QString listname);
|
||||
void playListRemoved(QString listname);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#include "tablebaseview.h"
|
||||
#include "UI/base/widgetstyle.h"
|
||||
#include "UI/globalsignal.h"
|
||||
|
||||
TableBaseView::TableBaseView(QTableView *parent)
|
||||
{
|
||||
|
@ -63,6 +64,14 @@ void TableBaseView::mouseMoveEvent(QMouseEvent *event)
|
|||
QModelIndex index = this->indexAt(event->pos());
|
||||
Q_EMIT hoverIndexChanged(index);
|
||||
}
|
||||
|
||||
void TableBaseView::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
g_user_signal->hideSearchResult();
|
||||
|
||||
QWidget::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void TableBaseView::leaveEvent(QEvent *event)
|
||||
{
|
||||
Q_EMIT leaveFromItem();
|
||||
|
|
|
@ -27,6 +27,7 @@ public Q_SLOTS:
|
|||
void setNowPlayListName(QString listName);
|
||||
protected:
|
||||
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
Q_SIGNALS:
|
||||
void hoverIndexChanged(QModelIndex index);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "tableone.h"
|
||||
#include "UI/mainwidget.h"
|
||||
#include "UI/base/widgetstyle.h"
|
||||
#include "UI/globalsignal.h"
|
||||
|
||||
#define PT_18 18
|
||||
|
||||
|
@ -1336,6 +1337,14 @@ void TableOne::mouseMoveEvent(QMouseEvent *event)
|
|||
Q_EMIT hoverIndexChanged(index);
|
||||
}
|
||||
|
||||
|
||||
void TableOne::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
g_user_signal->hideSearchResult();
|
||||
|
||||
QWidget::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void TableOne::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
// 使用变量保存tableView一页最多可以完全显示多少条目,实时刷新,实现滑动条的显示和隐藏
|
||||
|
|
|
@ -144,6 +144,7 @@ protected:
|
|||
void dragEnterEvent(QDragEnterEvent *event)Q_DECL_OVERRIDE;
|
||||
void dropEvent(QDropEvent *event)Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *event)Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *event)Q_DECL_OVERRIDE;
|
||||
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
||||
private:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "titlebar.h"
|
||||
#include "UI/mainwidget.h"
|
||||
#include "UI/base/xatom-helper.h"
|
||||
#include "UI/globalsignal.h"
|
||||
|
||||
TitleBar::TitleBar(QWidget *parent) : QFrame(parent)
|
||||
{
|
||||
|
@ -228,8 +229,12 @@ bool TitleBar::eventFilter(QObject *watched, QEvent *event)
|
|||
if (mouseEvent->button() == Qt::LeftButton) //判断左键
|
||||
{
|
||||
Widget::mutual->slotShowMaximized();
|
||||
g_user_signal->hideSearchResult();
|
||||
}
|
||||
}
|
||||
if (event->type() == QEvent::MouseButtonPress) {
|
||||
g_user_signal->hideSearchResult();
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::eventFilter(watched,event);
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
kylin-music (1.1.0.47-ok7.1) yangtze; urgency=medium
|
||||
|
||||
* BUG: #137164 【wayland】【音乐】迷你/正常模式切换,切换后位置不断变化,不能固定在一个位置显示;
|
||||
#131083 【wayland】【音乐】在搜索框输入歌曲名,点击除搜索结果框外的其他位置,搜索结果列表不消失;
|
||||
* 任务号:无
|
||||
* 需求号:无
|
||||
* 其他改动说明:无
|
||||
* 其他改动影响域:无
|
||||
|
||||
-- limeiqi <limeiqi@kylinos.cn> Fri, 03 Nov 2023 18:51:35 +0800
|
||||
|
||||
kylin-music (1.1.0.47-ok7) yangtze; urgency=medium
|
||||
|
||||
* BUG: 无
|
||||
|
|
Loading…
Reference in New Issue