Skip to content

Commit d92a49a

Browse files
authored
Merge pull request #2916 from McGiverGim/osd_preview_resizable
Make OSD screen bigger if possible
2 parents abdcbc6 + ec7822f commit d92a49a

File tree

5 files changed

+52
-26
lines changed

5 files changed

+52
-26
lines changed

src/css/tabs/osd.css

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@
253253

254254
.tab-osd .preview .gui_box_titlebar {
255255
position: relative;
256+
margin-bottom: 0px;
257+
float: none;
256258
}
257259

258260
.tab-osd .preview .gui_box_titlebar label {
@@ -276,10 +278,20 @@
276278
text-align: center;
277279
}
278280

281+
.tab-osd .preview .row {
282+
display: flex;
283+
}
284+
279285
.tab-osd .preview .char {
280-
display: inline-block;
286+
display: flex;
281287
padding: 0;
282288
margin: 0;
289+
flex: 1 1 auto;
290+
flex-wrap: nowrap;
291+
}
292+
293+
.tab-osd .preview .char img {
294+
flex: 1 1 auto;
283295
}
284296

285297
.tab-osd .char.mouseover {
@@ -302,10 +314,6 @@
302314
cursor: move;
303315
}
304316

305-
.tab-osd .preview .row {
306-
height: 18px;
307-
}
308-
309317
#font-logo-preview-container {
310318
background:rgba(0, 255, 0, 0.4);
311319
margin-bottom: 10px;
@@ -476,25 +484,27 @@ button {
476484
}
477485

478486
.tab-osd .preview {
479-
width: 360px;
480-
float: left;
481487
position: sticky;
482488
top: 0;
483-
margin-left: calc((100% - 360px) / 3);
484-
485489

486490
/* please don't copy the generic background image from another project
487491
* and replace the one that @nathantsoi took :)
488492
*/
489493
background: url(../../images/osd-bg-1.jpg);
490494
background-size: cover;
491-
border-bottom-left-radius: 3px;
492-
border-bottom-right-radius: 3px;
495+
background-repeat: no-repeat;
493496
}
494497

495-
.tab-osd .preview:active {
496-
background: url(../../images/osd-bg-1-grid.png), url(../../images/osd-bg-1.jpg);
497-
background-size: cover;
498+
.tab-osd .video-pal .preview:active {
499+
background: url(../../images/osd-bg-1-grid-pal.png), url(../../images/osd-bg-1.jpg);
500+
background-size: 100% 100%, cover;
501+
background-repeat: no-repeat;
502+
}
503+
504+
.tab-osd .video-ntsc .preview:active {
505+
background: url(../../images/osd-bg-1-grid-ntsc.png), url(../../images/osd-bg-1.jpg);
506+
background-size: 100% 100%, cover;
507+
background-repeat: no-repeat;
498508
}
499509

500510
.tab-osd .alarms label {
@@ -550,16 +560,31 @@ button {
550560
}
551561
}
552562

553-
.tab-osd .grid-col.col4:first-child, .tab-osd .grid-col.col4:last-child {
554-
width: calc((100% - 390px) / 2);
563+
.tab-osd .grid-row {
564+
justify-content: center;
565+
gap: 7px;
555566
}
556567

557-
.tab-osd .grid-row {
558-
margin-bottom: 40px;
568+
.tab-osd .grid-row .elements {
569+
flex: 1 1 auto;
570+
width: 210px;
571+
max-width: 700px;
572+
}
573+
574+
.tab-osd .grid-row .osd-preview {
575+
flex: 2 0 auto;
576+
width: 350px;
577+
max-width: max(min(950px,calc((100vh - 470px) * 1.25)), 350px);
578+
}
579+
580+
.tab-osd .grid-row .osd-profile {
581+
flex: 1 1 auto;
582+
width: 210px;
583+
max-width: 700px ;
559584
}
560585

561-
.tab-osd .grid-col.col4 {
562-
width: auto;
586+
.tab-osd .grid-col {
587+
margin: 0px;
563588
}
564589

565590
@media all and (max-width: 575px) {

src/images/osd-bg-1-grid-ntsc.png

32.7 KB
Loading

src/js/tabs/osd.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,9 @@ OSD.updateDisplaySize = function() {
18721872
y: OSD.constants.VIDEO_LINES[videoType],
18731873
total: null,
18741874
};
1875+
// Adjust css background grid
1876+
const previewLayoutElement = $(".tab-osd .display-layout");
1877+
videoType === 'PAL' ? previewLayoutElement.addClass('video-pal').removeClass('video-ntsc') : previewLayoutElement.addClass('video-ntsc').removeClass('video-pal');
18751878
};
18761879

18771880
OSD.drawByOrder = function(selectedPosition, field, charCode, x, y) {

src/tabs/osd.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1 class="tab_title">
1818
<p class="note" i18n="osdSetupPreviewHelp"></p>
1919
</div>
2020
<div class="grid-row">
21-
<div class="grid-col col4 elements requires-osd-feature osd-feature">
21+
<div class="grid-col elements requires-osd-feature osd-feature">
2222
<div class="gui_box grey">
2323
<div class="gui_box_titlebar" style="margin-bottom: 0px;">
2424
<div class="spacer_box_title">
@@ -33,7 +33,7 @@ <h1 class="tab_title">
3333
</div>
3434
</div>
3535
</div>
36-
<div class="grid-col col4 osd-preview">
36+
<div class="grid-col osd-preview">
3737
<div class="gui_box grey preview requires-osd-feature">
3838

3939
<div class="gui_box_titlebar image">
@@ -51,9 +51,7 @@ <h1 class="tab_title">
5151
</div>
5252

5353
<div class="display-layout">
54-
<div class="col right">
55-
<div class="preview">
56-
</div>
54+
<div class="preview">
5755
</div>
5856
</div>
5957

@@ -65,7 +63,7 @@ <h1 class="tab_title">
6563

6664
</div>
6765
</div>
68-
<div class="grid-col col4 osd-profile">
66+
<div class="grid-col osd-profile">
6967
<div class="gui_box osdprofile-selected-container grey">
7068
<div class="gui_box_titlebar cf_tip">
7169
<div class="spacer_box_title" i18n="osdSetupSelectedProfileTitle"></div>

0 commit comments

Comments
 (0)