Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
takeaway
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuai.liu
takeaway
Commits
ef406819
Commit
ef406819
authored
Sep 28, 2018
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
悬浮窗优化,保证不会被拖到屏幕外面
parent
206f3da6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
2 deletions
+13
-2
fmTakeaway/floatform.cpp
+12
-1
fmTakeaway/floatform.ui
+1
-1
run/skin/float_normal.png
+0
-0
run/skin/tool/deafult.rcc
+0
-0
No files found.
fmTakeaway/floatform.cpp
View file @
ef406819
...
@@ -99,7 +99,18 @@ void FloatForm::mouseReleaseEvent(QMouseEvent *event)
...
@@ -99,7 +99,18 @@ void FloatForm::mouseReleaseEvent(QMouseEvent *event)
if
(
m_bMouseMoved
)
if
(
m_bMouseMoved
)
{
{
// 记录坐标
// 记录坐标
ConfigManage
::
Instance
().
setFloatFormPostion
(
pos
());
QPoint
releasePoint
=
pos
();
qDebug
()
<<
"releasePoint"
<<
releasePoint
;
if
(
releasePoint
.
x
()
<
0
)
releasePoint
.
setX
(
0
);
if
(
releasePoint
.
y
()
<
0
)
releasePoint
.
setY
(
0
);
if
(
releasePoint
.
x
()
>
QApplication
::
desktop
()
->
screenGeometry
().
width
()
-
this
->
width
())
releasePoint
.
setX
(
QApplication
::
desktop
()
->
screenGeometry
().
width
()
-
this
->
width
());
if
(
releasePoint
.
y
()
>
QApplication
::
desktop
()
->
screenGeometry
().
height
()
-
this
->
height
())
releasePoint
.
setY
(
QApplication
::
desktop
()
->
screenGeometry
().
height
()
-
this
->
height
());
move
(
releasePoint
);
ConfigManage
::
Instance
().
setFloatFormPostion
(
releasePoint
);
}
else
}
else
{
{
hide
();
hide
();
...
...
fmTakeaway/floatform.ui
View file @
ef406819
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
171
</width>
<width>
171
</width>
<height>
141
</height>
<height>
88
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"windowTitle"
>
<property
name=
"windowTitle"
>
...
...
run/skin/float_normal.png
View replaced file @
206f3da6
View file @
ef406819
8.17 KB
|
W:
|
H:
5.82 KB
|
W:
|
H:
2-up
Swipe
Onion skin
run/skin/tool/deafult.rcc
View file @
ef406819
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment