-
-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fine tune of navigation paging buttons #2459
Conversation
I didn't modify this because it's allowing to go from first to last tile in one touch
I don't like the tuning, it's making the zone harder to click. |
I already stated in the PR that hiding the buttons isn't working fine and make the screen flicker. AT first I did that approach and it was so boring to see the screen flicker that I went back to the classic button set_text hack, which does not make the screen flicker. At some point I even asked myself if there was a need at all to hide anything, and just keep the buttons displayed. Finally I decided to keep the text hiding behavior so it's indicating the start and the end of the list. |
@@ -60,6 +60,8 @@ BtnGridView::BtnGridView( | |||
|
|||
add_child(&button_pgup); | |||
add_child(&button_pgdown); | |||
|
|||
show_hide_arrows(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it needed here ?
@@ -78,8 +80,15 @@ void BtnGridView::set_parent_rect(const Rect new_parent_rect) { | |||
|
|||
displayed_max = (parent_rect().size().height() / button_h); | |||
|
|||
button_pgup.set_parent_rect({0, (Coord)(displayed_max * button_h), 120, 16}); | |||
button_pgdown.set_parent_rect({120, (Coord)(displayed_max * button_h), 120, 16}); | |||
button_pgup.set_parent_rect({0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not for it. It's making the buttons too little
((rows_ == 2) ? 120 : 80), | ||
16}); | ||
|
||
button_pgdown.set_parent_rect({((rows_ == 2) ? 120 : 80), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not for it. It's making the buttons too little
@@ -183,16 +192,26 @@ void BtnGridView::insert_item(const GridItem& new_item, size_t position, bool in | |||
} | |||
|
|||
void BtnGridView::show_hide_arrows() { | |||
portapack::async_tx_enabled = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When debug is done, remove it from code please
button_pgup.hidden(true); | ||
button_pgdown.hidden(true); | ||
} else { | ||
button_pgup.hidden(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it going to force the display of both arrows whatever the highlighted position is, just because the menu_item.size is bigger than the displayed size ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that else is superfluous
set_arrow_down_enabled(false); | ||
} else { | ||
set_arrow_down_enabled(true); | ||
} | ||
|
||
if (menu_items.size() < displayed_max) { // if the tiles isn't fullfilled this screen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment in the PR. Plus it's double checked. See, you're already checking it on line 201
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But ok, we can keep this one. Without the else.
if (highlighted_item == 0) { | ||
set_arrow_up_enabled(false); | ||
} else { | ||
set_arrow_up_enabled(true); | ||
} | ||
if (highlighted_item == (menu_items.size() - 1)) { | ||
if (highlighted_item == (menu_items.size() - 1) || menu_items.size() < displayed_max) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove menu_items.size() < displayed_max from here, you are checking it just after
Thanks for the review!
I see, since you designed on purpose then let's keep it
Sure, it looks a bit better but yes it could be hard to touch Since this PR mainly has these two changes and i think I can close this for now |
tuned
side notes
BEFORE:
AFTER:
BEFORE:
AFTER: