Skip to content

Commit c233db3

Browse files
committed
Enable/Disable all button for OSD screen
1 parent bd757f4 commit c233db3

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

_locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,6 +2309,9 @@
23092309
"osdSetupElementsTitle": {
23102310
"message": "Elements"
23112311
},
2312+
"osdSetupElementsSwitchAll": {
2313+
"message": "Switch all"
2314+
},
23122315
"osdSetupPreviewTitle": {
23132316
"message": "Preview (drag to change position)"
23142317
},

tabs/osd.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@
316316
background: rgba(255,255,255,0.4);
317317
}
318318

319+
.tab-osd .switch-all-elements {
320+
float: right;
321+
}
322+
319323
.tab-osd .preview .char[draggable="true"] {
320324
cursor: move;
321325
}

tabs/osd.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ <h1 class="tab_title">
1818
<div class="spacer_right">
1919
<div class="gui_box grey">
2020
<div class="gui_box_titlebar" style="margin-bottom: 0px;">
21-
<div class="spacer_box_title" i18n="osdSetupElementsTitle" />
21+
<div class="spacer_box_title">
22+
<span i18n="osdSetupElementsTitle" />
23+
<span class="switch-all-elements">
24+
<label for="switch-all"><span i18n="osdSetupElementsSwitchAll" />: </label>
25+
<input type="checkbox" checked id="switch-all" name="switch-all" class="togglesmall"></input>
26+
</span>
27+
</div>
2228
</div>
2329
<div class="spacer_box">
2430
<div id="element-fields" class="switchable-fields"></div>

tabs/osd.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,12 @@ TABS.osd.initialize = function (callback) {
15321532
}
15331533
});
15341534

1535+
//Switch all elements
1536+
$('input#switch-all').change(function () {
1537+
var new_state = $(this).is(':checked');
1538+
$('#element-fields input[type=checkbox]').prop('checked', new_state).change();
1539+
})
1540+
15351541
$(document).on('click', 'span.progressLabel a.save_font', function () {
15361542
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight', accepts: [{extensions: ['mcm']}]}, function (fileEntry) {
15371543
if (chrome.runtime.lastError) {

0 commit comments

Comments
 (0)