Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4839,6 +4839,9 @@
"message": "Uploaded all {{length}} characters to the OSD"
},

"osdToggleOrientation": {
"message": "Orientation"
},
"osdSetupSave": {
"message": "Save"
},
Expand Down
2 changes: 1 addition & 1 deletion src/css/tabs/osd.less
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ button {
@media all and (max-width: 575px) {
.tab-osd {
.osd-preview {
min-width: 100%;
width: fit-content;
order: 1;
}
.osd-feature {
Expand Down
8 changes: 8 additions & 0 deletions src/js/tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2605,6 +2605,8 @@ osd.initialize = function(callback) {
// must invoke before i18n.localizePage() since it adds translation keys for expected logo size
LogoManager.init(FONT, SYM.LOGO);

$('div.btn.orientation').toggle(GUI.isCordova());

// translate to user-selected language
i18n.localizePage();

Expand Down Expand Up @@ -3273,6 +3275,8 @@ osd.initialize = function(callback) {
self.analyticsChanges = {};
});

$('a.orientation').on('click', () => screen.orientation.lock(screen.orientation.type.startsWith("portrait") ? "landscape" : "portrait"));

// font preview window
const fontPreviewElement = $('.font-preview');

Expand Down Expand Up @@ -3401,6 +3405,10 @@ osd.cleanup = function(callback) {
OSD.GUI.fontManager.destroy();
}

if (GUI.isCordova()) {
window.screen.orientation.lock("portrait");
}

// unbind "global" events
$(document).unbind('keypress');
$(document).off('click', 'span.progressLabel a');
Expand Down
3 changes: 3 additions & 0 deletions src/tabs/osd.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ <h3 i18n="osdSetupCustomLogoInfoTitle"></h3>

<div class="supported hide">
<div class="content_toolbar" style="left:0;">
<div class="btn orientation">
<a class="orientation" href="#" i18n="osdToggleOrientation"></a>
</div>
<div class="btn">
<a class="requires-max7456-font-device-detected fonts" id="fontmanager" href="#" i18n="osdSetupFontManager"></a>
</div>
Expand Down