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
347bfe4d
Commit
347bfe4d
authored
Feb 10, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: selector cosmetic polish
parent
af688c8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
modules/gui/qt4/components/playlist/selector.cpp
modules/gui/qt4/components/playlist/selector.cpp
+17
-3
modules/gui/qt4/components/playlist/selector.hpp
modules/gui/qt4/components/playlist/selector.hpp
+11
-1
modules/gui/qt4/util/customwidgets.hpp
modules/gui/qt4/util/customwidgets.hpp
+2
-2
No files found.
modules/gui/qt4/components/playlist/selector.cpp
View file @
347bfe4d
...
@@ -44,6 +44,20 @@
...
@@ -44,6 +44,20 @@
#include <vlc_playlist.h>
#include <vlc_playlist.h>
#include <vlc_services_discovery.h>
#include <vlc_services_discovery.h>
void
SelectorActionButton
::
paintEvent
(
QPaintEvent
*
event
)
{
QPainter
p
(
this
);
QColor
color
=
palette
().
color
(
QPalette
::
HighlightedText
);
color
.
setAlpha
(
80
);
if
(
underMouse
()
)
p
.
fillRect
(
rect
(),
color
);
p
.
setPen
(
color
);
int
frame
=
style
()
->
pixelMetric
(
QStyle
::
PM_DefaultFrameWidth
,
0
,
this
);
p
.
drawLine
(
rect
().
topLeft
()
+
QPoint
(
0
,
frame
),
rect
().
bottomLeft
()
-
QPoint
(
0
,
frame
)
);
QVLCFramelessButton
::
paintEvent
(
event
);
}
PLSelItem
::
PLSelItem
(
QTreeWidgetItem
*
i
,
const
QString
&
text
)
PLSelItem
::
PLSelItem
(
QTreeWidgetItem
*
i
,
const
QString
&
text
)
:
qitem
(
i
),
lblAction
(
NULL
)
:
qitem
(
i
),
lblAction
(
NULL
)
{
{
...
@@ -74,14 +88,14 @@ void PLSelItem::addAction( ItemAction act, const QString& tooltip )
...
@@ -74,14 +88,14 @@ void PLSelItem::addAction( ItemAction act, const QString& tooltip )
icon
=
QIcon
(
":/buttons/playlist/playlist_remove"
);
break
;
icon
=
QIcon
(
":/buttons/playlist/playlist_remove"
);
break
;
}
}
lblAction
=
new
QVLCFrameless
Button
();
lblAction
=
new
SelectorAction
Button
();
lblAction
->
setIcon
(
icon
);
lblAction
->
setIcon
(
icon
);
lblAction
->
setMinimumWidth
(
lblAction
->
sizeHint
().
width
()
+
6
);
if
(
!
tooltip
.
isEmpty
()
)
lblAction
->
setToolTip
(
tooltip
);
if
(
!
tooltip
.
isEmpty
()
)
lblAction
->
setToolTip
(
tooltip
);
layout
->
addWidget
(
lblAction
,
0
);
layout
->
addWidget
(
lblAction
,
0
);
lblAction
->
hide
();
lblAction
->
hide
();
layout
->
addSpacing
(
3
);
CONNECT
(
lblAction
,
clicked
(),
this
,
triggerAction
()
);
CONNECT
(
lblAction
,
clicked
(),
this
,
triggerAction
()
);
}
}
...
@@ -102,7 +116,7 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
...
@@ -102,7 +116,7 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
setFrameStyle
(
QFrame
::
NoFrame
);
setFrameStyle
(
QFrame
::
NoFrame
);
viewport
()
->
setAutoFillBackground
(
false
);
viewport
()
->
setAutoFillBackground
(
false
);
setIconSize
(
QSize
(
24
,
24
)
);
setIconSize
(
QSize
(
24
,
24
)
);
setIndentation
(
1
4
);
setIndentation
(
1
2
);
header
()
->
hide
();
header
()
->
hide
();
setRootIsDecorated
(
true
);
setRootIsDecorated
(
true
);
setAlternatingRowColors
(
false
);
setAlternatingRowColors
(
false
);
...
...
modules/gui/qt4/components/playlist/selector.hpp
View file @
347bfe4d
...
@@ -36,13 +36,13 @@
...
@@ -36,13 +36,13 @@
#include <QPushButton>
#include <QPushButton>
#include <QLabel>
#include <QLabel>
#include <QHBoxLayout>
#include <QHBoxLayout>
#include "util/customwidgets.hpp"
#include <vlc_playlist.h>
#include <vlc_playlist.h>
#include "qt4.hpp"
#include "qt4.hpp"
class
PlaylistWidget
;
class
PlaylistWidget
;
class
QVLCFramelessButton
;
enum
SelectorItemType
{
enum
SelectorItemType
{
CATEGORY_TYPE
,
CATEGORY_TYPE
,
...
@@ -71,6 +71,16 @@ enum ItemAction {
...
@@ -71,6 +71,16 @@ enum ItemAction {
RM_ACTION
RM_ACTION
};
};
class
SelectorActionButton
:
public
QVLCFramelessButton
{
public:
SelectorActionButton
(
QWidget
*
parent
=
NULL
)
:
QVLCFramelessButton
(
parent
)
{}
private:
void
paintEvent
(
QPaintEvent
*
);
};
class
PLSelItem
:
public
QWidget
class
PLSelItem
:
public
QWidget
{
{
Q_OBJECT
;
Q_OBJECT
;
...
...
modules/gui/qt4/util/customwidgets.hpp
View file @
347bfe4d
...
@@ -63,8 +63,8 @@ class QVLCFramelessButton : public QPushButton
...
@@ -63,8 +63,8 @@ class QVLCFramelessButton : public QPushButton
public:
public:
QVLCFramelessButton
(
QWidget
*
parent
=
NULL
);
QVLCFramelessButton
(
QWidget
*
parent
=
NULL
);
QSize
sizeHint
()
const
;
QSize
sizeHint
()
const
;
pr
ivate
:
pr
otected
:
void
paintEvent
(
QPaintEvent
*
event
);
v
irtual
v
oid
paintEvent
(
QPaintEvent
*
event
);
};
};
class
QLabel
;
class
QLabel
;
...
...
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