Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Farid Abdelnour
kdenlive
Commits
2884e7ae
Commit
2884e7ae
authored
Jan 03, 2016
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix offset when renaming bin item
BUG: 351712
parent
b82f237e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
src/bin/bin.h
src/bin/bin.h
+28
-1
No files found.
src/bin/bin.h
View file @
2884e7ae
...
...
@@ -38,6 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QListView>
#include <QFuture>
#include <QMutex>
#include <QLineEdit>
class
KdenliveDoc
;
class
ClipController
;
...
...
@@ -143,7 +144,33 @@ private slots:
class
BinItemDelegate
:
public
QStyledItemDelegate
{
public:
explicit
BinItemDelegate
(
QObject
*
parent
=
0
)
:
QStyledItemDelegate
(
parent
)
{
explicit
BinItemDelegate
(
QObject
*
parent
=
0
)
:
QStyledItemDelegate
(
parent
)
{
}
void
updateEditorGeometry
(
QWidget
*
editor
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
{
QStyleOptionViewItemV4
opt
=
option
;
initStyleOption
(
&
opt
,
index
);
QRect
r1
=
option
.
rect
;
QStyle
*
style
=
opt
.
widget
?
opt
.
widget
->
style
()
:
QApplication
::
style
();
const
int
textMargin
=
style
->
pixelMetric
(
QStyle
::
PM_FocusFrameHMargin
)
+
1
;
int
type
=
index
.
data
(
AbstractProjectItem
::
ItemTypeRole
).
toInt
();
double
factor
=
(
double
)
opt
.
decorationSize
.
height
()
/
r1
.
height
();
int
decoWidth
=
2
*
textMargin
;
int
mid
=
0
;
if
(
factor
!=
0
)
{
decoWidth
+=
opt
.
decorationSize
.
width
()
/
factor
;
}
if
(
type
==
AbstractProjectItem
::
ClipItem
||
type
==
AbstractProjectItem
::
SubClipItem
)
{
mid
=
(
int
)((
r1
.
height
()
/
2
));
}
r1
.
adjust
(
decoWidth
,
0
,
0
,
-
mid
);
QFont
ft
=
option
.
font
;
ft
.
setBold
(
true
);
QFontMetricsF
fm
(
ft
);
QRect
r2
=
fm
.
boundingRect
(
r1
,
Qt
::
AlignLeft
|
Qt
::
AlignTop
,
index
.
data
(
AbstractProjectItem
::
DataName
).
toString
()).
toRect
();
editor
->
setGeometry
(
r2
);
}
QSize
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
...
...
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