Fixes / Improvements for Covers & Printer Selection dialog (#11151)

* init

* update

* Crop cover images

* match setup wizard UI

* update

* tiertime

* anycubic

* anycubic

* construct3d

* update

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
yw4z
2025-11-04 05:16:06 +03:00
committed by GitHub
parent ebb89a583d
commit 3c65617139
339 changed files with 89 additions and 65 deletions

View File

@@ -79,18 +79,17 @@
.PImg
{
position:relative;
width:160px;
height: 160px;
width:120px; /* ORCA use covers as 120x120px but use source file as 240x240 for better quality on hidpi */
height:120px; /* ORCA fit image to fill frame */
padding:10px 20px /* ORCA use less vertical padding */
}
.ModelCheckBox
{
position: absolute;
width: 20px;
height: 20px;
right: 10px;
top: 10px;
cursor: pointer;
flex: 0 0 18px; /* ORCA match checkbox style and size */
margin: 10px 5px 0 0;
width: 18px;
height: 18px;
background-image: url("../img/emptycheck.svg");
background-size: cover;
}
@@ -109,6 +108,7 @@ img.ModelThumbnail
.PName
{
font-weight: 700;
line-height: 20px; /* ORCA */
text-align: left;
}

View File

@@ -107,15 +107,8 @@ function HandleModelList( pVal )
//Collect Html Node Nozzel Html
if( !ModelHtml.hasOwnProperty(strVendor))
ModelHtml[strVendor]='';
let CoverImage=OneModel['cover'];
ModelHtml[strVendor]+='<div class="PrinterBlock" onClick="ChooseModel(\''+strVendor+'\',\''+OneModel['model']+'\')">'+
'<div class="PImg">'+
'<img class="ModelThumbnail" src="'+CoverImage+'" />'+
'<div class="ModelCheckBox" vendor="' +strVendor+ '" model="'+OneModel['model']+'"></div>'+
'</div>'+
' <div class="PName">'+OneModel['name']+'</div>'+
'</div>';
ModelHtml[strVendor]+=CreatePrinterBlock(OneModel); // ORCA
}
//Update Nozzel Html Append
@@ -231,15 +224,8 @@ function FilterModelList(keyword) {
//Collect Html Node Nozzel Html
if (!ModelHtml.hasOwnProperty(strVendor))
ModelHtml[strVendor] = '';
let CoverImage = OneModel['cover'];
ModelHtml[strVendor] += '<div class="PrinterBlock" onClick="ChooseModel(\''+strVendor+'\',\''+OneModel['model']+'\')">'+
'<div class="PImg">'+
'<img class="ModelThumbnail" src="'+CoverImage+'" />'+
'<div class="ModelCheckBox" vendor="' +strVendor+ '" model="'+OneModel['model']+'"></div>'+
'</div>'+
' <div class="PName">'+OneModel['name']+'</div>'+
'</div>';
ModelHtml[strVendor]+=CreatePrinterBlock(OneModel); // ORCA
}
//Update Nozzel Html Append
@@ -276,6 +262,38 @@ function FilterModelList(keyword) {
TranslatePage();
}
function CreatePrinterBlock(OneModel)
{
// ORCA use single functuon to create blocks to simplify code
let vendor = OneModel['vendor']
vendorName = vendor=="BBL" ? "Bambu Lab" : vendor=="Custom" ? "Generic Printer" : vendor;
let modelName = OneModel['name'];
// Most of it unneeded. this can be applied in profiles
if( vendor=="Custom")
modelName = modelName.split(" ")[1];
// these uses different case in name; seckit, ratrig, blocks
else if (modelName.toLowerCase().startsWith(vendorName.toLowerCase()))
modelName = modelName.slice(vendorName.length);
// these not matches. have to fix in profiles to reduce conditions in here;
else if (vendor == "MagicMaker" && modelName.startsWith("MM"))
modelName = modelName.slice(("MM").length);
else if (vendor == "OrcaArena")
modelName = modelName.slice(("Orca Arena").length);
else if (vendor == "RolohaunDesign" && modelName.startsWith("Rolohaun"))
modelName = modelName.slice(("Rolohaun").length);
return '<div class="PrinterBlock" onClick="ChooseModel(\''+vendor+'\',\''+OneModel['model']+'\')">'+
'<div class="PImg">'+
'<img class="ModelThumbnail" src="' + OneModel['cover'] + '" />'+
'</div>'+
'<div style="display: flex;">'+
' <div class="ModelCheckBox" vendor="' +vendor+ '" model="'+OneModel['model']+'"></div>'+
' <div class="PName"><p>'+ vendorName +'</p><p>' + modelName +'</p></div>'+
'</div>'+
'</div>';
}
function SelectPrinterAll( sVendor )
{
$("div.OneVendorBlock[vendor='"+sVendor+"'] .ModelCheckBox").addClass('ModelCheckBoxSelected');