Skip to content

Commit 4b0d446

Browse files
authored
Fix OSD (HD) display overflow on Android (#3241)
* Fix OSD (HD) display overflow on Android * Add button for OSD tab orientation (Android)
1 parent b407740 commit 4b0d446

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4839,6 +4839,9 @@
48394839
"message": "Uploaded all {{length}} characters to the OSD"
48404840
},
48414841

4842+
"osdToggleOrientation": {
4843+
"message": "Orientation"
4844+
},
48424845
"osdSetupSave": {
48434846
"message": "Save"
48444847
},

src/css/tabs/osd.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ button {
541541
@media all and (max-width: 575px) {
542542
.tab-osd {
543543
.osd-preview {
544-
min-width: 100%;
544+
width: fit-content;
545545
order: 1;
546546
}
547547
.osd-feature {

src/js/tabs/osd.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,8 @@ osd.initialize = function(callback) {
26092609
// must invoke before i18n.localizePage() since it adds translation keys for expected logo size
26102610
LogoManager.init(FONT, SYM.LOGO);
26112611

2612+
$('div.btn.orientation').toggle(GUI.isCordova());
2613+
26122614
// translate to user-selected language
26132615
i18n.localizePage();
26142616

@@ -3281,6 +3283,8 @@ osd.initialize = function(callback) {
32813283
self.analyticsChanges = {};
32823284
});
32833285

3286+
$('a.orientation').on('click', () => screen.orientation.lock(screen.orientation.type.startsWith("portrait") ? "landscape" : "portrait"));
3287+
32843288
// font preview window
32853289
const fontPreviewElement = $('.font-preview');
32863290

@@ -3411,6 +3415,10 @@ osd.cleanup = function(callback) {
34113415
OSD.GUI.fontManager.destroy();
34123416
}
34133417

3418+
if (GUI.isCordova()) {
3419+
window.screen.orientation.lock("portrait");
3420+
}
3421+
34143422
// unbind "global" events
34153423
$(document).unbind('keypress');
34163424
$(document).off('click', 'span.progressLabel a');

src/tabs/osd.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ <h3 i18n="osdSetupCustomLogoInfoTitle"></h3>
197197

198198
<div class="supported hide">
199199
<div class="content_toolbar" style="left:0;">
200+
<div class="btn orientation">
201+
<a class="orientation" href="#" i18n="osdToggleOrientation"></a>
202+
</div>
200203
<div class="btn">
201204
<a class="requires-max7456-font-device-detected fonts" id="fontmanager" href="#" i18n="osdSetupFontManager"></a>
202205
</div>

0 commit comments

Comments
 (0)