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
102f5c88
Commit
102f5c88
authored
Feb 08, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: polish location bar geometry
parent
8fa5fb96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+18
-6
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
102f5c88
...
...
@@ -467,6 +467,7 @@ LocationBar::LocationBar( PLModel *m )
box
=
new
QHBoxLayout
;
box
->
setSpacing
(
0
);
box
->
setContentsMargins
(
0
,
0
,
0
,
0
);
setLayout
(
box
);
}
...
...
@@ -514,6 +515,8 @@ LocationButton::LocationButton( const QString &text, bool bold, bool arrow )
setText
(
text
);
}
#define PADDING 4
void
LocationButton
::
paintEvent
(
QPaintEvent
*
event
)
{
QStyleOptionButton
option
;
...
...
@@ -524,22 +527,31 @@ void LocationButton::paintEvent ( QPaintEvent * event )
//option.state |= isChecked() ? QStyle::State_On : QStyle::State_Off;
//if( isDown() ) option.state |= QStyle::State_Sunken;
QPainter
p
(
this
);
if
(
underMouse
()
)
style
()
->
drawControl
(
QStyle
::
CE_PushButtonBevel
,
&
option
,
&
p
);
if
(
b_arrow
)
option
.
rect
.
setLeft
(
18
);
else
option
.
rect
.
setLeft
(
6
);
p
.
drawText
(
option
.
rect
,
Qt
::
AlignVCenter
,
fontMetrics
().
elidedText
(
text
(),
Qt
::
ElideRight
,
option
.
rect
.
width
()
-
3
)
);
int
margin
=
style
()
->
pixelMetric
(
QStyle
::
PM_DefaultFrameWidth
,
0
,
this
)
+
PADDING
;
QRect
rect
=
option
.
rect
.
adjusted
(
b_arrow
?
15
+
margin
:
margin
,
0
,
margin
*
-
1
,
0
);
p
.
drawText
(
rect
,
Qt
::
AlignVCenter
,
fontMetrics
().
elidedText
(
text
(),
Qt
::
ElideRight
,
rect
.
width
()
)
);
if
(
b_arrow
)
{
option
.
rect
=
QRect
(
0
,
0
,
18
,
height
()
);
option
.
rect
.
setX
(
margin
);
option
.
rect
.
setWidth
(
8
);
style
()
->
drawPrimitive
(
QStyle
::
PE_IndicatorArrowRight
,
&
option
,
&
p
);
}
}
QSize
LocationButton
::
sizeHint
()
const
{
int
frameWidth
=
style
()
->
pixelMetric
(
QStyle
::
PM_DefaultFrameWidth
,
0
,
this
);
QSize
s
(
fontMetrics
().
boundingRect
(
text
()
).
size
()
);
s
+=
QSize
(
b_arrow
?
24
:
12
,
15
);
s
.
setWidth
(
s
.
width
()
+
(
2
*
frameWidth
)
+
(
2
*
PADDING
)
+
(
b_arrow
?
15
:
0
)
);
s
.
setHeight
(
QPushButton
::
sizeHint
().
height
()
);
return
s
;
}
#undef PADDING
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