Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
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
videolan
vlc-2-2
Commits
d0d1f57e
Commit
d0d1f57e
authored
Feb 26, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: addons: draw INSTALLED state
parent
6db79d2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
5 deletions
+28
-5
modules/gui/qt4/dialogs/plugins.cpp
modules/gui/qt4/dialogs/plugins.cpp
+28
-5
No files found.
modules/gui/qt4/dialogs/plugins.cpp
View file @
d0d1f57e
...
...
@@ -766,11 +766,7 @@ QVariant AddonsListModel::Addon::data( int role ) const
{
case
Qt
:
:
DisplayRole
:
{
QString
name
=
qfu
(
p_entry
->
psz_name
);
if
(
p_entry
->
e_state
==
ADDON_INSTALLED
)
name
.
append
(
QString
(
" (%1)"
).
arg
(
qtr
(
"installed"
)
)
);
returnval
=
name
;
returnval
=
qfu
(
p_entry
->
psz_name
);
break
;
}
case
Qt
:
:
DecorationRole
:
...
...
@@ -1125,6 +1121,33 @@ void AddonItemDelegate::paint( QPainter *painter,
painter
->
save
();
painter
->
setRenderHint
(
QPainter
::
TextAntialiasing
);
/* Addon status */
if
(
i_state
==
ADDON_INSTALLED
)
{
painter
->
save
();
painter
->
setRenderHint
(
QPainter
::
Antialiasing
);
QMargins
statusMargins
(
5
,
2
,
5
,
2
);
QFont
font
(
newopt
.
font
);
font
.
setBold
(
true
);
QFontMetrics
metrics
(
font
);
painter
->
setFont
(
font
);
QRect
statusRect
=
metrics
.
boundingRect
(
qtr
(
"Installed"
)
);
statusRect
.
translate
(
newopt
.
rect
.
width
()
-
statusRect
.
width
(),
newopt
.
rect
.
top
()
+
statusRect
.
height
()
);
statusRect
.
adjust
(
-
statusMargins
.
left
()
-
statusMargins
.
right
(),
0
,
0
,
statusMargins
.
top
()
+
statusMargins
.
bottom
()
);
QPainterPath
path
;
path
.
addRoundedRect
(
statusRect
,
2.0
,
2.0
);
painter
->
fillPath
(
path
,
QColor
(
Qt
::
green
).
darker
(
125
)
);
painter
->
setPen
(
Qt
::
white
);
painter
->
drawText
(
statusRect
.
adjusted
(
statusMargins
.
left
(),
statusMargins
.
top
(),
-
statusMargins
.
right
(),
-
statusMargins
.
bottom
()
),
qtr
(
"Installed"
)
);
painter
->
restore
();
}
if
(
newopt
.
state
&
QStyle
::
State_Selected
)
painter
->
setPen
(
newopt
.
palette
.
highlightedText
().
color
()
);
...
...
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