Menu-item Alt accelerators double-apply styles
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in StyleMenuBuilder.kt by reading getStyleCategories and the addLoadoutListener filter it interacts with. Remove the per-item Alt accelerators so menu items use accelerator 0; done when the filter is the only Alt+1–8 mechanism applying styles.
Written by the indexing model from the issue text.
Description
Problem
File StyleMenuBuilder.kt — getStyleCategories (lines 90, 130–155) and currentLoadedStyle (lines 331–337)
double-fire bug. getStyleCategories attaches Alt+1–9 accelerators to the first nine menu items whose parent category/subcategory matches the current loadout. When a nested loadout is active, those per-item menu accelerators and the Alt+1–8 Display filter in addLoadoutListener both fire on the same keystroke, applying the style twice.
Fix remove the per-item accelerator logic entirely; every menu item uses accelerator 0. The Alt+1–8 Display filter becomes the single apply mechanism.
// before (relevant excerpt)
var cont = 1
...
id = id.substring(id.lastIndexOf('/') + 1)
val myCurrentLoadout = BBIni.propertyFileManager.getProperty(CURRENT_STYLE_LOADOUT_CATEGORY, "")
//TODO: Re-add shortcut functionality
//puttting shortcut in menu
val tempComp: String = if (myCurrentLoadout.contains("/")) "$cat/$afterCat" else if (afterCat == id) cat else "$cat/$afterCat"
if (myCurrentLoadout == tempComp && cont <= 9) {
subMenu!!.addItem(
lhb[style.name], SWT.ALT + '0'.code + cont
) { e: BBSelectionData -> onStyleSelect.accept(BBStyleSelection(style, e.widget)) }
cont++
} else {
subMenu!!.addItem(
lhb[style.name], 0
) { e: BBSelectionData -> onStyleSelect.accept(BBStyleSelection(style, e.widget)) }
}
// after (relevant excerpt)
val styles = styleDefs.styles
...
// Styles are applied with Alt+1-8 from the addLoadoutListener filter keyed to the
// current style loadout, so menu items carry no per-item Alt accelerators
subMenu!!.addItem(
lhb[style.name], 0
) { e: BBSelectionData -> onStyleSelect.accept(BBStyleSelection(style, e.widget)) }
- Dominant language
- Kotlin
- Stars
- 15
- Forks
- 11
- Avg merge
- 13h 16m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aphtech/brailleblaster
-
Multiple changes in Page Properties and Page Numbers are not saved togetherPossibly taken @jage9 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aphtech/brailleblaster#167 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
aphtech/brailleblaster#163 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aphtech/brailleblaster#152 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aphtech/brailleblaster#149 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
aphtech/brailleblaster#145 ·
Maintainers usually reply within 1 day
All issues in aphtech/brailleblaster
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
fix: retain the best partial noise-correction solutionPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
world-federation-of-advertisers/cross-media-measurement#4653 ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kabirvashisht4-glitch/Vet#22 ·
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
djazairdev/wilayas#23 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lysine-dev/okhttp#9788 ·
Maintainers usually reply within 1 day