!5 fix(bug#I728SG)【截图】【次要】在截图抓取区域内,光标不拖动区域时,样式仍然显示为抓紧的手

Merge pull request !5 from 陈子盈/openkylin/yangtze
This commit is contained in:
陈子盈 2023-09-04 09:56:51 +00:00 committed by Gitee
commit 0ab512bc05
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 42 additions and 1 deletions

22
debian/changelog vendored
View File

@ -1,3 +1,25 @@
kylin-screenshot (1.0.0.1kylin1k81-ok6) yangtze; urgency=medium
* BUG 号:
- #I72731【截图】【次要】【UKUI4.0】截图区域右上角依然存在“钉住”按钮
* 需求号: 无 任务号:无
* 改动说明: 无
* 影响域 : 无
* 其他改动说明 : 无
-- chenziying <chenziying@kylinos.cn> Mon, 4 Sep 2023 17:30:35 +0800
kylin-screenshot (1.0.0.1kylin1k81-ok5) yangtze; urgency=medium
* BUG 号:
- #I728SG 【截图】【次要】在截图抓取区域内,光标不拖动区域时,样式仍然显示为抓紧的手
* 需求号: 无 任务号:无
* 改动说明: 无
* 影响域 : 无
* 其他改动说明 : 无
-- chenziying <chenziying@kylinos.cn> Mon, 4 Sep 2023 11:10:08 +0800
kylin-screenshot (1.0.0.1kylin1k81-ok4) yangtze; urgency=medium kylin-screenshot (1.0.0.1kylin1k81-ok4) yangtze; urgency=medium
* BUG 号: * BUG 号:

View File

@ -22,6 +22,8 @@
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QDebug> #include <QDebug>
#include <QDBusInterface>
#include <QDBusReply>
// ButtonHandler is a habdler for every active button. It makes easier to // ButtonHandler is a habdler for every active button. It makes easier to
// manipulate the buttons as a unit. // manipulate the buttons as a unit.
@ -287,6 +289,15 @@ QRect ButtonHandler::intersectWithAreas(const QRect &rect)
void ButtonHandler::init() void ButtonHandler::init()
{ {
m_separator = GlobalValues::buttonBaseSize() / 2; m_separator = GlobalValues::buttonBaseSize() / 2;
QDBusInterface dbus("com.kylin.statusmanager.interface",
"/",
"com.kylin.statusmanager.interface",
QDBusConnection::sessionBus(),
nullptr);
QDBusReply<bool> tmp_val = dbus.call("get_current_tabletmode");
m_isTabletMode = tmp_val.value();
fprintf(stderr, "is table %s\n", m_isTabletMode ? "true" : "false");
} }
void ButtonHandler::resetRegionTrack() void ButtonHandler::resetRegionTrack()
@ -424,6 +435,11 @@ void ButtonHandler::moveButtonsToPoints(
#endif #endif
case CaptureButton::TYPE_PIN: case CaptureButton::TYPE_PIN:
// 平板模式下移除“钉住”按钮
if (m_isTabletMode) {
button->setVisible(false);
}
for (const QRect &rect: allrect) { for (const QRect &rect: allrect) {
if (rect.contains(m_selection.bottomRight())) { if (rect.contains(m_selection.bottomRight())) {
if (m_selection.right()+GlobalValues::buttonBaseSize() if (m_selection.right()+GlobalValues::buttonBaseSize()
@ -566,3 +582,4 @@ QPoint ButtonHandler::move_Font_Options_Window(int x, int y)
} }
return p; return p;
} }

View File

@ -82,6 +82,7 @@ private:
bool m_oneHorizontalBlocked; bool m_oneHorizontalBlocked;
bool m_horizontalyBlocked; bool m_horizontalyBlocked;
bool m_allSidesBlocked; bool m_allSidesBlocked;
bool m_isTabletMode; // 平板模式
// aux methods // aux methods
void init(); void init();

View File

@ -1489,7 +1489,8 @@ void CaptureWidget::updateCursor()
} }
} else if (m_selection->isVisible() } else if (m_selection->isVisible()
&& m_selection->geometry().contains(m_context.mousePos)) { && m_selection->geometry().contains(m_context.mousePos)) {
setCursor(Qt::OpenHandCursor); // setCursor(Qt::OpenHandCursor);
setCursor(Qt::ArrowCursor);
} else { } else {
setCursor(Qt::CrossCursor); setCursor(Qt::CrossCursor);
} }