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
51d11338
Commit
51d11338
authored
Mar 09, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: use qt QStyle to center dialogs on screen
parent
91392b25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
16 deletions
+2
-16
modules/gui/qt4/util/qvlcframe.hpp
modules/gui/qt4/util/qvlcframe.hpp
+2
-16
No files found.
modules/gui/qt4/util/qvlcframe.hpp
View file @
51d11338
...
@@ -26,14 +26,13 @@
...
@@ -26,14 +26,13 @@
#include <QWidget>
#include <QWidget>
#include <QDialog>
#include <QDialog>
#include <QSpacerItem>
#include <QHBoxLayout>
#include <QHBoxLayout>
#include <QApplication>
#include <QApplication>
#include <QMainWindow>
#include <QMainWindow>
#include <QPushButton>
#include <QKeyEvent>
#include <QKeyEvent>
#include <QDesktopWidget>
#include <QDesktopWidget>
#include <QSettings>
#include <QSettings>
#include <QStyle>
#include "qt4.hpp"
#include "qt4.hpp"
...
@@ -76,7 +75,7 @@ class QVLCTools
...
@@ -76,7 +75,7 @@ class QVLCTools
widget
->
resize
(
defSize
);
widget
->
resize
(
defSize
);
if
(
defPos
.
x
()
==
0
&&
defPos
.
y
()
==
0
)
if
(
defPos
.
x
()
==
0
&&
defPos
.
y
()
==
0
)
centerWidgetOnScreen
(
widget
);
widget
->
setGeometry
(
QStyle
::
alignedRect
(
Qt
::
LeftToRight
,
Qt
::
AlignCenter
,
widget
->
size
(),
qApp
->
desktop
()
->
availableGeometry
())
);
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -97,19 +96,6 @@ class QVLCTools
...
@@ -97,19 +96,6 @@ class QVLCTools
return
defaultUsed
;
return
defaultUsed
;
}
}
/*
call this method for a window or dialog to show it centred on
current screen
*/
static
void
centerWidgetOnScreen
(
QWidget
*
widget
)
{
QDesktopWidget
*
const
desktop
=
QApplication
::
desktop
();
QRect
screenRect
=
desktop
->
availableGeometry
(
widget
);
QPoint
p1
=
widget
->
frameGeometry
().
center
();
widget
->
move
(
screenRect
.
center
()
-
p1
);
}
};
};
class
QVLCFrame
:
public
QWidget
class
QVLCFrame
:
public
QWidget
...
...
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