Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
451
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
4c047ac4
Commit
4c047ac4
authored
1 year ago
by
Benjamin Arnaud
Committed by
Steve Lhomme
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
qml/TopBar: Code cleanup
No functional changes.
parent
da58730d
No related branches found
Branches containing commit
No related tags found
1 merge request
!3749
qml/TopBar: Code cleanup
Pipeline
#351071
passed with stage
in 16 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gui/qt/player/qml/TopBar.qml
+31
-24
31 additions, 24 deletions
modules/gui/qt/player/qml/TopBar.qml
with
31 additions
and
24 deletions
modules/gui/qt/player/qml/TopBar.qml
+
31
−
24
View file @
4c047ac4
...
...
@@ -35,20 +35,25 @@ FocusScope{
/* required */
property
int
textWidth
property
int
reservedHeight
:
0
property
int
topMargin
:
0
property
int
sideMargin
:
0
property
string
title
property
bool
showCSD
:
false
property
bool
showToolbar
:
false
property
bool
pinControls
:
false
property
int
topMargin
:
0
property
int
sideMargin
:
0
property
int
reservedHeight
:
0
readonly
property
ColorContext
colorContext
:
ColorContext
{
id
:
theme
colorSet
:
ColorContext
.
Window
}
// Private
property
bool
_showTopBar
:
(
pinControls
===
false
||
root
.
showToolbar
===
false
)
property
bool
_showTopBar
:
(
pinControls
===
false
||
showToolbar
===
false
)
property
bool
_showCenterText
:
(
pinControls
&&
showToolbar
===
false
&&
showCSD
)
...
...
@@ -64,21 +69,26 @@ FocusScope{
signal
requestLockUnlockAutoHide
(
bool
lock
)
signal
backRequested
()
// Settings
Accessible.name
:
I18n
.
qtr
(
"
Player topbar
"
)
Accessible.role
:
Accessible
.
ToolBar
Component.onCompleted
:
root
.
_layout
()
// Events
onShowCSDChanged
:
root
.
_layout
()
onPinControlsChanged
:
root
.
_layout
()
onShowToolbarChanged
:
root
.
_layout
()
onTopMarginChanged
:
root
.
_layout
()
onSideMarginChanged
:
root
.
_layout
()
Component.onCompleted
:
_layout
()
onShowCSDChanged
:
_layout
()
onPinControlsChanged
:
_layout
()
onShowToolbarChanged
:
_layout
()
onTopMarginChanged
:
_layout
()
onSideMarginChanged
:
_layout
()
on_ShowTopBarChanged
:
_layout
()
on_ShowCenterText
:
_layout
()
// Functions
function
_layoutLine
(
c1
,
c2
,
offset
)
{
let
c1Height
=
c1
!==
undefined
?
c1
.
implicitHeight
:
0
...
...
@@ -107,9 +117,9 @@ FocusScope{
//FIXME: if CSD will be weirdly placed if application safe-area are used,
//nota that if you need a safe area (kiosk mode), you probably don't need CSD
function
_layout
()
{
let
offset
=
root
.
topMargin
let
offset
=
topMargin
if
(
root
.
_showCenterText
)
{
if
(
_showCenterText
)
{
//place everything on one line
//csdDecorations.implicitHeight gets overwritten when the height is set,
//VLCStyle.icon_normal is its initial value
...
...
@@ -124,10 +134,10 @@ FocusScope{
playlistGroup
.
height
=
lineHeight
playlistGroup
.
anchors
.
topMargin
=
0
playlistGroup
.
extraRightMargin
=
Qt
.
binding
(
function
()
{
return
root
.
width
-
csdDecorations
.
x
})
playlistGroup
.
extraRightMargin
=
Qt
.
binding
(
function
()
{
return
width
-
csdDecorations
.
x
})
root
.
implicitHeight
=
lineHeight
implicitHeight
=
lineHeight
offset
+=
lineHeight
}
else
{
...
...
@@ -137,11 +147,11 @@ FocusScope{
let
right
=
undefined
let
logoPlaced
=
false
if
(
root
.
showToolbar
)
{
if
(
showToolbar
)
{
left
=
menubar
}
if
(
root
.
showCSD
)
{
if
(
showCSD
)
{
right
=
csdDecorations
if
(
!
left
)
{
left
=
logoOrResume
...
...
@@ -150,9 +160,9 @@ FocusScope{
}
if
(
!!
left
||
!!
right
)
{
offset
+=
root
.
_layoutLine
(
left
,
right
,
offset
)
offset
+=
_layoutLine
(
left
,
right
,
offset
)
if
(
root
.
showCSD
)
{
if
(
showCSD
)
{
tapNDrag
.
height
=
offset
}
}
...
...
@@ -169,14 +179,11 @@ FocusScope{
offset
+=
_layoutLine
(
left
,
right
,
offset
)
}
root
.
implicitHeight
=
offset
implicitHeight
=
offset
reservedHeight
=
offset
}
readonly
property
ColorContext
colorContext
:
ColorContext
{
id
:
theme
colorSet
:
ColorContext
.
Window
}
// Children
//drag and dbl click the titlebar in CSD mode
Loader
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment