Skip to content

Commit

Permalink
Minor: Add option to reject click interactions with SS when ISS is en…
Browse files Browse the repository at this point in the history
…abled

* Point 4 of issue #45
  • Loading branch information
fofajardo committed Jun 22, 2018
1 parent 11b6616 commit 960262c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
9 changes: 7 additions & 2 deletions content/_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,16 @@ function aios_setTargets() {
var prefInfotip = false,
ptReverse = false,
enable_rightclick = false,
switchTip = true;
switchTip = true,
inv_switch = false,
inv_noclick = false;
try {
prefInfotip = AiOS_HELPER.prefBranchAiOS.getBoolPref("infotips");
ptReverse = AiOS_HELPER.prefBranchAiOS.getBoolPref("paneltab.reverse");
enable_rightclick = AiOS_HELPER.prefBranchAiOS.getBoolPref("rightclick");
switchTip = AiOS_HELPER.prefBranchAiOS.getBoolPref("switchtip");
inv_switch = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.inv');
inv_noclick = AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.invnoclick');

if (prefInfotip) {
if (AiOS_Objects.sbSwitch)
Expand All @@ -490,7 +494,8 @@ function aios_setTargets() {
}
}

if (!switchTip)
// If tooltip for the switch is disabled/it's not logical to show the tooltip, remove it
if (!switchTip || (inv_switch && inv_noclick))
if (AiOS_Objects.sbSwitch)
AiOS_Objects.sbSwitch.removeAttribute('tooltip');

Expand Down
3 changes: 3 additions & 0 deletions content/aios_old.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ var AiOS = {
* => Called by onClick() of the switcher
*/
controlSwitch: function (ev, which) {
// If the invisible sidebar switch is enabled and no click is true, reject any click interactions
if (AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.inv') && AiOS_HELPER.prefBranchAiOS.getBoolPref('gen.switch.invnoclick'))
return;
// Left click => metaKey = Mac
if (ev.button == 0 && (!ev.shiftKey && !ev.ctrlKey && !ev.metaKey)) {
AiOS.toggleSidebar(which);
Expand Down
5 changes: 5 additions & 0 deletions content/prefs/prefs.xul
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
<preference id="SSInvMouse"
type="bool"
name="extensions.aios.gen.switch.invmouse" />
<preference id="SSInvNoClick"
type="bool"
name="extensions.aios.gen.switch.invnoclick" />

<preference id="SSDrag"
type="bool"
Expand Down Expand Up @@ -631,6 +634,8 @@
label="&gen.switch.invhover;" />
<checkbox preference="SSInvMouse"
label="&gen.switch.invmouse;" />
<checkbox preference="SSInvNoClick"
label="&gen.switch.invnoclick;" />
</vbox>

<grid flex="1"
Expand Down
1 change: 1 addition & 0 deletions defaults/preferences/aios.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pref("extensions.aios.gen.switch.inv", false);
pref("extensions.aios.gen.switch.invmax", false);
pref("extensions.aios.gen.switch.invhover", true);
pref("extensions.aios.gen.switch.invmouse", true);
pref("extensions.aios.gen.switch.invnoclick", false);

pref("extensions.aios.cmode.key", 2);
pref("extensions.aios.cmode.switch", 2);
Expand Down
1 change: 1 addition & 0 deletions locale/en-US/prefs.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<!ENTITY gen.switch.onhover "When the mouse is above the invisible sidebar switch:">
<!ENTITY gen.switch.invhover "Show visual feedback or highlight">
<!ENTITY gen.switch.invmouse "Show a hand cursor">
<!ENTITY gen.switch.invnoclick "Reject click interactions with the sidebar switch">
<!ENTITY gen.switch.delayshow "Show Delay">
<!ENTITY gen.switch.delayhide "Hide Delay">
<!ENTITY gen.switch.delay "Delay">
Expand Down

0 comments on commit 960262c

Please sign in to comment.