Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Main
Synchronet
Commits
2e47ac98
Commit
2e47ac98
authored
7 months ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Just overhaul this who chunk of code.
parent
4f158aa2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#7146
passed
7 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
1
Pipelines
4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/uifc/uifc32.c
+40
-36
40 additions, 36 deletions
src/uifc/uifc32.c
with
40 additions
and
36 deletions
src/uifc/uifc32.c
+
40
−
36
View file @
2e47ac98
...
@@ -956,52 +956,56 @@ int ulist(uifc_winmode_t mode, int left, int top, int width, int *cur, int *bar
...
@@ -956,52 +956,56 @@ int ulist(uifc_winmode_t mode, int left, int top, int width, int *cur, int *bar
set_vmem
(
ptr
++
,
api
->
chars
->
list_separator_right
,
hclr
|
(
bclr
<<
4
),
0
);
set_vmem
(
ptr
++
,
api
->
chars
->
list_separator_right
,
hclr
|
(
bclr
<<
4
),
0
);
}
}
// Clamp cur
if
((
*
cur
)
>=
opts
)
if
((
*
cur
)
>=
opts
)
(
*
cur
)
=
opts
-
1
;
/* returned after scrolled */
*
cur
=
opts
-
1
;
/* returned after scrolled */
if
((
*
cur
)
<
0
)
*
cur
=
0
;
if
(
!
bar
)
{
if
(
!
bar
)
{
// If we don't have bar, do not allow scrolling
if
((
*
cur
)
>
height
-
vbrdrsize
-
1
)
if
((
*
cur
)
>
height
-
vbrdrsize
-
1
)
(
*
cur
)
=
height
-
vbrdrsize
-
1
;
*
cur
=
height
-
vbrdrsize
-
1
;
if
((
*
cur
)
>
opts
-
1
)
if
((
*
cur
)
>
opts
-
1
)
(
*
cur
)
=
opts
-
1
;
*
cur
=
opts
-
1
;
i
=
0
;
i
=
0
;
}
}
else
{
else
{
if
((
*
bar
)
>=
opts
)
// *bar must be strictly <= *cur
(
*
bar
)
=
opts
-
1
;
if
(
*
bar
>
*
cur
)
if
((
*
bar
)
>
height
-
vbrdrsize
-
1
)
*
bar
=
*
cur
;
(
*
bar
)
=
height
-
vbrdrsize
-
1
;
if
((
*
cur
)
==
opts
-
1
)
// *bar needs to fit in window with room for highlight
(
*
bar
)
=
height
-
vbrdrsize
-
1
;
if
((
*
bar
)
>=
height
-
vbrdrsize
)
if
((
*
bar
)
>
opts
-
1
)
*
bar
=
height
-
vbrdrsize
-
1
;
(
*
bar
)
=
opts
-
1
;
// And finally, *bar can't be negative
if
((
*
bar
)
<
0
)
if
((
*
bar
)
<
0
)
(
*
bar
)
=
0
;
*
bar
=
0
;
// Set i to the first option to display on the screen...
// Set i to the first option to display on the screen...
i
=
(
*
cur
)
-
(
*
bar
);
i
=
(
*
cur
)
-
(
*
bar
);
// If bar is too high, start with first item
if
(
i
<
0
)
{
// If there are enough options to fill the screen
*
bar
=
*
cur
;
if
((
opts
>
(
height
-
vbrdrsize
)))
{
i
=
0
;
// If the screen is not filled...
}
if
((
opts
-
i
)
<
(
height
-
vbrdrsize
))
{
// If the number of options on screen is greater than the rows on screen...
*
bar
+=
(
height
-
vbrdrsize
)
-
(
opts
-
i
);
if
((
opts
-
i
)
>
(
height
-
vbrdrsize
))
{
// This shouldn't be possible, but may as well be paranoid
*
bar
=
height
-
vbrdrsize
;
if
(
*
bar
>
*
cur
)
if
(
*
bar
>
*
cur
)
*
bar
=
*
cur
;
*
bar
=
*
cur
;
// Recalculate i since we adjusted bar
i
=
(
*
cur
)
-
(
*
bar
);
i
=
(
*
cur
)
-
(
*
bar
);
}
}
// If there are enough options to fill the screen, but the screen is not filled...
}
if
((
opts
>
(
height
-
vbrdrsize
))
&&
((
opts
-
i
)
<
(
height
-
vbrdrsize
)))
{
else
{
*
bar
+=
(
height
-
vbrdrsize
)
-
(
opts
-
i
);
// Show whole menu
i
=
(
*
cur
)
-
(
*
bar
);
*
bar
=
*
cur
;
i
=
0
;
}
}
}
}
if
((
*
cur
)
<
0
)
(
*
cur
)
=
0
;
j
=
0
;
j
=
0
;
if
(
i
<
0
)
i
=
0
;
longopt
=
0
;
longopt
=
0
;
while
(
j
<
height
-
vbrdrsize
)
{
while
(
j
<
height
-
vbrdrsize
)
{
if
(
!
(
mode
&
WIN_NOBRDR
))
if
(
!
(
mode
&
WIN_NOBRDR
))
...
...
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