Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
aefb8674
Commit
aefb8674
authored
Dec 07, 2006
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Center the FSPanel properly on the selected screen.
parent
dc0416e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
32 deletions
+36
-32
modules/gui/macosx/fspanel.h
modules/gui/macosx/fspanel.h
+1
-0
modules/gui/macosx/fspanel.m
modules/gui/macosx/fspanel.m
+35
-32
No files found.
modules/gui/macosx/fspanel.h
View file @
aefb8674
...
...
@@ -30,6 +30,7 @@
BOOL
b_keptVisible
;
BOOL
b_alreadyCounting
;
int
i_timeToKeepVisibleInSec
;
int
i_outputScreen
;
BOOL
b_displayed
;
BOOL
b_voutWasUpdated
;
...
...
modules/gui/macosx/fspanel.m
View file @
aefb8674
...
...
@@ -42,7 +42,7 @@
backing
:(
NSBackingStoreType
)
bufferingType
defer
:(
BOOL
)
flag
{
id
win
=
[
super
initWithContentRect
:
contentRect
styleMask
:
NSTexturedBackgroundWindowMask
backing
:
bufferingType
defer
:
flag
];
id
win
=
[
super
initWithContentRect
:
contentRect
styleMask
:
NSTexturedBackgroundWindowMask
backing
:
bufferingType
defer
:
flag
];
[
win
setOpaque
:
NO
];
[
win
setHasShadow
:
NO
];
[
win
setBackgroundColor
:[
NSColor
clearColor
]];
...
...
@@ -51,31 +51,14 @@
[
win
setLevel
:
NSFloatingWindowLevel
];
[
win
setAlphaValue
:
0
.
0
];
/* centre the panel in the lower third of the screen */
NSPoint
theCoordinate
;
NSRect
theScreensFrame
;
NSRect
theWindowsFrame
;
int
i_outputScreen
;
i_outputScreen
=
var_GetInteger
(
VLCIntf
,
"video-device"
);
if
(
i_outputScreen
<=
0
||
i_outputScreen
>
(
signed
int
)[[
NSScreen
screens
]
count
]
)
/* invalid preferences or none specified, using main screen */
theScreensFrame
=
[[
NSScreen
mainScreen
]
frame
];
else
/* user-defined screen */
theScreensFrame
=
[[[
NSScreen
screens
]
objectAtIndex
:
i_outputScreen
]
frame
];
theWindowsFrame
=
[
win
frame
];
theCoordinate
.
x
=
(
theScreensFrame
.
size
.
width
-
theWindowsFrame
.
size
.
width
)
/
2
;
theCoordinate
.
y
=
(
theScreensFrame
.
size
.
height
/
3
)
-
theWindowsFrame
.
size
.
height
;
[
win
setFrameTopLeftPoint
:
theCoordinate
];
[
win
center
];
return
win
;
}
-
(
void
)
awakeFromNib
{
[
self
setContentView
:[[
VLCFSPanelView
alloc
]
initWithFrame
:
[
self
frame
]]];
BOOL
isInside
=
(
NSPointInRect
([
NSEvent
mouseLocation
],[
self
frame
]));
BOOL
isInside
=
(
NSPointInRect
([
NSEvent
mouseLocation
],[
self
frame
]));
[[
self
contentView
]
addTrackingRect
:[[
self
contentView
]
bounds
]
owner
:
self
userData
:
nil
assumeInside
:
isInside
];
if
(
isInside
)
[
self
mouseEntered
:
NULL
];
...
...
@@ -102,6 +85,29 @@
[
super
dealloc
];
}
-
(
void
)
center
{
/* centre the panel in the lower third of the screen */
NSPoint
theCoordinate
;
NSRect
theScreensFrame
;
NSRect
theWindowsFrame
;
i_outputScreen
=
var_GetInteger
(
VLCIntf
->
p_vlc
,
"video-device"
);
if
(
i_outputScreen
<=
0
||
i_outputScreen
>
(
signed
int
)[[
NSScreen
screens
]
count
]
)
/* invalid preferences or none specified, using main screen */
theScreensFrame
=
[[
NSScreen
mainScreen
]
frame
];
else
/* user-defined screen */
theScreensFrame
=
[[[
NSScreen
screens
]
objectAtIndex
:
i_outputScreen
-
1
]
frame
];
theWindowsFrame
=
[
self
frame
];
theCoordinate
.
x
=
(
theScreensFrame
.
size
.
width
-
theWindowsFrame
.
size
.
width
)
/
2
+
theScreensFrame
.
origin
.
x
;
theCoordinate
.
y
=
(
theScreensFrame
.
size
.
height
/
3
)
-
theWindowsFrame
.
size
.
height
+
theScreensFrame
.
origin
.
y
;
[
self
setFrameTopLeftPoint
:
theCoordinate
];
}
-
(
void
)
setPlay
{
[[
self
contentView
]
setPlay
];
...
...
@@ -198,6 +204,9 @@
-
(
void
)
fadeIn
{
if
(
i_outputScreen
!=
var_GetInteger
(
VLCIntf
->
p_vlc
,
"video-device"
)
)
[
self
center
];
if
(
[
self
alphaValue
]
<
1
.
0
)
{
if
(
!
[
self
fadeTimer
])
...
...
@@ -407,20 +416,14 @@
-
(
void
)
setPlay
{
NSImage
*
image
;
image
=
[
NSImage
imageNamed
:
@"fs_play"
];
[
o_play
setImage
:
image
];
image
=
[
NSImage
imageNamed
:
@"fs_play_highlight"
];
[
o_play
setAlternateImage
:
image
];
[
o_play
setImage
:[
NSImage
imageNamed
:
@"fs_play"
]];
[
o_play
setAlternateImage
:
[
NSImage
imageNamed
:
@"fs_play_highlight"
]];
}
-
(
void
)
setPause
{
NSImage
*
image
;
image
=
[
NSImage
imageNamed
:
@"fs_pause"
];
[
o_play
setImage
:
image
];
image
=
[
NSImage
imageNamed
:
@"fs_pause_highlight"
];
[
o_play
setAlternateImage
:
image
];
[
o_play
setImage
:
[
NSImage
imageNamed
:
@"fs_pause"
]];
[
o_play
setAlternateImage
:
[
NSImage
imageNamed
:
@"fs_pause_highlight"
]];
}
-
(
void
)
setStreamTitle
:(
NSString
*
)
o_title
...
...
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