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
5f47703c
Commit
5f47703c
authored
Nov 30, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: simplification
parent
e14f4778
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
41 deletions
+27
-41
modules/gui/qt4/dialogs/plugins.cpp
modules/gui/qt4/dialogs/plugins.cpp
+1
-0
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.cpp
+1
-7
modules/gui/qt4/util/searchlineedit.cpp
modules/gui/qt4/util/searchlineedit.cpp
+24
-29
modules/gui/qt4/util/searchlineedit.hpp
modules/gui/qt4/util/searchlineedit.hpp
+1
-5
No files found.
modules/gui/qt4/dialogs/plugins.cpp
View file @
5f47703c
...
...
@@ -51,6 +51,7 @@
#include <QPainter>
#include <QStyleOptionViewItem>
#include <QKeyEvent>
#include <QPushButton>
PluginDialog
::
PluginDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
...
...
modules/gui/qt4/util/customwidgets.cpp
View file @
5f47703c
...
...
@@ -29,19 +29,13 @@
#endif
#include "customwidgets.hpp"
#include "qt4.hpp"
/*needed for qtr and CONNECT, but not necessary */
#include "qt4.hpp"
/*needed for qtr and CONNECT, but not necessary */
#include <QPainter>
#include <QColorGroup>
#include <QRect>
#include <QKeyEvent>
#include <QWheelEvent>
#include <QHBoxLayout>
#include <QStyle>
#include <QStyleOption>
#include <vlc_intf_strings.h>
#include <vlc_keys.h>
#include <wctype.h>
/* twolower() */
QVLCFramelessButton
::
QVLCFramelessButton
(
QWidget
*
parent
)
:
QPushButton
(
parent
)
...
...
modules/gui/qt4/util/searchlineedit.cpp
View file @
5f47703c
...
...
@@ -34,16 +34,11 @@
#include "qt4.hpp"
/*needed for qtr and CONNECT, but not necessary */
#include <QPainter>
#include <QColorGroup>
#include <QRect>
#include <QKeyEvent>
#include <QWheelEvent>
#include <QHBoxLayout>
#include <QStyle>
#include <QStyleOption>
#include <vlc_intf_strings.h>
#include <vlc_keys.h>
#include <wctype.h>
/* twolower() */
ClickLineEdit
::
ClickLineEdit
(
const
QString
&
msg
,
QWidget
*
parent
)
:
QLineEdit
(
parent
)
{
...
...
@@ -158,41 +153,41 @@ void SearchLineEdit::updateText( const QString& text )
void
SearchLineEdit
::
resizeEvent
(
QResizeEvent
*
event
)
{
QLineEdit
::
resizeEvent
(
event
);
int
frameWidth
=
style
()
->
pixelMetric
(
QStyle
::
PM_DefaultFrameWidth
,
0
,
this
);
clearButton
->
resize
(
clearButton
->
sizeHint
().
width
(),
height
()
);
clearButton
->
move
(
width
()
-
clearButton
->
width
()
-
frameWidth
,
0
);
QLineEdit
::
resizeEvent
(
event
);
int
frameWidth
=
style
()
->
pixelMetric
(
QStyle
::
PM_DefaultFrameWidth
,
0
,
this
);
clearButton
->
resize
(
clearButton
->
sizeHint
().
width
(),
height
()
);
clearButton
->
move
(
width
()
-
clearButton
->
width
()
-
frameWidth
,
0
);
}
void
SearchLineEdit
::
focusInEvent
(
QFocusEvent
*
event
)
{
if
(
message
)
{
setMessageVisible
(
false
);
}
QLineEdit
::
focusInEvent
(
event
);
if
(
message
)
{
setMessageVisible
(
false
);
}
QLineEdit
::
focusInEvent
(
event
);
}
void
SearchLineEdit
::
focusOutEvent
(
QFocusEvent
*
event
)
{
if
(
text
().
isEmpty
()
)
{
setMessageVisible
(
true
);
}
QLineEdit
::
focusOutEvent
(
event
);
if
(
text
().
isEmpty
()
)
{
setMessageVisible
(
true
);
}
QLineEdit
::
focusOutEvent
(
event
);
}
void
SearchLineEdit
::
paintEvent
(
QPaintEvent
*
event
)
{
QLineEdit
::
paintEvent
(
event
);
if
(
!
message
)
return
;
QStyleOption
option
;
option
.
initFrom
(
this
);
QRect
rect
=
style
()
->
subElementRect
(
QStyle
::
SE_LineEditContents
,
&
option
,
this
)
.
adjusted
(
3
,
0
,
clearButton
->
width
()
+
1
,
0
);
QPainter
painter
(
this
);
painter
.
setPen
(
palette
().
color
(
QPalette
::
Disabled
,
QPalette
::
Text
)
);
painter
.
drawText
(
rect
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
,
qtr
(
I_PL_FILTER
)
);
QLineEdit
::
paintEvent
(
event
);
if
(
!
message
)
return
;
QStyleOption
option
;
option
.
initFrom
(
this
);
QRect
rect
=
style
()
->
subElementRect
(
QStyle
::
SE_LineEditContents
,
&
option
,
this
)
.
adjusted
(
3
,
0
,
clearButton
->
width
()
+
1
,
0
);
QPainter
painter
(
this
);
painter
.
setPen
(
palette
().
color
(
QPalette
::
Disabled
,
QPalette
::
Text
)
);
painter
.
drawText
(
rect
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
,
qtr
(
I_PL_FILTER
)
);
}
void
SearchLineEdit
::
searchEditingFinished
()
...
...
modules/gui/qt4/util/searchlineedit.hpp
View file @
5f47703c
...
...
@@ -28,12 +28,7 @@
#define _SEARCHLINEEDIT_H_
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QStackedWidget>
#include <QSpinBox>
class
QVLCFramelessButton
;
/**
This class provides a QLineEdit which contains a greyed-out hinting
text as long as the user didn't enter any text
...
...
@@ -60,6 +55,7 @@ private:
bool
mDrawClickMsg
;
};
class
QVLCFramelessButton
;
class
SearchLineEdit
:
public
QLineEdit
{
Q_OBJECT
...
...
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