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
b83c1d09
Commit
b83c1d09
authored
Nov 25, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - lame attempt for the resizing of the interface.
parent
70027747
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
93 deletions
+133
-93
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+76
-59
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+5
-6
modules/gui/qt4/dialogs/playlist.cpp
modules/gui/qt4/dialogs/playlist.cpp
+3
-2
modules/gui/qt4/dialogs/playlist.hpp
modules/gui/qt4/dialogs/playlist.hpp
+1
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+45
-24
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+3
-2
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
b83c1d09
This diff is collapsed.
Click to expand it.
modules/gui/qt4/components/interface_widgets.hpp
View file @
b83c1d09
...
...
@@ -83,11 +83,8 @@ public:
private:
QPalette
plt
;
QLabel
*
label
;
QHBoxLayout
*
backgroundLayout
;
virtual
void
resizeEvent
(
QResizeEvent
*
e
);
virtual
void
contextMenuEvent
(
QContextMenuEvent
*
event
);
int
DrawBackground
();
int
CleanBackground
();
intf_thread_t
*
p_intf
;
public
slots
:
void
setArt
(
QString
);
...
...
@@ -149,7 +146,7 @@ class ControlsWidget : public QFrame
public:
/* p_intf, advanced control visible or not, blingbling or not */
ControlsWidget
(
intf_thread_t
*
,
bool
,
bool
);
QSize
sizeHint
()
const
;
//
QSize sizeHint() const;
virtual
~
ControlsWidget
();
QPushButton
*
playlistButton
;
...
...
@@ -239,14 +236,16 @@ class QSignalMapper;
class
PLSelector
;
class
PLPanel
;
class
QPushButton
;
class
QSettings
;
class
PlaylistWidget
:
public
QSplitter
{
Q_OBJECT
;
public:
PlaylistWidget
(
intf_thread_t
*
_p_i
)
;
PlaylistWidget
(
intf_thread_t
*
_p_i
,
QSettings
*
settings
)
;
virtual
~
PlaylistWidget
();
QSize
sizeHint
()
const
;
void
saveSettings
(
QSettings
*
settings
);
private:
PLSelector
*
selector
;
PLPanel
*
rightPanel
;
...
...
@@ -254,7 +253,7 @@ private:
QLabel
*
art
;
QString
prevArt
;
protected:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
private
slots
:
void
setArt
(
QString
);
signals:
...
...
modules/gui/qt4/dialogs/playlist.cpp
View file @
b83c1d09
...
...
@@ -37,7 +37,8 @@
PlaylistDialog
*
PlaylistDialog
::
instance
=
NULL
;
PlaylistDialog
::
PlaylistDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCMW
(
_p_intf
)
PlaylistDialog
::
PlaylistDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCMW
(
_p_intf
)
{
QWidget
*
main
=
new
QWidget
(
this
);
setCentralWidget
(
main
);
...
...
@@ -45,7 +46,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
setWindowOpacity
(
config_GetFloat
(
p_intf
,
"qt-opacity"
)
);
QHBoxLayout
*
l
=
new
QHBoxLayout
(
centralWidget
()
);
PlaylistWidget
*
plw
=
new
PlaylistWidget
(
p_intf
);
PlaylistWidget
*
plw
=
new
PlaylistWidget
(
p_intf
,
NULL
);
l
->
addWidget
(
plw
);
readSettings
(
"playlist"
,
QSize
(
600
,
700
)
);
...
...
modules/gui/qt4/dialogs/playlist.hpp
View file @
b83c1d09
...
...
@@ -31,6 +31,7 @@
class
QSignalMapper
;
class
PLSelector
;
class
PLPanel
;
class
QSettings
;
class
PlaylistDialog
:
public
QVLCMW
{
...
...
modules/gui/qt4/main_interface.cpp
View file @
b83c1d09
...
...
@@ -96,9 +96,10 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
bgWidget
=
NULL
;
videoWidget
=
NULL
;
playlistWidget
=
NULL
;
embeddedPlaylistWasActive
=
videoIsActive
=
false
;
input_name
=
""
;
playlistWidget
=
new
PlaylistWidget
(
p_intf
);
/* Ask for the network policy on first startup */
/**
* Ask for the network policy on FIRST STARTUP
*/
if
(
config_GetInt
(
p_intf
,
"privacy-ask"
)
)
{
QList
<
ConfigControl
*>
controls
;
...
...
@@ -145,16 +146,15 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
* UI and Widgets design
**************************/
setVLCWindowsTitle
();
dockPL
=
new
QDockWidget
(
qtr
(
"Playlist"
),
thi
s
);
handleMainUi
(
setting
s
);
/* Create a Dock to get the playlist */
handleMainUi
(
setting
s
);
dockPL
=
new
QDockWidget
(
qtr
(
"Playlist"
),
thi
s
);
dockPL
->
setAllowedAreas
(
Qt
::
LeftDockWidgetArea
|
Qt
::
RightDockWidgetArea
|
Qt
::
BottomDockWidgetArea
);
dockPL
->
setFeatures
(
QDockWidget
::
AllDockWidgetFeatures
);
dockPL
->
setWidget
(
playlistWidget
);
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
dockPL
);
/* Menu Bar */
QVLCMenu
::
createMenuBar
(
this
,
p_intf
,
visualSelectorEnabled
);
...
...
@@ -222,8 +222,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Init input manager */
MainInputManager
::
getInstance
(
p_intf
);
ON_TIMEOUT
(
updateOnTimer
()
);
// ON_TIMEOUT( debug() );
//ON_TIMEOUT( debug() );
/********************
* Various CONNECTs *
...
...
@@ -284,6 +283,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
CONNECT
(
this
,
askReleaseVideo
(
void
*
),
this
,
releaseVideoSlot
(
void
*
)
);
CONNECT
(
dockPL
,
topLevelChanged
(
bool
),
this
,
doComponentsUpdate
()
);
// DEBUG FIXME
hide
();
updateGeometry
();
...
...
@@ -301,9 +301,10 @@ MainInterface::~MainInterface()
vlc_object_release
(
p_playlist
);
}
settings
->
setValue
(
"playlist-
embedded"
,
!
dockPL
->
isFloating
()
);
settings
->
setValue
(
"playlist-
floats"
,
dockPL
->
isFloating
()
);
settings
->
setValue
(
"adv-controls"
,
getControlsVisibilityStatus
()
&
CONTROLS_ADVANCED
);
settings
->
setValue
(
"pos"
,
pos
()
);
playlistWidget
->
saveSettings
(
settings
);
settings
->
endGroup
();
delete
settings
;
p_intf
->
b_interaction
=
VLC_FALSE
;
...
...
@@ -383,7 +384,6 @@ void MainInterface::handleMainUi( QSettings *settings )
bgWidget
->
updateGeometry
();
mainLayout
->
insertWidget
(
0
,
bgWidget
);
CONNECT
(
this
,
askBgWidgetToToggle
(),
bgWidget
,
toggle
()
);
CONNECT
(
playlistWidget
,
artSet
(
QString
),
bgWidget
,
setArt
(
QString
)
);
}
if
(
videoEmbeddedFlag
)
...
...
@@ -415,15 +415,16 @@ void MainInterface::privacyDialog( QList<ConfigControl *> controls )
QGroupBox
*
blabla
=
new
QGroupBox
(
qtr
(
"Privacy and Network Warning"
)
);
QGridLayout
*
blablaLayout
=
new
QGridLayout
(
blabla
);
QLabel
*
text
=
new
QLabel
(
qtr
(
"<p>The <i>VideoLAN Team</i> doesn't like when an application goes
online without
"
"authorisation.</p>
\n
"
"<p>The <i>VideoLAN Team</i> doesn't like when an application goes "
"
online without
authorisation.</p>
\n
"
"<p><i>VLC media player</i> can request limited information on "
"Internet, espically to get CD Covers and songs metadata or to know "
"if updates are available.</p>
\n
"
"<p><i>VLC media player</i> <b>DOES NOT</b> send or collect <b>ANY</b> information, even anonymously about your "
"<p><i>VLC media player</i> <b>DOES NOT</b> send or collect <b>ANY</b> "
"information, even anonymously about your "
"usage.</p>
\n
"
"<p>Therefore please check the following options, the default being
almost no
"
"access on the web.</p>
\n
"
)
);
"<p>Therefore please check the following options, the default being "
"a
lmost no a
ccess on the web.</p>
\n
"
)
);
text
->
setWordWrap
(
true
);
text
->
setTextFormat
(
Qt
::
RichText
);
...
...
@@ -476,6 +477,25 @@ void MainInterface::debug()
/**********************************************************************
* Handling of sizing of the components
**********************************************************************/
QSize
MainInterface
::
sizeHint
()
const
{
msg_Dbg
(
p_intf
,
"Annoying debug to remove, main sizeHint was called %i %i "
,
menuBar
()
->
size
().
height
(),
menuBar
()
->
size
().
width
()
);
QSize
tempSize
=
controls
->
sizeHint
()
+
QSize
(
100
,
menuBar
()
->
size
().
height
()
+
statusBar
()
->
size
().
height
()
);
if
(
VISIBLE
(
bgWidget
)
)
tempSize
+=
bgWidget
->
sizeHint
();
else
if
(
videoIsActive
)
tempSize
+=
videoWidget
->
size
();
if
(
!
dockPL
->
isFloating
()
&&
dockPL
->
widget
()
)
tempSize
+=
dockPL
->
widget
()
->
size
();
return
tempSize
;
}
#if 0
void MainInterface::calculateInterfaceSize()
{
...
...
@@ -563,8 +583,9 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
if
(
ret
)
{
videoIsActive
=
true
;
bool
bgWasVisible
=
false
;
/* Did we have a bg */
if
(
VISIBLE
(
bgWidget
)
)
{
bgWasVisible
=
true
;
...
...
@@ -655,9 +676,10 @@ void MainInterface::togglePlaylist()
if
(
!
playlistWidget
)
{
msg_Dbg
(
p_intf
,
"Creating a new playlist"
);
playlistWidget
=
new
PlaylistWidget
(
p_intf
);
playlistWidget
=
new
PlaylistWidget
(
p_intf
,
settings
);
if
(
bgWidget
)
CONNECT
(
playlistWidget
,
artSet
(
QString
),
bgWidget
,
setArt
(
QString
)
);
CONNECT
(
playlistWidget
,
artSet
(
QString
),
bgWidget
,
setArt
(
QString
)
);
//FIXME
/* playlistWidget->widgetSize = settings->value( "playlistSize",
...
...
@@ -671,12 +693,11 @@ void MainInterface::togglePlaylist()
msg_Dbg
(
p_intf
,
"Creating a new playlist"
);
/* Make the playlist floating is requested. Default is not. */
if
(
!
(
settings
->
value
(
"playlist-embedded"
,
true
)
).
toBool
()
);
if
(
settings
->
value
(
"playlist-floats"
,
false
).
toBool
()
);
{
msg_Dbg
(
p_intf
,
"we don't want it inside"
);
//
dockPL->setFloating( true );
dockPL
->
setFloating
(
true
);
}
}
else
{
...
...
@@ -731,13 +752,13 @@ void MainInterface::toggleMinimalView()
/* Video widget cannot do this synchronously as it runs in another thread */
/* Well, could it, actually ? Probably dangerous ... */
#if 0
void
MainInterface
::
doComponentsUpdate
()
{
calculateInterfaceSize();
resize( mainSize );
msg_Dbg
(
p_intf
,
"trying"
);
resize
(
sizeHint
()
);
}
#endif
void
MainInterface
::
toggleAdvanced
()
{
...
...
modules/gui/qt4/main_interface.hpp
View file @
b83c1d09
...
...
@@ -72,6 +72,7 @@ public:
QSystemTrayIcon
*
getSysTray
()
{
return
sysTray
;
};
QMenu
*
getSysTrayMenu
()
{
return
systrayMenu
;
};
int
getControlsVisibilityStatus
();
QSize
sizeHint
()
const
;
protected:
// void resizeEvent( QResizeEvent * );
void
dropEvent
(
QDropEvent
*
);
...
...
@@ -96,7 +97,7 @@ private:
void
handleMainUi
(
QSettings
*
);
void
handleSystray
();
void
doComponentsUpdate
();
void
createSystray
();
void
privacyDialog
(
QList
<
ConfigControl
*>
controls
);
...
...
@@ -143,7 +144,7 @@ public slots:
private
slots
:
void
debug
();
void
updateOnTimer
();
void
doComponentsUpdate
();
void
setStatus
(
int
);
void
setRate
(
int
);
void
setName
(
QString
);
...
...
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