Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
orbutils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nick Thomas
orbutils
Commits
e80a5ee2
Commit
e80a5ee2
authored
8 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Fix launcher clicks by waiting until release
parent
33576b7a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/launcher/main.rs
+12
-3
12 additions, 3 deletions
src/launcher/main.rs
with
12 additions
and
3 deletions
src/launcher/main.rs
+
12
−
3
View file @
e80a5ee2
...
...
@@ -141,6 +141,7 @@ fn bar_main() {
let
mut
window
=
Window
::
new
(
0
,
height
as
i32
-
32
,
width
,
32
,
""
)
.expect
(
"launcher: failed to open window"
);
let
mut
selected
=
-
1
;
let
mut
last_left_button
=
false
;
draw
(
&
mut
window
,
&
packages
,
&
start
,
&
shutdown
,
selected
);
'running
:
loop
{
...
...
@@ -188,7 +189,7 @@ fn bar_main() {
draw
(
&
mut
window
,
&
packages
,
&
start
,
&
shutdown
,
selected
);
}
if
mouse_event
.left_button
{
if
!
mouse_event
.left_button
&&
last_left_button
{
let
mut
i
=
0
;
if
i
==
selected
{
...
...
@@ -197,6 +198,7 @@ fn bar_main() {
let
font
=
Font
::
find
(
None
,
None
,
None
)
.unwrap
();
let
mut
selected
=
-
1
;
let
mut
last_left_button
=
false
;
draw_chooser
(
&
mut
start_window
,
&
font
,
&
packages
,
selected
);
'start_choosing
:
loop
{
...
...
@@ -218,7 +220,7 @@ fn bar_main() {
draw_chooser
(
&
mut
start_window
,
&
font
,
&
packages
,
selected
);
}
if
mouse_event
.left_button
{
if
!
mouse_event
.left_button
&&
last_left_button
{
let
mut
y
=
0
;
for
package
in
packages
.iter
()
{
if
mouse_event
.y
>=
y
&&
mouse_event
.y
<
y
+
32
{
...
...
@@ -231,6 +233,8 @@ fn bar_main() {
y
+=
32
;
}
}
last_left_button
=
mouse_event
.left_button
;
},
EventOption
::
Key
(
key_event
)
=>
{
match
key_event
.scancode
{
...
...
@@ -263,6 +267,8 @@ fn bar_main() {
break
'running
;
}
}
last_left_button
=
mouse_event
.left_button
;
},
EventOption
::
Quit
(
_
)
=>
break
'running
,
_
=>
()
...
...
@@ -312,6 +318,7 @@ fn chooser_main(paths: env::Args) {
let
font
=
Font
::
find
(
None
,
None
,
None
)
.expect
(
"launcher: failed to open font"
);
let
mut
selected
=
-
1
;
let
mut
last_left_button
=
false
;
draw_chooser
(
&
mut
window
,
&
font
,
&
packages
,
selected
);
'choosing
:
loop
{
...
...
@@ -333,7 +340,7 @@ fn chooser_main(paths: env::Args) {
draw_chooser
(
&
mut
window
,
&
font
,
&
packages
,
selected
);
}
if
mouse_event
.left_button
{
if
!
mouse_event
.left_button
&&
last_left_button
{
let
mut
y
=
0
;
for
package
in
packages
.iter
()
{
if
mouse_event
.y
>=
y
&&
mouse_event
.y
<
y
+
32
{
...
...
@@ -345,6 +352,8 @@ fn chooser_main(paths: env::Args) {
y
+=
32
;
}
}
last_left_button
=
mouse_event
.left_button
;
},
EventOption
::
Quit
(
_
)
=>
break
'choosing
,
_
=>
()
...
...
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