Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
orbclient
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
redox-os
orbclient
Commits
18400809
Commit
18400809
authored
Feb 02, 2021
by
Florian Blasius
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
3c034438
Pipeline
#9061
passed with stage
in 3 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
26 deletions
+5
-26
src/sys/web.rs
src/sys/web.rs
+5
-26
No files found.
src/sys/web.rs
View file @
18400809
...
...
@@ -44,13 +44,11 @@ pub struct Window {
window_async
:
bool
,
/// Drawing mode
mode
:
Cell
<
Mode
>
,
// /// The inner renderer
// inner: sdl2::render::WindowCanvas,
/// Mouse in relative mode
mouse_relative
:
bool
,
/// Content of the last drop (file | text) operation
drop_content
:
RefCell
<
Option
<
String
>>
,
/// inner frame buffer
data
:
Vec
<
Color
>
,
/// html canvas that represents the window
canvas
:
web_sys
::
HtmlCanvasElement
,
...
...
@@ -62,14 +60,6 @@ pub struct Window {
button_state
:
Rc
<
RefCell
<
(
bool
,
bool
,
bool
)
>>
,
}
// impl Drop for Window {
// fn drop(&mut self) {
// unsafe {
// cleanup();
// }
// }
// }
impl
Renderer
for
Window
{
/// Get width
fn
width
(
&
self
)
->
u32
{
...
...
@@ -134,20 +124,7 @@ impl Window {
title
:
&
str
,
flags
:
&
[
WindowFlag
],
)
->
Option
<
Self
>
{
// match flag {
// WindowFlag::Async => window_async = true,
// WindowFlag::Back => _back = true,
// WindowFlag::Front => _front = true,
// WindowFlag::Borderless => borderless = true,
// WindowFlag::Resizable => resizable = true,
// WindowFlag::Transparent => _transparent = true,
// WindowFlag::Unclosable => _unclosable = true,
// }
// }
// if resizable {
// builder.resizable();
// }
// todo resizable.
// set the window title to document title (browser tab)
if
let
Ok
(
document
)
=
document
()
{
...
...
@@ -368,7 +345,9 @@ impl Window {
pub
fn
set_mouse_grab
(
&
mut
self
,
grab
:
bool
)
{}
/// Set mouse relative mode
pub
fn
set_mouse_relative
(
&
mut
self
,
relative
:
bool
)
{}
pub
fn
set_mouse_relative
(
&
mut
self
,
relative
:
bool
)
{
self
.mouse_relative
=
relative
;
}
/// Set position
pub
fn
set_pos
(
&
mut
self
,
x
:
i32
,
y
:
i32
)
{
...
...
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