Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
5fe94f7c
Commit
5fe94f7c
authored
Jul 09, 2010
by
Thomas Hartmann
Browse files
QmlDesigner.contextPane: nicer positioning for the pane
parent
208b3746
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/qmlcontextpane.cpp
View file @
5fe94f7c
...
...
@@ -109,6 +109,18 @@ void QmlContextPane::apply(TextEditor::BaseTextEditorEditable *editor, Document:
offset
=
objectBinding
->
firstSourceLocation
().
offset
;
end
=
objectBinding
->
lastSourceLocation
().
end
();
}
int
line1
;
int
column1
;
int
line2
;
int
column2
;
m_editor
->
convertPosition
(
offset
,
&
line1
,
&
column1
);
//get line
m_editor
->
convertPosition
(
end
,
&
line2
,
&
column2
);
//get line
QRegion
reg
;
if
(
line1
>
-
1
&&
line2
>
-
1
)
reg
=
m_editor
->
editor
()
->
translatedLineRegion
(
line1
-
1
,
line2
);
if
(
name
.
contains
(
"Text"
))
{
m_node
=
0
;
PropertyReader
propertyReader
(
doc
.
data
(),
initializer
);
...
...
@@ -117,11 +129,15 @@ void QmlContextPane::apply(TextEditor::BaseTextEditorEditable *editor, Document:
QPoint
p1
=
editor
->
editor
()
->
mapToParent
(
editor
->
editor
()
->
viewport
()
->
mapToParent
(
editor
->
editor
()
->
cursorRect
(
tc
).
topLeft
())
-
QPoint
(
0
,
contextWidget
()
->
height
()
+
10
));
tc
.
setPosition
(
end
);
QPoint
p2
=
editor
->
editor
()
->
mapToParent
(
editor
->
editor
()
->
viewport
()
->
mapToParent
(
editor
->
editor
()
->
cursorRect
(
tc
).
bottomLeft
())
+
QPoint
(
0
,
10
));
QPoint
offset
=
QPoint
(
10
,
0
);
if
(
reg
.
boundingRect
().
width
()
<
400
)
offset
=
QPoint
(
400
-
reg
.
boundingRect
().
width
()
+
10
,
0
);
QPoint
p3
=
editor
->
editor
()
->
mapToParent
(
editor
->
editor
()
->
viewport
()
->
mapToParent
(
reg
.
boundingRect
().
topRight
())
+
offset
);
p2
.
setX
(
p1
.
x
());
if
(
!
update
)
contextWidget
()
->
activate
(
p1
,
p2
);
contextWidget
()
->
activate
(
p
3
,
p
1
,
p2
);
else
contextWidget
()
->
rePosition
(
p1
,
p2
);
contextWidget
()
->
rePosition
(
p
3
,
p
1
,
p2
);
m_blockWriting
=
true
;
contextWidget
()
->
setType
(
name
);
contextWidget
()
->
setProperties
(
&
propertyReader
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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