Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
5f8020da
Commit
5f8020da
authored
Nov 24, 2007
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt4: no more calculateInterfaceSize, but sizeHint() stuff for
widget-size, 1. try from me
parent
e1fcdb24
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
20 deletions
+67
-20
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+37
-8
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+4
-2
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+25
-8
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+1
-2
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
5f8020da
...
...
@@ -123,15 +123,17 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) :
plt
.
setColor
(
QPalette
::
Active
,
QPalette
::
Window
,
Qt
::
black
);
plt
.
setColor
(
QPalette
::
Inactive
,
QPalette
::
Window
,
Qt
::
black
);
setPalette
(
plt
);
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Preferred
);
label
=
new
QLabel
;
label
->
setMaximumHeight
(
ICON
_SIZE
);
label
->
setMaximumWidth
(
ICON
_SIZE
);
label
->
setMaximumHeight
(
MAX_BG
_SIZE
);
label
->
setMaximumWidth
(
MAX_BG
_SIZE
);
label
->
setScaledContents
(
true
);
label
->
setPixmap
(
QPixmap
(
":/vlc128.png"
)
);
backgroundLayout
=
new
QHBoxLayout
;
backgroundLayout
->
addWidget
(
label
);
setLayout
(
backgroundLayout
);
updateGeometry
();
}
BackgroundWidget
::~
BackgroundWidget
()
...
...
@@ -146,19 +148,26 @@ void BackgroundWidget::setArt( QString url )
label
->
setPixmap
(
QPixmap
(
":/vlc128.png"
)
);
else
label
->
setPixmap
(
QPixmap
(
url
)
);
updateGeometry
();
}
QSize
BackgroundWidget
::
sizeHint
()
const
{
return
widgetSize
;
return
label
->
maximumSize
()
;
}
void
BackgroundWidget
::
resizeEvent
(
QResizeEvent
*
e
)
{
if
(
e
->
size
().
height
()
<
ICON_SIZE
-
1
)
if
(
e
->
size
().
height
()
<
MAX_BG_SIZE
-
1
)
{
label
->
setMaximumWidth
(
e
->
size
().
height
()
);
label
->
setMaximumHeight
(
e
->
size
().
width
()
);
}
else
label
->
setMaximumWidth
(
ICON_SIZE
);
{
label
->
setMaximumHeight
(
MAX_BG_SIZE
);
label
->
setMaximumWidth
(
MAX_BG_SIZE
);
}
}
void
BackgroundWidget
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
...
...
@@ -194,6 +203,7 @@ VisualSelector::VisualSelector( intf_thread_t *_p_i ) :
VisualSelector
::~
VisualSelector
()
{
}
void
VisualSelector
::
prev
()
...
...
@@ -332,7 +342,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
{
controlLayout
=
new
QGridLayout
(
this
);
controlLayout
->
setSpacing
(
0
);
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Minimum
);
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Fixed
);
/** The main Slider **/
slider
=
new
InputSlider
(
Qt
::
Horizontal
,
NULL
);
...
...
@@ -518,12 +528,20 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
VOLUME_MAX
/
(
AOUT_VOLUME_MAX
/
2
)
);
/* Volume control connection */
resize
(
QSize
(
400
,
60
)
);
CONNECT
(
volumeSlider
,
valueChanged
(
int
),
this
,
updateVolume
(
int
)
);
msg_Dbg
(
p_intf
,
"
size: %i - %i"
,
size
().
height
(),
size
().
width
()
);
msg_Dbg
(
p_intf
,
"
controls size: %i - %i"
,
size
().
width
(),
size
().
height
()
);
}
ControlsWidget
::~
ControlsWidget
()
{
}
QSize
ControlsWidget
::
sizeHint
()
const
{
return
QSize
(
300
,
50
);
}
void
ControlsWidget
::
stop
()
{
THEMIM
->
stop
();
...
...
@@ -596,7 +614,7 @@ void ControlsWidget::updateOnTimer()
/* Audio part */
audio_volume_t
i_volume
;
aout_VolumeGet
(
p_intf
,
&
i_volume
);
i_volume
=
(
i_volume
*
VOLUME_MAX
)
/
(
AOUT_VOLUME_MAX
/
2
)
;
i_volume
=
(
i_volume
*
VOLUME_MAX
)
/
(
AOUT_VOLUME_MAX
/
2
);
int
i_gauge
=
volumeSlider
->
value
();
b_my_volume
=
false
;
if
(
i_volume
-
i_gauge
>
1
||
i_gauge
-
i_volume
>
1
)
...
...
@@ -744,12 +762,18 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i ) :
QList
<
int
>
sizeList
;
sizeList
<<
180
<<
520
;
setSizes
(
sizeList
);
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Preferred
);
resize
(
700
,
200
);
updateGeometry
();
}
void
PlaylistWidget
::
setArt
(
QString
url
)
{
if
(
url
.
isNull
()
)
{
art
->
setPixmap
(
QPixmap
(
":/noart.png"
)
);
emit
artSet
(
url
);
}
else
if
(
prevArt
!=
url
)
{
art
->
setPixmap
(
QPixmap
(
url
)
);
...
...
@@ -758,6 +782,11 @@ void PlaylistWidget::setArt( QString url )
}
}
QSize
PlaylistWidget
::
sizeHint
()
const
{
return
QSize
(
700
,
200
);
}
PlaylistWidget
::~
PlaylistWidget
()
{
}
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
5f8020da
...
...
@@ -59,7 +59,7 @@ public:
vout_thread_t
*
p_vout
;
QSize
widgetSize
;
virtual
QSize
sizeHint
()
const
;
QSize
sizeHint
()
const
;
private:
QWidget
*
frame
;
intf_thread_t
*
p_intf
;
...
...
@@ -79,7 +79,7 @@ public:
BackgroundWidget
(
intf_thread_t
*
);
virtual
~
BackgroundWidget
();
QSize
widgetSize
;
virtual
QSize
sizeHint
()
const
;
QSize
sizeHint
()
const
;
private:
QPalette
plt
;
QLabel
*
label
;
...
...
@@ -149,6 +149,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
;
virtual
~
ControlsWidget
();
QPushButton
*
playlistButton
;
...
...
@@ -245,6 +246,7 @@ class PlaylistWidget : public QSplitter
public:
PlaylistWidget
(
intf_thread_t
*
_p_i
)
;
virtual
~
PlaylistWidget
();
QSize
sizeHint
()
const
;
private:
PLSelector
*
selector
;
PLPanel
*
rightPanel
;
...
...
modules/gui/qt4/main_interface.cpp
View file @
5f8020da
...
...
@@ -96,6 +96,7 @@ 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 */
if
(
config_GetInt
(
p_intf
,
"privacy-ask"
)
)
...
...
@@ -144,14 +145,16 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
* UI and Widgets design
**************************/
setVLCWindowsTitle
();
handleMainUi
(
setting
s
);
dockPL
=
new
QDockWidget
(
qtr
(
"Playlist"
),
thi
s
);
/* Create a Dock to get the playlist */
dockPL
=
new
QDockWidget
(
qtr
(
"Playlist"
),
thi
s
);
handleMainUi
(
setting
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
);
...
...
@@ -283,6 +286,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
// DEBUG FIXME
hide
();
updateGeometry
();
}
MainInterface
::~
MainInterface
()
...
...
@@ -363,8 +367,6 @@ void MainInterface::handleMainUi( QSettings *settings )
speedControlMenu
->
addAction
(
widgetAction
);
/* Set initial size */
resize
(
PREF_W
,
PREF_H
);
addSize
=
QSize
(
mainLayout
->
margin
()
*
2
,
PREF_H
);
/* Visualisation */
visualSelector
=
new
VisualSelector
(
p_intf
);
...
...
@@ -381,6 +383,7 @@ 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
)
...
...
@@ -396,7 +399,8 @@ void MainInterface::handleMainUi( QSettings *settings )
}
/* Finish the sizing */
setMinimumSize
(
PREF_W
,
addSize
.
height
()
);
setMinimumSize
(
PREF_W
,
PREF_H
);
updateGeometry
();
}
...
...
@@ -472,6 +476,7 @@ void MainInterface::debug()
/**********************************************************************
* Handling of sizing of the components
**********************************************************************/
#if 0
void MainInterface::calculateInterfaceSize()
{
int width = 0, height = 0;
...
...
@@ -518,6 +523,7 @@ void MainInterface::resizeEvent( QResizeEvent *e )
playlistWidget->updateGeometry();
}
}
#endif
/****************************************************************************
* Small right-click menu for rate control
...
...
@@ -577,7 +583,7 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
videoWidget
->
widgetSize
=
QSize
(
*
pi_width
,
*
pi_height
);
}
videoWidget
->
updateGeometry
();
// Needed for deinterlace
need_components_update
=
true
;
updateGeometry
()
;
}
return
ret
;
}
...
...
@@ -596,7 +602,7 @@ void MainInterface::releaseVideoSlot( void *p_win )
bgWidget
->
show
();
videoIsActive
=
false
;
need_components_update
=
true
;
updateGeometry
()
;
}
int
MainInterface
::
controlVideo
(
void
*
p_window
,
int
i_query
,
va_list
args
)
...
...
@@ -619,7 +625,7 @@ int MainInterface::controlVideo( void *p_window, int i_query, va_list args )
unsigned
int
i_height
=
va_arg
(
args
,
unsigned
int
);
videoWidget
->
widgetSize
=
QSize
(
i_width
,
i_height
);
videoWidget
->
updateGeometry
();
need_components_update
=
true
;
updateGeometry
()
;
i_ret
=
VLC_SUCCESS
;
break
;
}
...
...
@@ -676,14 +682,21 @@ void MainInterface::togglePlaylist()
{
/* toggle the display */
TOGGLEV
(
dockPL
);
resize
(
sizeHint
());
}
#if 0
doComponentsUpdate();
#endif
updateGeometry
();
}
void
MainInterface
::
undockPlaylist
()
{
dockPL
->
setFloating
(
true
);
updateGeometry
();
#if 0
doComponentsUpdate();
#endif
}
#if 0
...
...
@@ -718,11 +731,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 );
}
#endif
void
MainInterface
::
toggleAdvanced
()
{
...
...
@@ -794,11 +809,13 @@ void MainInterface::updateOnTimer()
QApplication
::
closeAllWindows
();
QApplication
::
quit
();
}
#if 0
if( need_components_update )
{
doComponentsUpdate();
need_components_update = false;
}
#endif
controls
->
updateOnTimer
();
}
...
...
modules/gui/qt4/main_interface.hpp
View file @
5f8020da
...
...
@@ -73,7 +73,7 @@ public:
QMenu
*
getSysTrayMenu
()
{
return
systrayMenu
;
};
int
getControlsVisibilityStatus
();
protected:
void
resizeEvent
(
QResizeEvent
*
);
//
void resizeEvent( QResizeEvent * );
void
dropEvent
(
QDropEvent
*
);
void
dragEnterEvent
(
QDragEnterEvent
*
);
void
dragMoveEvent
(
QDragMoveEvent
*
);
...
...
@@ -94,7 +94,6 @@ private:
bool
need_components_update
;
void
calculateInterfaceSize
();
void
handleMainUi
(
QSettings
*
);
void
handleSystray
();
void
doComponentsUpdate
();
...
...
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