mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
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:
@@ -55,19 +55,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;
|
||||
}
|
||||
|
||||
@@ -108,14 +108,7 @@ function HandleModelList( pVal )
|
||||
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
|
||||
@@ -232,14 +225,7 @@ function FilterModelList(keyword) {
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user