Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
1e84ceac
Commit
1e84ceac
authored
Sep 20, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some size fixes
parent
17c96000
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
41 deletions
+73
-41
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+22
-13
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+9
-0
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+1
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+39
-28
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+2
-0
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
1e84ceac
...
...
@@ -104,17 +104,8 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) :
QFrame
(
NULL
),
p_intf
(
_p_i
)
{
setFrameStyle
(
QFrame
::
StyledPanel
|
QFrame
::
Raised
);
DrawBackground
();
}
BackgroundWidget
::~
BackgroundWidget
()
{
CleanBackground
();
}
int
BackgroundWidget
::
DrawBackground
()
{
setAutoFillBackground
(
true
);
setAutoFillBackground
(
true
);
plt
=
palette
();
plt
.
setColor
(
QPalette
::
Active
,
QPalette
::
Window
,
Qt
::
black
);
plt
.
setColor
(
QPalette
::
Inactive
,
QPalette
::
Window
,
Qt
::
black
);
...
...
@@ -129,14 +120,12 @@ int BackgroundWidget::DrawBackground()
backgroundLayout
=
new
QHBoxLayout
;
backgroundLayout
->
addWidget
(
label
);
setLayout
(
backgroundLayout
);
return
0
;
}
int
BackgroundWidget
::
Clean
Background
()
BackgroundWidget
::
~
Background
Widget
()
{
backgroundLayout
->
takeAt
(
0
);
delete
backgroundLayout
;
return
0
;
}
QSize
BackgroundWidget
::
sizeHint
()
const
...
...
@@ -153,6 +142,26 @@ void BackgroundWidget::resizeEvent( QResizeEvent *e )
label
->
setMaximumWidth
(
ICON_SIZE
);
}
/**********************************************************************
* Visualization selector panel
**********************************************************************/
VisualSelector
::
VisualSelector
(
intf_thread_t
*
_p_i
)
:
QFrame
(
NULL
),
p_intf
(
_p_i
)
{
setFrameStyle
(
QFrame
::
StyledPanel
|
QFrame
::
Raised
);
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
QPushButton
*
prevButton
=
new
QPushButton
(
"Prev"
);
QPushButton
*
nextButton
=
new
QPushButton
(
"Next"
);
layout
->
addWidget
(
prevButton
);
layout
->
addWidget
(
nextButton
);
setLayout
(
layout
);
setMaximumHeight
(
30
);
}
VisualSelector
::~
VisualSelector
()
{
}
/**********************************************************************
* Playlist Widget. The embedded playlist
**********************************************************************/
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
1e84ceac
...
...
@@ -78,6 +78,15 @@ private:
intf_thread_t
*
p_intf
;
};
class
VisualSelector
:
public
QFrame
{
Q_OBJECT
public:
VisualSelector
(
intf_thread_t
*
);
virtual
~
VisualSelector
();
private:
intf_thread_t
*
p_intf
;
};
/******************** Playlist Widget ****************/
#include <QModelIndex>
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
1e84ceac
...
...
@@ -50,6 +50,7 @@ StandardPLPanel::StandardPLPanel( QWidget *_parent, intf_thread_t *_p_intf,
view
->
setIconSize
(
QSize
(
20
,
20
)
);
view
->
setAlternatingRowColors
(
true
);
view
->
header
()
->
resizeSection
(
0
,
230
);
view
->
header
()
->
resizeSection
(
2
,
60
);
view
->
header
()
->
setSortIndicatorShown
(
true
);
view
->
header
()
->
setClickable
(
true
);
view
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
...
...
modules/gui/qt4/main_interface.cpp
View file @
1e84ceac
...
...
@@ -74,13 +74,13 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
need_components_update
=
false
;
bgWidget
=
NULL
;
videoWidget
=
NULL
;
playlistWidget
=
NULL
;
embeddedPlaylistWasActive
=
false
;
videoIsActive
=
false
;
embeddedPlaylistWasActive
=
videoIsActive
=
false
;
setWindowTitle
(
QString
::
fromUtf8
(
_
(
"VLC media player"
)
)
);
handleMainUi
(
settings
);
QVLCMenu
::
createMenuBar
(
menuBar
(),
p_intf
);
/* Status bar */
timeLabel
=
new
QLabel
(
0
);
nameLabel
=
new
QLabel
(
0
);
...
...
@@ -137,14 +137,16 @@ void MainInterface::handleMainUi( QSettings *settings )
slider
=
new
InputSlider
(
Qt
::
Horizontal
,
NULL
);
ui
.
hboxLayout
->
insertWidget
(
0
,
slider
);
ui
.
prevButton
->
setText
(
""
);
ui
.
nextButton
->
setText
(
""
);
ui
.
playButton
->
setText
(
""
);
ui
.
stopButton
->
setText
(
""
);
ui
.
prevButton
->
setIcon
(
QIcon
(
":/pixmaps/previous.png"
)
);
ui
.
nextButton
->
setIcon
(
QIcon
(
":/pixmaps/next.png"
)
);
ui
.
playButton
->
setIcon
(
QIcon
(
":/pixmaps/play.png"
)
);
ui
.
stopButton
->
setIcon
(
QIcon
(
":/pixmaps/stop.png"
)
);
ui
.
discFrame
->
setFrameStyle
(
QFrame
::
StyledPanel
|
QFrame
::
Sunken
);
#define SET( button, image ) ui.button##Button->setText(""); \
ui.button##Button->setIcon( QIcon( ":/pixmaps/"#image ) );
SET
(
prev
,
previous
.
png
);
SET
(
next
,
next
.
png
);
SET
(
play
,
play
.
png
);
SET
(
stop
,
stop
.
png
);
SET
(
playlist
,
volume
-
low
.
png
);
#undef SET
/* Volume */
ui
.
volLowLabel
->
setPixmap
(
QPixmap
(
":/pixmaps/volume-low.png"
)
);
...
...
@@ -156,9 +158,6 @@ void MainInterface::handleMainUi( QSettings *settings )
ui
.
volHighLabel
->
installEventFilter
(
h
);
ui
.
volumeSlider
->
setFocusPolicy
(
Qt
::
NoFocus
);
ui
.
playlistButton
->
setText
(
""
);
ui
.
playlistButton
->
setIcon
(
QIcon
(
":/pixmaps/volume-low.png"
)
);
/* Fetch configuration from settings and vlc config */
videoEmbeddedFlag
=
false
;
if
(
config_GetInt
(
p_intf
,
"embedded-video"
)
)
...
...
@@ -167,13 +166,16 @@ void MainInterface::handleMainUi( QSettings *settings )
playlistEmbeddedFlag
=
true
;
/// \todo fetch playlist settings
/* Set initial size */
resize
(
PREF_W
,
PREF_H
);
addSize
=
QSize
(
ui
.
vboxLayout
->
margin
()
*
2
,
PREF_H
);
if
(
videoEmbeddedFlag
)
{
videoWidget
=
new
VideoWidget
(
p_intf
);
videoWidget
->
widgetSize
=
QSize
(
1
,
1
);
videoWidget
->
resize
(
videoWidget
->
widgetSize
);
videoWidget
->
hide
();
ui
.
vboxLayout
->
insertWidget
(
0
,
videoWidget
);
p_intf
->
pf_request_window
=
::
DoRequest
;
...
...
@@ -186,16 +188,13 @@ void MainInterface::handleMainUi( QSettings *settings )
// bgWidget->widgetSize = settings->value( "backgroundSize",
// QSize( 200, 200 ) ).toSize();
// ui.vboxLayout->insertWidget( 0, bgWidget );
// bgWidget->hide();
}
}
// Size for fixed elements
addSize
=
QSize
(
ui
.
vboxLayout
->
margin
()
*
2
,
PREF_H
);
// visualSelector = new VisualSelector( p_intf );
// visualSelector->hide();
calculateInterfaceSize
();
resize
(
mainSize
);
/// \bug still needed ?
mainSize
=
size
();
setMinimumSize
(
PREF_W
,
addSize
.
height
()
);
...
...
@@ -212,7 +211,7 @@ void MainInterface::calculateInterfaceSize()
{
width
=
bgWidget
->
widgetSize
.
width
();
height
=
bgWidget
->
widgetSize
.
height
();
assert
(
!
playlistWidget
->
isVisible
()
);
assert
(
!
(
playlistWidget
&&
playlistWidget
->
isVisible
()
)
);
}
else
if
(
playlistWidget
&&
playlistWidget
->
isVisible
()
)
{
...
...
@@ -239,22 +238,26 @@ void MainInterface::resizeEvent( QResizeEvent *e )
*/
if
(
videoWidget
)
{
if
(
videoIsActive
)
{
videoWidget
->
widgetSize
.
setWidth
(
e
->
size
().
width
()
-
addSize
.
width
()
);
if
(
videoIsActive
)
{
videoWidget
->
widgetSize
.
setHeight
(
e
->
size
().
height
()
-
addSize
.
height
()
);
videoWidget
->
updateGeometry
();
}
fprintf
(
stderr
,
"Video set to %ix%
\n
i"
,
videoWidget
->
widgetSize
.
width
(),
videoWidget
->
widgetSize
.
height
()
);
fprintf
(
stderr
,
"Video set to %ix%i
\n
"
,
videoWidget
->
widgetSize
.
width
(),
videoWidget
->
widgetSize
.
height
()
);
}
if
(
playlistWidget
)
{
if
(
playlistWidget
->
isVisible
()
)
{
playlistWidget
->
widgetSize
.
setWidth
(
e
->
size
().
width
()
-
addSize
.
width
()
);
if
(
playlistWidget
->
isVisible
()
)
{
playlistWidget
->
widgetSize
.
setHeight
(
e
->
size
().
height
()
-
addSize
.
height
()
);
playlistWidget
->
updateGeometry
();
...
...
@@ -279,6 +282,11 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
embeddedPlaylistWasActive
=
true
;
playlistWidget
->
hide
();
}
if
(
bgWidget
&&
bgWidget
->
isVisible
()
)
{
bgWidget
->
hide
();
}
videoWidget
->
show
();
videoWidget
->
widgetSize
=
QSize
(
*
pi_width
,
*
pi_height
);
videoWidget
->
updateGeometry
();
/// FIXME: Needed ?
need_components_update
=
true
;
...
...
@@ -289,12 +297,15 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
void
MainInterface
::
releaseVideo
(
void
*
p_win
)
{
videoWidget
->
release
(
p_win
);
videoWidget
->
widgetSize
=
QSize
(
1
,
1
);
videoWidget
->
updateGeometry
();
videoWidget
->
hide
();
// videoWidget->widgetSize = QSize( 1, 1 );
// videoWidget->updateGeometry();
if
(
embeddedPlaylistWasActive
)
{
playlistWidget
->
show
();
}
else
if
(
bgWidget
)
bgWidget
->
show
();
videoIsActive
=
false
;
need_components_update
=
true
;
}
...
...
modules/gui/qt4/main_interface.hpp
View file @
1e84ceac
...
...
@@ -41,6 +41,7 @@ class VideoWidget;
class
BackgroundWidget
;
class
PlaylistWidget
;
class
VolumeClickHandler
;
class
VisualSelector
;
class
MainInterface
:
public
QVLCMW
{
...
...
@@ -74,6 +75,7 @@ private:
virtual
void
keyPressEvent
(
QKeyEvent
*
);
BackgroundWidget
*
bgWidget
;
VisualSelector
*
visualSelector
;
PlaylistWidget
*
playlistWidget
;
bool
playlistEmbeddedFlag
;
...
...
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