Match button styles on whole UI and fixes for button class (#11233)

* init

* web buttons

* Bind Dialog & Fix states

* update

* update

* Update common.css

* objcolordialog

* privacy update dialog

* Update CaliHistoryDialog.cpp

* Update MultiMachineManagerPage.cpp

* Update AMSControl.cpp

* TipsDialog

* Update AMSMaterialsSetting.cpp

* extrusion calibration

* Update UpdateDialogs.cpp

* recenterdialog

* update

* Update Calibration.cpp

* update

* update

* update

* fix

* update

* ReleaseNote

* update

* update

* fix remember checkbox position

* add comments
This commit is contained in:
yw4z
2025-12-18 12:14:56 +00:00
committed by GitHub
parent 59ad126b48
commit 00ff06a5d3
67 changed files with 406 additions and 1401 deletions
+11 -52
View File
@@ -137,40 +137,6 @@
display: inline-block; display: inline-block;
} }
.btn {
display: inline-block;
padding: 6px 9px;
border: 2px solid transparent;
border-radius: 12px;
font-size: 12px;
text-align: center;
cursor: pointer;
transition: all 0.3s;
}
.btn-ok {
color: #fff;
background-color: #009688;
}
.btn-ok:hover {
background-color: #26A69A;
}
.btn-cancel {
color: black;
background-color: white;
border: 1px solid black;
}
.btn-cancel:hover {
background-color: #eeeeee;
}
body.dark-mode button.btn-cancel {
background-color: #2d2d31;
color: #e0e0e0;
border: 1px solid #e0e0e0;
}
select { select {
padding: 6px 9px; padding: 6px 9px;
border: 1px solid #dbdbdb; border: 1px solid #dbdbdb;
@@ -197,7 +163,7 @@
.button-container { .button-container {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 10px; gap: 0px;
margin: 10px; margin: 10px;
} }
@@ -266,15 +232,6 @@
position: sticky; position: sticky;
z-index: 11; z-index: 11;
} }
body.dark-mode .btn-ok {
background-color: #009688;
}
body.dark-mode .btn-dark {
background-color: #34495e;
}
body.dark-mode select { body.dark-mode select {
background-color: #2d2d31; background-color: #2d2d31;
color: white; color: white;
@@ -295,6 +252,8 @@
</style> </style>
</head> </head>
<link rel="stylesheet" type="text/css" href="../include/global.css" /> <!-- ORCA One for all-->
<body> <body>
<div class="container"> <div class="container">
<div class="tip-panel" id="auto_flush_tip"> <div class="tip-panel" id="auto_flush_tip">
@@ -303,14 +262,14 @@
in Orca Slicer &gt; Preferences. in Orca Slicer &gt; Preferences.
</div> </div>
<div style="margin-bottom: 10px; "> <div style="margin-bottom: 10px; display: flex; align-items: center;">
<button <div
class="btn btn-ok" class="ButtonStyleConfirm ButtonTypeWindow"
onclick="calcFlushingVolumes()" onclick="calcFlushingVolumes()"
id="calc_btn" id="calc_btn"
> >
Re-Calculate Re-Calculate
</button> </div>
<select <select
id="extruders" id="extruders"
onchange="handleExtruderSelect(document.getElementById('extruders').value)" onchange="handleExtruderSelect(document.getElementById('extruders').value)"
@@ -366,12 +325,12 @@
</div> </div>
</div> </div>
<div class="button-container" style="padding: 0px; margin: 0px;"> <div class="button-container" style="padding: 0px; margin: 0px;">
<button class="btn btn-ok" id="ok_btn" style="width: 60px; height: 30px; font-size: 12px; text-align: center;" onclick="storeData()"> <div class="ButtonStyleConfirm ButtonTypeChoice" id="ok_btn" onclick="storeData()">
Save Save
</button> </div>
<button class="btn btn-cancel" id="cancel_btn" style="width: 60px; height: 30px; font-size: 12px; text-align: center;" onclick="quit()"> <div class="ButtonStyleRegular ButtonTypeChoice" id="cancel_btn" onclick="quit()">
Cancel Cancel
</button> </div>
</div> </div>
</div> </div>
+2 -1
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P1</title> <title>引导_P1</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
<link rel="stylesheet" type="text/css" href="1.css" /> <link rel="stylesheet" type="text/css" href="1.css" />
@@ -19,7 +20,7 @@
<div id="Title" class="trans" tid="t1">Welcome to Orca Slicer</div> <div id="Title" class="trans" tid="t1">Welcome to Orca Slicer</div>
<div id="STip" class="trans" tid="t2">Orca Slicer will be setup in several steps. Let's start!</div> <div id="STip" class="trans" tid="t2">Orca Slicer will be setup in several steps. Let's start!</div>
<div id="BtnArea"> <div id="BtnArea">
<a id="StartBtn" class="NormalBtn swiper-button-next trans" tid="t24" href="../11/index.html">Get Started</a> <a id="StartBtn" class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t24" href="../11/index.html">Get Started</a>
</div> </div>
</body> </body>
</html> </html>
+2 -1
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P21</title> <title>引导_P21</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="11.css" /> <link rel="stylesheet" type="text/css" href="11.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
@@ -33,7 +34,7 @@
</div>--> </div>-->
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="NormalBtn trans" id="AcceptBtn" tid="t9" onclick="GotoPolicyPage()">Next</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" id="AcceptBtn" tid="t9" onclick="GotoPolicyPage()">Next</div>
</div> </div>
</body> </body>
</html> </html>
+1 -5
View File
@@ -25,10 +25,6 @@
margin-right: 0px; /* ORCA align buttons with end of horizontal separator/line */ margin-right: 0px; /* ORCA align buttons with end of horizontal separator/line */
} }
.BannerBtns>.SmallBtn_Green.trans{
margin-right: 7px; /* ORCA adds a small gap between buttons */
}
.BlockBanner a .BlockBanner a
{ {
display: inline-block; display: inline-block;
@@ -149,7 +145,7 @@ img.ModelThumbnail
{ {
margin-top: 4mm; margin-top: 4mm;
display: flex; display: flex;
justify-content:space-around; justify-content:flex-end;
} }
.search { .search {
+4 -4
View File
@@ -91,8 +91,8 @@ function HandleModelList( pVal )
'<div class="BlockBanner">'+ '<div class="BlockBanner">'+
' <a>'+sVV+'</a>'+ ' <a>'+sVV+'</a>'+
' <div class="BannerBtns">'+ ' <div class="BannerBtns">'+
' <div class="SmallBtn_Green trans" tid="t11" onClick="SelectPrinterAll('+"\'"+strVendor+"\'"+')">all</div>'+ ' <div class="ButtonStyleConfirm ButtonTypeWindow trans" tid="t11" onClick="SelectPrinterAll('+"\'"+strVendor+"\'"+')">all</div>'+
' <div class="SmallBtn trans" tid="t12" onClick="SelectPrinterNone('+"\'"+strVendor+"\'"+')">none</div>'+ ' <div class="ButtonStyleRegular ButtonTypeWindow trans" tid="t12" onClick="SelectPrinterNone('+"\'"+strVendor+"\'"+')">none</div>'+
' </div>'+ ' </div>'+
'</div>'+ '</div>'+
'<div class="PrinterArea"> '+ '<div class="PrinterArea"> '+
@@ -210,8 +210,8 @@ function FilterModelList(keyword) {
'<div class="BlockBanner">' + '<div class="BlockBanner">' +
' <a>' + sVV + '</a>' + ' <a>' + sVV + '</a>' +
' <div class="BannerBtns">' + ' <div class="BannerBtns">' +
' <div class="SmallBtn_Green trans" tid="t11" onClick="SelectPrinterAll(' + "\'" + strVendor + "\'" + ')">all</div>' + ' <div class="ButtonStyleConfirm ButtonTypeWindow trans" tid="t11" onClick="SelectPrinterAll(' + "\'" + strVendor + "\'" + ')">all</div>' +
' <div class="SmallBtn trans" tid="t12" onClick="SelectPrinterNone(' + "\'" + strVendor + "\'" + ')">none</div>' + ' <div class="ButtonStyleRegular ButtonTypeWindow trans" tid="t12" onClick="SelectPrinterNone(' + "\'" + strVendor + "\'" + ')">none</div>' +
' </div>' + ' </div>' +
'</div>' + '</div>' +
'<div class="PrinterArea"> ' + '<div class="PrinterArea"> ' +
+6 -5
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P21</title> <title>引导_P21</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="21.css" /> <link rel="stylesheet" type="text/css" href="21.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
@@ -34,8 +35,8 @@
<div class="BlockBanner"> <div class="BlockBanner">
<a>BBL-3DP</a> <a>BBL-3DP</a>
<div class="BannerBtns"> <div class="BannerBtns">
<div class="SmallBtn_Green trans" onClick="SelectPrinterAll('BBL')">所有</div> <div class="ButtonStyleConfirm ButtonTypeWindow trans" onClick="SelectPrinterAll('BBL')">所有</div>
<div class="SmallBtn trans" onClick="SelectPrinterNone('BBL')">无</div> <div class="ButtonStyleRegular ButtonTypeWindow trans" onClick="SelectPrinterNone('BBL')">无</div>
</div> </div>
</div> </div>
@@ -120,8 +121,8 @@
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="GrayBtn trans" id="PreBtn" tid="t8" onclick="window.open('../1/index.html','_self')">Back</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" id="PreBtn" tid="t8" onclick="window.open('../1/index.html','_self')">Back</div>
<div class="NormalBtn trans" id="AcceptBtn" tid="t9" onclick="GotoFilamentPage()">Next</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" id="AcceptBtn" tid="t9" onclick="GotoFilamentPage()">Next</div>
</div> </div>
<div id="NoticeMask"></div> <div id="NoticeMask"></div>
@@ -130,7 +131,7 @@
<div id="NoticeContent"> <div id="NoticeContent">
<div id="NoticeText" class="trans" tid="t37">At least one printer must be selected.</div> <div id="NoticeText" class="trans" tid="t37">At least one printer must be selected.</div>
<div id="NoticeBtns"> <div id="NoticeBtns">
<div class="SmallBtn trans" tid="t36" onClick="ShowNotice(0)">ok</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t36" onClick="ShowNotice(0)">ok</div>
</div> </div>
</div> </div>
</div> </div>
+1 -7
View File
@@ -39,12 +39,6 @@ input
align-items: center; align-items: center;
} }
#ItemSelectArea .SmallBtn
{
margin-left:5px;
}
#ItemBlockArea #ItemBlockArea
{ {
flex: 1 0 236px; flex: 1 0 236px;
@@ -110,7 +104,7 @@ input
{ {
margin-top: 4mm; margin-top: 4mm;
display: flex; display: flex;
justify-content:space-around; justify-content:flex-end;
} }
#GotoNetPluginBtn #GotoNetPluginBtn
+8 -7
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=0" /> <meta http-equiv="Cache-Control" content="max-age=0" />
<title>引导_P21</title> <title>引导_P21</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="22.css" /> <link rel="stylesheet" type="text/css" href="22.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
@@ -44,17 +45,17 @@
<div id="ItemSelectArea"> <div id="ItemSelectArea">
<div class="SmallBtn_Green trans" tid="t11" onClick="SelectAllFilament(1)">All</div> <div class="ButtonStyleConfirm ButtonTypeWindow trans" tid="t11" onClick="SelectAllFilament(1)">All</div>
<div class="SmallBtn trans" tid="t12" onClick="SelectAllFilament(0)">Clear all</div> <div class="ButtonStyleRegular ButtonTypeWindow trans" tid="t12" onClick="SelectAllFilament(0)">Clear all</div>
</div> </div>
<div id="ItemBlockArea" class="ZScrol"> <div id="ItemBlockArea" class="ZScrol">
</div> </div>
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="ReturnPreviewPage()">Back</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t8" id="PreBtn" onclick="ReturnPreviewPage()">Back</div>
<div class="NormalBtn trans" tid="t25" id="AcceptBtn" onclick="FinishGuide()">finish</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t25" id="AcceptBtn" onclick="FinishGuide()">finish</div>
<div class="NormalBtn trans" tid="t9" id="GotoNetPluginBtn" onclick="GotoNetPluginPage()">Next</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t9" id="GotoNetPluginBtn" onclick="GotoNetPluginPage()">Next</div>
</div> </div>
<div id="NoticeMask"> <div id="NoticeMask">
</div> </div>
@@ -64,8 +65,8 @@
<div id="NoticeText" class="trans" tid="t19">At least one filament must be selected. </div> <div id="NoticeText" class="trans" tid="t19">At least one filament must be selected. </div>
<div id="NoticeText" class="trans" tid="t20">Do you want to use default filament ?</div> <div id="NoticeText" class="trans" tid="t20">Do you want to use default filament ?</div>
<div id="NoticeBtns"> <div id="NoticeBtns">
<div class="SmallBtn trans" tid="t21" onClick="ChooseDefaultFilament()">Yes</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t21" onClick="ChooseDefaultFilament()">Yes</div>
<div class="SmallBtn trans" tid="t22" onClick="ShowNotice(0)">No</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t22" onClick="ShowNotice(0)">No</div>
</div> </div>
</div> </div>
</div> </div>
+1 -7
View File
@@ -39,12 +39,6 @@ input
align-items: center; align-items: center;
} }
#ItemSelectArea .SmallBtn
{
margin-left:5px;
}
#ItemBlockArea #ItemBlockArea
{ {
display:flex; display:flex;
@@ -111,7 +105,7 @@ input
{ {
margin-top: 4mm; margin-top: 4mm;
display: flex; display: flex;
justify-content:space-around; justify-content:flex-end;
} }
#SystemFilamentsArea #SystemFilamentsArea
+8 -7
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=0" /> <meta http-equiv="Cache-Control" content="max-age=0" />
<title>引导_P21</title> <title>引导_P21</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="23.css" /> <link rel="stylesheet" type="text/css" href="23.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
@@ -44,8 +45,8 @@
</div> </div>
<div id="ItemSelectArea"> <div id="ItemSelectArea">
<div class="SmallBtn_Green trans" tid="t11" onClick="SelectAllFilament(1)">all</div> <div class="ButtonStyleConfirm ButtonTypeWindow trans" tid="t11" onClick="SelectAllFilament(1)">all</div>
<div class="SmallBtn trans" tid="t12" onClick="SelectAllFilament(0)">Clear all</div> <div class="ButtonStyleRegular ButtonTypeWindow trans" tid="t12" onClick="SelectAllFilament(0)">Clear all</div>
</div> </div>
<div id="ItemBlockArea" class="ZScrol"> <div id="ItemBlockArea" class="ZScrol">
@@ -55,7 +56,7 @@
<div id="CustomFilamentsArea"> <div id="CustomFilamentsArea">
<div id="CFilament_Btn_Area"> <div id="CFilament_Btn_Area">
<div class="SmallBtn_Green trans" tid="t111" onClick="OnClickCustomFilamentAdd()">Create New</div> <div class="ButtonStyleConfirm ButtonTypeWindow trans" tid="t111" onClick="OnClickCustomFilamentAdd()">Create New</div>
</div> </div>
<div id="CFilament_List" class="ZScrol"> <div id="CFilament_List" class="ZScrol">
</div> </div>
@@ -63,8 +64,8 @@
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="NormalBtn trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div>
<div class="GrayBtn trans" tid="t38" id="PreBtn" onclick="CancelSelect()">Cancel</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t38" id="PreBtn" onclick="CancelSelect()">Cancel</div>
</div> </div>
<div id="NoticeMask"> <div id="NoticeMask">
</div> </div>
@@ -74,8 +75,8 @@
<div id="NoticeText" class="trans" tid="t19">At least one filament must be selected. </div> <div id="NoticeText" class="trans" tid="t19">At least one filament must be selected. </div>
<div id="NoticeText" class="trans" tid="t20">Do you want to use default filament ?</div> <div id="NoticeText" class="trans" tid="t20">Do you want to use default filament ?</div>
<div id="NoticeBtns"> <div id="NoticeBtns">
<div class="SmallBtn trans" tid="t21" onClick="ChooseDefaultFilament()">yes</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t21" onClick="ChooseDefaultFilament()">yes</div>
<div class="SmallBtn trans" tid="t22" onClick="ShowNotice(0)">no</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t22" onClick="ShowNotice(0)">no</div>
</div> </div>
</div> </div>
</div> </div>
+1 -5
View File
@@ -24,10 +24,6 @@
margin-right: 0px; /* ORCA align buttons with end of horizontal separator/line */ margin-right: 0px; /* ORCA align buttons with end of horizontal separator/line */
} }
.BannerBtns>.SmallBtn_Green.trans{
margin-right: 7px; /* ORCA adds a small gap between buttons */
}
/*.Banner-Btn /*.Banner-Btn
{ {
background-color: #C0C0C0; background-color: #C0C0C0;
@@ -174,7 +170,7 @@ img.ModelThumbnail
{ {
margin-top: 4mm; margin-top: 4mm;
display: flex; display: flex;
justify-content:space-around; justify-content:flex-end;
} }
.search { .search {
+4 -4
View File
@@ -91,8 +91,8 @@ function HandleModelList( pVal )
'<div class="BlockBanner">'+ '<div class="BlockBanner">'+
' <a>'+sVV+'</a>'+ ' <a>'+sVV+'</a>'+
' <div class="BannerBtns">'+ ' <div class="BannerBtns">'+
' <div class="SmallBtn_Green trans" tid="t11" onClick="SelectPrinterAll('+"\'"+strVendor+"\'"+')">all</div>'+ ' <div class="ButtonStyleConfirm ButtonTypeWindow trans" tid="t11" onClick="SelectPrinterAll('+"\'"+strVendor+"\'"+')">all</div>'+
' <div class="SmallBtn trans" tid="t12" onClick="SelectPrinterNone('+"\'"+strVendor+"\'"+')">none</div>'+ ' <div class="ButtonStyleRegular ButtonTypeWindow trans" tid="t12" onClick="SelectPrinterNone('+"\'"+strVendor+"\'"+')">none</div>'+
' </div>'+ ' </div>'+
'</div>'+ '</div>'+
'<div class="PrinterArea"> '+ '<div class="PrinterArea"> '+
@@ -210,8 +210,8 @@ function FilterModelList(keyword) {
'<div class="BlockBanner">' + '<div class="BlockBanner">' +
' <a>' + sVV + '</a>' + ' <a>' + sVV + '</a>' +
' <div class="BannerBtns">' + ' <div class="BannerBtns">' +
' <div class="SmallBtn_Green trans" tid="t11" onClick="SelectPrinterAll(' + "\'" + strVendor + "\'" + ')">all</div>' + ' <div class="ButtonStyleConfirm ButtonTypeWindow trans" tid="t11" onClick="SelectPrinterAll(' + "\'" + strVendor + "\'" + ')">all</div>' +
' <div class="SmallBtn trans" tid="t12" onClick="SelectPrinterNone(' + "\'" + strVendor + "\'" + ')">none</div>' + ' <div class="ButtonStyleRegular ButtonTypeWindow trans" tid="t12" onClick="SelectPrinterNone(' + "\'" + strVendor + "\'" + ')">none</div>' +
' </div>' + ' </div>' +
'</div>' + '</div>' +
'<div class="PrinterArea"> ' + '<div class="PrinterArea"> ' +
+6 -5
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P21</title> <title>引导_P21</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="24.css" /> <link rel="stylesheet" type="text/css" href="24.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
@@ -33,8 +34,8 @@
<!--<div class="OneVendorBlock" Vendor="BBL"> <!--<div class="OneVendorBlock" Vendor="BBL">
<div class="BlockBanner"> <div class="BlockBanner">
<div class="BannerBtns"> <div class="BannerBtns">
<div class="SmallBtn_Green" onClick="SelectPrinterAll('BBL')">所有</div> <div class="ButtonStyleConfirm ButtonTypeWindow" onClick="SelectPrinterAll('BBL')">所有</div>
<div class="SmallBtn" onClick="SelectPrinterNone('BBL')">无</div> <div class="ButtonStyleRegular ButtonTypeWindow" onClick="SelectPrinterNone('BBL')">无</div>
</div> </div>
<a>BBL-3DP</a> <a>BBL-3DP</a>
@@ -92,8 +93,8 @@
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="NormalBtn trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div>
<div class="GrayBtn trans" tid="t38" id="PreBtn" onclick="CancelSelect()">Cancel</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t38" id="PreBtn" onclick="CancelSelect()">Cancel</div>
</div> </div>
<div id="NoticeMask"></div> <div id="NoticeMask"></div>
@@ -102,7 +103,7 @@
<div id="NoticeContent"> <div id="NoticeContent">
<div id="NoticeText" class="trans" tid="t37">At least one printer must be selected.</div> <div id="NoticeText" class="trans" tid="t37">At least one printer must be selected.</div>
<div id="NoticeBtns"> <div id="NoticeBtns">
<div class="SmallBtn trans" tid="t36" onClick="ShowNotice(0)">ok</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t36" onClick="ShowNotice(0)">ok</div>
</div> </div>
</div> </div>
</div> </div>
+3 -2
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P1</title> <title>引导_P1</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="3.css" /> <link rel="stylesheet" type="text/css" href="3.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
@@ -32,8 +33,8 @@
</label> </label>
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="window.open('../11/index.html','_self')">Back</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t8" id="PreBtn" onclick="window.open('../11/index.html','_self')">Back</div>
<div class="NormalBtn trans" tid="t9" id="AcceptBtn" onclick="GotoNextPage()">Next</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t9" id="AcceptBtn" onclick="GotoNextPage()">Next</div>
</div> </div>
</body> </body>
</html> </html>
+3 -2
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P1</title> <title>引导_P1</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="31.css" /> <link rel="stylesheet" type="text/css" href="31.css" />
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
@@ -31,8 +32,8 @@
</label> </label>
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="window.open('../11/index.html','_self')">Back</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t8" id="PreBtn" onclick="window.open('../11/index.html','_self')">Back</div>
<div class="NormalBtn trans" tid="t9" id="AcceptBtn" onclick="GotoNextPage()">Next</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t9" id="AcceptBtn" onclick="GotoNextPage()">Next</div>
</div> </div>
</body> </body>
</html> </html>
+3 -2
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P1</title> <title>引导_P1</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
<link rel="stylesheet" type="text/css" href="4orca.css" /> <link rel="stylesheet" type="text/css" href="4orca.css" />
@@ -31,8 +32,8 @@
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="window.history.back()">Back</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t8" id="PreBtn" onclick="window.history.back()">Back</div>
<div class="NormalBtn trans" tid="t9" id="GotoNetPluginBtn" onclick="GotoNetPluginPage()">Next</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t9" id="GotoNetPluginBtn" onclick="GotoNetPluginPage()">Next</div>
</div> </div>
</body> </body>
</html> </html>
+3 -2
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P1</title> <title>引导_P1</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="../css/common.css" /> <link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="../css/dark.css" /> <link rel="stylesheet" type="text/css" href="../css/dark.css" />
<link rel="stylesheet" type="text/css" href="5.css" /> <link rel="stylesheet" type="text/css" href="5.css" />
@@ -37,8 +38,8 @@
</div> </div>
<div id="AcceptArea"> <div id="AcceptArea">
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="window.history.back()">Back</div> <div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t8" id="PreBtn" onclick="window.history.back()">Back</div>
<div class="NormalBtn trans" tid="t25" id="AcceptBtn" onclick="FinishGuide()">Finish</div> <div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t25" id="AcceptBtn" onclick="FinishGuide()">Finish</div>
</div> </div>
</body> </body>
</html> </html>
+4 -3
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>引导_P1</title> <title>引导_P1</title>
<link rel="stylesheet" type="text/css" href="../../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="6.css" /> <link rel="stylesheet" type="text/css" href="6.css" />
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../js/json2.js"></script> <script type="text/javascript" src="../js/json2.js"></script>
@@ -40,9 +41,9 @@
</div> </div>
<div id="BtnBlock"> <div id="BtnBlock">
<div id="CancelBtn" class="trans Btn_Green" tid="t38" onClick="CancelDownload()">Cancel</div> <div id="CancelBtn" class="ButtonStyleRegular ButtonTypeChoice trans" tid="t38" onClick="CancelDownload()" >Cancel</div>
<div id="RestartBtn" class="Btn_Green" onClick="RestartBambuStudio()"><a class="trans" tid="t25">Finish</a></div> <div id="RestartBtn" class="ButtonStyleRegular ButtonTypeChoice trans" tid="t25" onClick="RestartBambuStudio()">Finish</div>
<div id="CloseBtn" class="Btn_Green" onClick="CloseDownDialog()"><a class="trans" tid="t86">Close</a></div> <div id="CloseBtn" class="ButtonStyleRegular ButtonTypeChoice trans" tid="t86" onClick="CloseDownDialog()" >Close </div>
</div> </div>
</body> </body>
</html> </html>
+4 -75
View File
@@ -101,86 +101,16 @@ body
#AcceptArea #AcceptArea
{ {
height:12%; height:var(--dialog-button-sizer-height); /*----ORCA Use fixed size to prevent position change----*/
padding: 0mm 10mm; max-height:var(--dialog-button-sizer-height);
min-height:var(--dialog-button-sizer-height);
padding: 0 var(--dialog-button-gap);
text-align: left; text-align: left;
display: flex; display: flex;
justify-content:flex-end; justify-content:flex-end;
align-items: center; align-items: center;
} }
/*--Btn--*/
.NormalBtn
{
padding: 3mm 9mm;
font-size: 14px;
text-align: center;
background-color: #009688;
border-radius: 16px;
color: #fff;
cursor: pointer;
margin-left: 10px;
}
.NormalBtn:hover
{
background-color:#4db6ac;
}
.GrayBtn
{
padding: 3mm 9mm;
font-size: 14px;
text-align: center;
/* border: 1px solid #575757; */ /* ORCA match button style */
border-radius: 18px;
background-color: #D9D9D9;
color: #000; /* ORCA match button style */
cursor: pointer;
margin-left: 10px;
}
.GrayBtn:hover
{
background-color:#CCCCCC; /* ORCA match button style */
}
.SmallBtn
{
padding: 2px 4mm;
font-size: 14px;
text-align: center;
background-color: #D9D9D9;
border-radius: 6px;
color: #000;
cursor: pointer;
display: inline-block;
}
.SmallBtn:hover
{
background-color: #CCCCCC;
}
.SmallBtn_Green
{
padding: 2px 4mm;
font-size: 14px;
text-align: center;
background-color: #009688;
border-radius: 6px;
color: #fff;
cursor: pointer;
display: inline-block;
}
.SmallBtn_Green:hover
{
background-color: #4db6ac;
}
/*---HyperLink---*/ /*---HyperLink---*/
.HyperLink .HyperLink
{ {
@@ -235,7 +165,6 @@ input[type="checkbox"]:checked::before {
transform: scale(1); transform: scale(1);
} }
/*----------------Light Mode-------------------*/ /*----------------Light Mode-------------------*/
-14
View File
@@ -37,20 +37,6 @@ input[type=checkbox]:checked{
background-color:#009688; background-color:#009688;
} }
/*-----Button-----*/
.GrayBtn, .SmallBtn /* ORCA match button style GrayBtn & SmallBtn */
{
background-color:#3E3E45;
/* border: 1px solid #B9B9BC; */
color: #FFFFFF;
}
.GrayBtn:hover, .SmallBtn:hover /* ORCA match button style GrayBtn & SmallBtn */
{
background-color:#49494E;
color: #FFFFFF;
}
/*-------Text------*/ /*-------Text------*/
.TextS1 .TextS1
-11
View File
@@ -31,12 +31,6 @@ body
/*----Left Menu Button----*/ /*----Left Menu Button----*/
#LogoutBtn:hover
{
background: #223C3C;
color: #efeff0;
}
.BtnItem .BtnItem
{ {
color:#B3B3B5; color:#B3B3B5;
@@ -71,11 +65,6 @@ body
background-color: #223C3C; background-color: #223C3C;
} }
#RecentClearAllBtn:hover
{
color: #000;
}
.FileImg .FileImg
{ {
background-color: #36363C; /*ORCA use darker color for dark theme for thumbnails*/ background-color: #36363C; /*ORCA use darker color for dark theme for thumbnails*/
-37
View File
@@ -100,16 +100,6 @@ body
justify-content: center; /*and use login button in new line*/ justify-content: center; /*and use login button in new line*/
user-select: none; user-select: none;
} }
#LoginBtn
{
cursor:pointer;
}
#LoginBtn:hover
{
font-size:17px;
}
#NoPluginTip #NoPluginTip
{ {
@@ -167,24 +157,9 @@ body
#LogoutBtn #LogoutBtn
{ {
font-size: 14px;
height: 24px;
line-height: 24px;
color: #4db6ac;
border: 1px solid #009688;
border-radius: 4px;
cursor: pointer;
margin-top: 5px; margin-top: 5px;
padding: 0px 8px;
} }
#LogoutBtn:hover
{
background: #00f0d8;
color: #fff;
}
/*------------------*/ /*------------------*/
#BtnArea #BtnArea
{ {
@@ -357,22 +332,10 @@ body
#RecentClearAllBtn #RecentClearAllBtn
{ {
border-width: 1px;
border-style: solid;
padding: 0px 10px;
border-radius: 6px;
line-height: 26px;
height: 26px;
margin-left: 20px; margin-left: 20px;
cursor: pointer;
display: none; display: none;
} }
#RecentClearAllBtn:hover
{
background-color:#CDCECE;
}
#RecentTitle #RecentTitle
{ {
+4 -3
View File
@@ -5,6 +5,7 @@
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<title>homepage</title> <title>homepage</title>
<link rel="stylesheet" type="text/css" href="../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="./css/home.css" /> <link rel="stylesheet" type="text/css" href="./css/home.css" />
<link rel="stylesheet" type="text/css" href="./css/dark.css" /> <link rel="stylesheet" type="text/css" href="./css/dark.css" />
@@ -23,7 +24,7 @@
<div id="LoginArea"> <div id="LoginArea">
<div id="Login1"> <div id="Login1">
<div id="Icon1"><img id="BBLIcon" src="../image/logo.png" /></div> <!-- ORCA use square icon for better consistency on UI --> <div id="Icon1"><img id="BBLIcon" src="../image/logo.png" /></div> <!-- ORCA use square icon for better consistency on UI -->
<div id="LoginBtn" class="TextS1" style="font-weight: 700;" onClick="OnLoginOrRegister()"><span class="trans" tid="t26">login</span>/<span class="trans" tid="t27">register</span></div> <div id="LoginBtn" class="ButtonStyleRegular ButtonTypeWindow" onClick="OnLoginOrRegister()"><span class="trans" tid="t26">login</span> / <span class="trans" tid="t27">register</span></div>
</div> </div>
<div id="Login2"> <div id="Login2">
@@ -31,7 +32,7 @@
<img id="UserAvatarIcon" src="img/c.jpg" onerror="this.onerror=null;this.src='img/c.jpg';" /> <img id="UserAvatarIcon" src="img/c.jpg" onerror="this.onerror=null;this.src='img/c.jpg';" />
</div> </div>
<div id="UserName" class="TextS1"></div> <div id="UserName" class="TextS1"></div>
<div id="LogoutBtn" class="Btn trans" tid="t50" onClick="OnLogOut()">log out</div> <div id="LogoutBtn" class="ButtonStyleAlert ButtonTypeWindow trans" tid="t50" onClick="OnLogOut()">log out</div>
</div> </div>
<div id="NoPluginTip"> <div id="NoPluginTip">
@@ -80,7 +81,7 @@
<div id="RecentFileArea"> <div id="RecentFileArea">
<div id="RecentTitleBlock"> <div id="RecentTitleBlock">
<div id="RecentTitle" class="Content-Title trans TextS1" tid="t35">recent open</div> <div id="RecentTitle" class="Content-Title trans TextS1" tid="t35">recent open</div>
<div id="RecentClearAllBtn" class="trans TextS1" tid="t12" onClick="OnDeleteAllRecentFiles()">Clear all</div> <div id="RecentClearAllBtn" class="ButtonStyleRegular ButtonTypeWindow trans" tid="t12" onClick="OnDeleteAllRecentFiles()">Clear all</div>
</div> </div>
<div id="FileList"> <div id="FileList">
<!-- <div class="FileItem" onClick="OnOpenRecentFile('aaaa')" fpath='d:\model\11.3mf'> <!-- <div class="FileItem" onClick="OnOpenRecentFile('aaaa')" fpath='d:\model\11.3mf'>
+73
View File
@@ -0,0 +1,73 @@
/*----ORCA UNIFIED STYLING FOR ALL CONTROLS----*/
/*----GLOBAL VARIABLES ----*/
:root {
--dialog-button-sizer-height : 62px; /*----32 + 15 * 2----*/
--dialog-button-gap : 15px;
}
/*----GLOBAL COLORS ----*/
:root {
--main-color : #009688;
--main-color-hover : #26A69A;
--button-fg-light : #FEFEFE;
--button-fg-text : #262E30;
--button-fg-disabled : #6B6B6B;
--button-bg-normal : #DFDFDF;
--button-bg-hover : #D4D4D4;
--button-bg-disabled : var(--button-bg-normal);
--button-bg-alert : #E14747;
}
@media (prefers-color-scheme: dark) {
:root {
--main-color : #00675B;
--main-color-hover : #008172;
--button-fg-light : #FEFEFE;
--button-fg-text : #EFEFF0;
--button-fg-disabled : #818183;
--button-bg-normal : #3E3E45;
--button-bg-hover : #4D4D54;
--button-bg-disabled : var(--button-bg-normal);
--button-bg-alert : #E14747;
}
}
/*----BUTTONS ----*/
/*----Values slightly different since renderer is different----*/
/*----Currently no support for focus border----*/
.ButtonTypeCompact { font-size: 11px; padding: 0px 8px ; border-radius: 12px; line-height: 23px; height: 24px; text-align: center}
.ButtonTypeWindow { font-size: 13px; padding: 0px 11px; border-radius: 12px; line-height: 23px; height: 24px; text-align: center}
.ButtonTypeChoice { font-size: 15px; padding: 0px 13px; border-radius: 4px ; line-height: 31px; height: 32px; text-align: center}
.ButtonTypeParameter { font-size: 15px; padding: 0px 12px; border-radius: 4px ; line-height: 25px; height: 26px; text-align: center}
.ButtonTypeExpanded { font-size: 15px; padding: 0px 12px; border-radius: 4px ; line-height: 31px; height: 32px; text-align: center}
.ButtonTypeWindow,
.ButtonTypeCompact {
min-width: 36px; /*----58 - 11*2(padding)----*/
}
.ButtonTypeWindow.ButtonStyleConfirm { /*---- Commonly used as "All" button before "Clear All" button----*/
margin-right:10px;
}
.ButtonTypeChoice {
min-width: 74px; /*----100 - 13*2(padding)----*/
margin-left:var(--dialog-button-gap);
}
.ButtonTypeExpanded {
width: 100%;
}
.ButtonTypeExpanded {
width: 120px;
}
.ButtonStyleConfirm { background: var(--main-color ); color: var(--button-fg-light )}
.ButtonStyleConfirm:hover { background: var(--main-color-hover ); color: var(--button-fg-light )}
.ButtonStyleRegular { background: var(--button-bg-normal ); color: var(--button-fg-text )}
.ButtonStyleRegular:hover { background: var(--button-bg-hover ); color: var(--button-fg-text )}
.ButtonStyleAlert { background: var(--button-bg-normal ); color: var(--button-fg-text )}
.ButtonStyleAlert:hover { background: var(--button-bg-alert ); color: var(--button-fg-light )}
.ButtonStyleDisabled { background: var(--button-bg-disabled); color: var(--button-fg-disabled)}
-12
View File
@@ -25,18 +25,6 @@ body
background-color: #fff; background-color: #fff;
} }
.NormalBtn
{
padding: 3mm 10mm;
font-size: 14px;
text-align: center;
background-color: #009688;
border-radius: 20px;
color: #fff;
cursor: pointer;
margin-left: 10px;
}
#ErrorBlock #ErrorBlock
{ {
display:flex; display:flex;
+2 -1
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Cache-Control" content="max-age=7200" />
<title>Network Error</title> <title>Network Error</title>
<link rel="stylesheet" type="text/css" href="../include/global.css" /> <!-- ORCA One for all-->
<link rel="stylesheet" type="text/css" href="css/login.css" /> <link rel="stylesheet" type="text/css" href="css/login.css" />
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script> <script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../data/text.js"></script> <script type="text/javascript" src="../data/text.js"></script>
@@ -15,7 +16,7 @@
<div id="ErrorBlock"> <div id="ErrorBlock">
<img id="ErrorIcon" src="disconnect3.png" /> <img id="ErrorIcon" src="disconnect3.png" />
<div id="ErrorTip" class="trans" title="t40" >Network disconnect, please check and try again later.</div> <div id="ErrorTip" class="trans" title="t40" >Network disconnect, please check and try again later.</div>
<div id="ErrorBtn" class="NormalBtn">Retry</div> <div id="ErrorBtn" class="ButtonStyleRegular ButtonTypeChoice">Retry</div>
</div> </div>
</body> </body>
</html> </html>
-5
View File
@@ -66,8 +66,3 @@ a
{ {
background-color:#36363C; background-color:#36363C;
} }
#AddModelInfoBtn:hover
{
color: #000;
}
+2 -1
View File
@@ -17,6 +17,7 @@
<link rel="stylesheet" type="text/css" href="model.css" /> <link rel="stylesheet" type="text/css" href="model.css" />
<link rel="stylesheet" type="text/css" href="./css/dark.css" /> <link rel="stylesheet" type="text/css" href="./css/dark.css" />
<link rel="stylesheet" type="text/css" href="../include/global.css" /> <!-- ORCA One for all-->
<script type="text/javascript" src="test.js"></script> <script type="text/javascript" src="test.js"></script>
<script type="text/javascript" src="model.js"></script> <script type="text/javascript" src="model.js"></script>
@@ -26,7 +27,7 @@
<div id="EmptyArea"> <div id="EmptyArea">
<div><img src="img/null.png"></div> <div><img src="img/null.png"></div>
<div class="Text_Title Text_Bold trans" tid='orca2'>no model information</div> <div class="Text_Title Text_Bold trans" tid='orca2'>no model information</div>
<div id="AddModelInfoBtn" class="trans TextS1" tid='orca1' onClick="OnClickEditProjectInfo()">Edit Project Info</div> <div id="AddModelInfoBtn" class="ButtonStyleConfirm ButtonTypeWindow trans" tid='orca1' onClick="OnClickEditProjectInfo()">Edit Project Info</div>
</div> </div>
<div id="WholeArea"> <div id="WholeArea">
-12
View File
@@ -378,17 +378,5 @@ body
#AddModelInfoBtn #AddModelInfoBtn
{ {
border-width: 1px;
border-style: solid;
padding: 0px 10px;
border-radius: 6px;
line-height: 26px;
height: 26px;
margin-top: 20px; margin-top: 20px;
cursor: pointer;
}
#AddModelInfoBtn:hover
{
background-color:#CDCECE;
} }
+9 -34
View File
@@ -57,32 +57,15 @@ void AMSMaterialsSetting::create()
m_sizer_button->Add(0, 0, 1, wxEXPAND, 0); m_sizer_button->Add(0, 0, 1, wxEXPAND, 0);
m_button_confirm = new Button(this, _L("Confirm")); m_button_confirm = new Button(this, _L("Confirm"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), m_button_confirm->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_confirm->SetBackgroundColor(m_btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_confirm->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_ok, this); m_button_confirm->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_ok, this);
m_button_reset = new Button(this, _L("Reset")); m_button_reset = new Button(this, _L("Reset"));
m_btn_bg_gray = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(*wxWHITE, StateColor::Focused), m_button_reset->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_reset->SetBackgroundColor(m_btn_bg_gray);
m_button_reset->SetBorderColor(AMS_MATERIALS_SETTING_GREY900);
m_button_reset->SetTextColor(AMS_MATERIALS_SETTING_GREY900);
m_button_reset->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_reset->SetCornerRadius(FromDIP(12));
m_button_reset->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_reset, this); m_button_reset->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_reset, this);
m_button_close = new Button(this, _L("Close")); m_button_close = new Button(this, _L("Close"));
m_button_close->SetBackgroundColor(m_btn_bg_gray); m_button_close->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_close->SetBorderColor(AMS_MATERIALS_SETTING_GREY900);
m_button_close->SetTextColor(AMS_MATERIALS_SETTING_GREY900);
m_button_close->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_close->SetCornerRadius(FromDIP(12));
m_button_close->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_close, this); m_button_close->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_select_close, this);
m_sizer_button->Add(m_button_confirm, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20)); m_sizer_button->Add(m_button_confirm, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20));
@@ -836,7 +819,7 @@ void AMSMaterialsSetting::update_widgets()
bool AMSMaterialsSetting::Show(bool show) bool AMSMaterialsSetting::Show(bool show)
{ {
if (show) { if (show) {
m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE); m_button_confirm->Rescale(); // ORCA re applies size
m_input_nozzle_max->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20))); m_input_nozzle_max->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
m_input_nozzle_min->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20))); m_input_nozzle_min->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
//m_clr_picker->set_color(m_clr_picker->GetParent()->GetBackgroundColour()); //m_clr_picker->set_color(m_clr_picker->GetParent()->GetBackgroundColour());
@@ -1193,9 +1176,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
if ( !this->obj || m_filament_selection < 0) { if ( !this->obj || m_filament_selection < 0) {
m_input_k_val->Enable(false); m_input_k_val->Enable(false);
m_input_n_val->Enable(false); m_input_n_val->Enable(false);
m_button_confirm->Disable(); m_button_confirm->Disable(); // ORCA No need to change style
m_button_confirm->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_confirm->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_comboBox_cali_result->Clear(); m_comboBox_cali_result->Clear();
m_comboBox_cali_result->SetValue(wxEmptyString); m_comboBox_cali_result->SetValue(wxEmptyString);
m_input_k_val->GetTextCtrl()->SetValue(wxEmptyString); m_input_k_val->GetTextCtrl()->SetValue(wxEmptyString);
@@ -1204,10 +1185,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
return; return;
} }
else { else {
m_button_confirm->SetBackgroundColor(m_btn_bg_green); m_button_confirm->Enable(true); // ORCA No need to change style
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
m_button_confirm->Enable(true);
} }
//filament id //filament id
@@ -1357,12 +1335,9 @@ void AMSMaterialsSetting::on_dpi_changed(const wxRect &suggested_rect)
degree->msw_rescale(); degree->msw_rescale();
bitmap_max_degree->SetBitmap(degree->bmp()); bitmap_max_degree->SetBitmap(degree->bmp());
bitmap_min_degree->SetBitmap(degree->bmp()); bitmap_min_degree->SetBitmap(degree->bmp());
m_button_reset->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE); m_button_reset->Rescale(); // ORCA
m_button_reset->SetCornerRadius(FromDIP(12)); m_button_confirm->Rescale(); // ORCA
m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE); m_button_close->Rescale(); // ORCA
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_close->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_close->SetCornerRadius(FromDIP(12));
this->Refresh(); this->Refresh();
} }
+1 -18
View File
@@ -39,25 +39,8 @@ BBLStatusBarSend::BBLStatusBarSend(wxWindow *parent, int id)
//StateColor btn_bd_white(std::pair<wxColour, int>(*wxWHITE, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled)); //StateColor btn_bd_white(std::pair<wxColour, int>(*wxWHITE, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_bt_white(std::pair<wxColour, int>(wxColour(0x90, 0x90, 0x90), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_txt_white(std::pair<wxColour, int>(wxColour("#FFFFFE"), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal));
m_cancelbutton = new Button(m_self, _L("Cancel")); m_cancelbutton = new Button(m_self, _L("Cancel"));
m_cancelbutton->SetSize(wxSize(m_self->FromDIP(58), m_self->FromDIP(22))); m_cancelbutton->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_cancelbutton->SetMinSize(wxSize(m_self->FromDIP(58), m_self->FromDIP(22)));
m_cancelbutton->SetMaxSize(wxSize(m_self->FromDIP(58), m_self->FromDIP(22)));
m_cancelbutton->SetBackgroundColor(btn_bt_white);
m_cancelbutton->SetBorderColor(btn_bd_white);
m_cancelbutton->SetTextColor(btn_txt_white);
m_cancelbutton->SetCornerRadius(m_self->FromDIP(12));
m_cancelbutton->Bind(wxEVT_BUTTON, m_cancelbutton->Bind(wxEVT_BUTTON,
[this](wxCommandEvent &evt) { [this](wxCommandEvent &evt) {
cancel(); cancel();
+21 -80
View File
@@ -135,32 +135,14 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
wxBoxSizer* m_sizer_button = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_sizer_button = new wxBoxSizer(wxHORIZONTAL);
m_sizer_button->Add(0, 0, 1, wxEXPAND, 5); m_sizer_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_bind = new Button(request_bind_panel, _L("Confirm")); m_button_bind = new Button(request_bind_panel, _L("Confirm"));
m_button_bind->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_bind->SetBackgroundColor(btn_bg_green);
m_button_bind->SetBorderColor(*wxWHITE);
m_button_bind->SetTextColor(wxColour("#FFFFFE"));
m_button_bind->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetCornerRadius(FromDIP(12));
m_button_bind->Enable(false); m_button_bind->Enable(false);
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(request_bind_panel, _L("Cancel")); m_button_cancel = new Button(request_bind_panel, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(BIND_DIALOG_GREY900);
m_button_cancel->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetTextColor(BIND_DIALOG_GREY900);
m_button_cancel->SetCornerRadius(FromDIP(12));
m_sizer_button->Add(m_button_bind, 0, wxALIGN_CENTER, 0); m_sizer_button->Add(m_button_bind, 0, wxALIGN_CENTER, 0);
m_sizer_button->Add(0, 0, 0, wxLEFT, FromDIP(13)); m_sizer_button->Add(0, 0, 0, wxLEFT, ButtonProps::ChoiceButtonGap());
m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0); m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0);
@@ -179,7 +161,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
sizer_request->Add(0, 0, 0, wxTOP, FromDIP(5)); sizer_request->Add(0, 0, 0, wxTOP, FromDIP(5));
sizer_request->Add(ping_code_input, 0, wxLEFT, FromDIP(10)); sizer_request->Add(ping_code_input, 0, wxLEFT, FromDIP(10));
sizer_request->Add(0, 0, 0, wxTOP, FromDIP(10)); sizer_request->Add(0, 0, 0, wxTOP, FromDIP(10));
sizer_request->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, FromDIP(15)); sizer_request->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
request_bind_panel->SetSizer(sizer_request); request_bind_panel->SetSizer(sizer_request);
request_bind_panel->Layout(); request_bind_panel->Layout();
request_bind_panel->Fit(); request_bind_panel->Fit();
@@ -197,12 +179,8 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
m_sizer_binding_button->Add(0, 0, 1, wxEXPAND, 5); m_sizer_binding_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_close = new Button(binding_panel, _L("Close")); m_button_close = new Button(binding_panel, _L("Close"));
m_button_close->SetBackgroundColor(btn_bg_white); m_button_close->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_close->SetBorderColor(BIND_DIALOG_GREY900);
m_button_close->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_close->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_close->SetTextColor(BIND_DIALOG_GREY900);
m_button_close->SetCornerRadius(FromDIP(12));
m_sizer_binding_button->Add(m_button_close, 0, wxALIGN_CENTER, 0); m_sizer_binding_button->Add(m_button_close, 0, wxALIGN_CENTER, 0);
auto sizer_binding = new wxBoxSizer(wxVERTICAL); auto sizer_binding = new wxBoxSizer(wxVERTICAL);
@@ -211,7 +189,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
sizer_binding->Add(0, 0, 0, wxTOP, FromDIP(10)); sizer_binding->Add(0, 0, 0, wxTOP, FromDIP(10));
sizer_binding->Add(m_loading_tip_txt, 0, wxALIGN_CENTER, 0); sizer_binding->Add(m_loading_tip_txt, 0, wxALIGN_CENTER, 0);
sizer_binding->Add(0, 0, 0, wxTOP, FromDIP(30)); sizer_binding->Add(0, 0, 0, wxTOP, FromDIP(30));
sizer_binding->Add(m_sizer_binding_button, 0, wxALIGN_RIGHT | wxRIGHT, FromDIP(20)); sizer_binding->Add(m_sizer_binding_button, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
binding_panel->SetSizer(sizer_binding); binding_panel->SetSizer(sizer_binding);
binding_panel->Layout(); binding_panel->Layout();
binding_panel->Fit(); binding_panel->Fit();
@@ -484,7 +462,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
wxString txt = _L("Thank you for purchasing a Bambu Lab device. Before using your Bambu Lab device, please read the terms and conditions. " wxString txt = _L("Thank you for purchasing a Bambu Lab device. Before using your Bambu Lab device, please read the terms and conditions. "
"By clicking to agree to use your Bambu Lab device, you agree to abide by the Privacy Policy and Terms of Use (collectively, the \"Terms\"). " "By clicking to agree to use your Bambu Lab device, you agree to abide by the Privacy Policy and Terms of Use (collectively, the \"Terms\"). "
"If you do not comply with or agree to the Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services."); "If you do not comply with or agree to the Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services.");
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Terms and Conditions"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM); ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Terms and Conditions"), ConfirmBeforeSendDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
confirm_dlg.update_text(txt); confirm_dlg.update_text(txt);
confirm_dlg.CenterOnParent(); confirm_dlg.CenterOnParent();
confirm_dlg.on_show(); confirm_dlg.on_show();
@@ -553,7 +531,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
"Personal Data by which an individual can be identified directly or indirectly, including " "Personal Data by which an individual can be identified directly or indirectly, including "
"without limitation names, addresses, payment information, or phone numbers. By enabling " "without limitation names, addresses, payment information, or phone numbers. By enabling "
"this service, you agree to these terms and the statement about Privacy Policy."); "this service, you agree to these terms and the statement about Privacy Policy.");
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Statement on User Experience Improvement Plan"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM); ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Statement on User Experience Improvement Plan"), ConfirmBeforeSendDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
wxString model_id_text; wxString model_id_text;
@@ -683,35 +661,15 @@ PingCodeBindDialog::~PingCodeBindDialog() {
auto button_panel = new wxPanel(m_simplebook, wxID_ANY, wxDefaultPosition, BIND_DIALOG_BUTTON_PANEL_SIZE); auto button_panel = new wxPanel(m_simplebook, wxID_ANY, wxDefaultPosition, BIND_DIALOG_BUTTON_PANEL_SIZE);
button_panel->SetBackgroundColour(*wxWHITE); button_panel->SetBackgroundColour(*wxWHITE);
wxBoxSizer *m_sizer_button = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *m_sizer_button = new wxBoxSizer(wxHORIZONTAL);
m_sizer_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_bind = new Button(button_panel, _L("Confirm")); m_button_bind = new Button(button_panel, _L("Confirm"));
m_button_bind->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_bind->SetBackgroundColor(btn_bg_green);
m_button_bind->SetBorderColor(*wxWHITE);
m_button_bind->SetTextColor(wxColour("#FFFFFE"));
m_button_bind->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_bind->SetCornerRadius(FromDIP(12));
m_button_bind->Enable(false); m_button_bind->Enable(false);
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(button_panel, _L("Cancel")); m_button_cancel = new Button(button_panel, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(BIND_DIALOG_GREY900);
m_button_cancel->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetTextColor(BIND_DIALOG_GREY900);
m_button_cancel->SetCornerRadius(FromDIP(12));
m_sizer_button->Add(m_button_bind, 0, wxALIGN_CENTER, 0); m_sizer_button->Add(m_button_bind, 0, wxALIGN_CENTER, 0);
m_sizer_button->Add(0, 0, 0, wxLEFT, FromDIP(13)); m_sizer_button->AddSpacer(ButtonProps::ChoiceButtonGap());
m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0); m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0);
button_panel->SetSizer(m_sizer_button); button_panel->SetSizer(m_sizer_button);
button_panel->Layout(); button_panel->Layout();
@@ -730,8 +688,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
m_sizer_main->Add(m_panel_agreement, 0, wxALIGN_CENTER, 0); m_sizer_main->Add(m_panel_agreement, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10)); m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
m_sizer_main->Add(m_sw_bind_failed_info, 0, wxALIGN_CENTER, 0); m_sizer_main->Add(m_sw_bind_failed_info, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(m_simplebook, 0, wxALIGN_CENTER, 0); m_sizer_main->Add(m_simplebook, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(20));
SetSizer(m_sizer_main); SetSizer(m_sizer_main);
Layout(); Layout();
@@ -891,8 +848,8 @@ PingCodeBindDialog::~PingCodeBindDialog() {
void BindMachineDialog::on_dpi_changed(const wxRect &suggested_rect) void BindMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
{ {
m_button_bind->SetMinSize(BIND_DIALOG_BUTTON_SIZE); m_button_bind->Rescale(); // ORCA
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE); m_button_cancel->Rescale(); // ORCA
} }
void BindMachineDialog::update_machine_info(MachineObject* info) void BindMachineDialog::update_machine_info(MachineObject* info)
@@ -1040,34 +997,18 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
m_sizer_button->Add(0, 0, 1, wxEXPAND, 5); m_sizer_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_unbind = new Button(this, _L("Confirm")); m_button_unbind = new Button(this, _L("Confirm"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), m_button_unbind->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_unbind->SetBackgroundColor(btn_bg_green);
m_button_unbind->SetBorderColor(wxColour(0, 150, 136));
m_button_unbind->SetTextColor(wxColour("#FFFFFE"));
m_button_unbind->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_unbind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_unbind->SetCornerRadius(FromDIP(12));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(BIND_DIALOG_GREY900);
m_button_cancel->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE);
m_button_cancel->SetTextColor(BIND_DIALOG_GREY900);
m_button_cancel->SetCornerRadius(FromDIP(12));
m_sizer_button->Add(m_button_unbind, 0, wxALIGN_CENTER, 0); m_sizer_button->Add(m_button_unbind, 0, wxALIGN_CENTER, 0);
m_sizer_button->Add(0, 0, 0, wxLEFT, FromDIP(13)); m_sizer_button->Add(0, 0, 0, wxLEFT, ButtonProps::ChoiceButtonGap());
m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0); m_sizer_button->Add(m_button_cancel, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(m_status_text, 0, wxALIGN_CENTER, 0); m_sizer_main->Add(m_status_text, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10)); m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
m_sizer_main->Add(m_sizer_button, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30)); m_sizer_main->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT, ButtonProps::ChoiceButtonGap());
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(20)); m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(20));
SetSizer(m_sizer_main); SetSizer(m_sizer_main);
@@ -1133,8 +1074,8 @@ void UnBindMachineDialog::on_unbind_printer(wxCommandEvent &event)
void UnBindMachineDialog::on_dpi_changed(const wxRect &suggested_rect) void UnBindMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
{ {
m_button_unbind->SetMinSize(BIND_DIALOG_BUTTON_SIZE); m_button_unbind->Rescale(); // ORCA
m_button_cancel->SetMinSize(BIND_DIALOG_BUTTON_SIZE); m_button_cancel->Rescale(); // ORCA
} }
void UnBindMachineDialog::on_show(wxShowEvent &event) void UnBindMachineDialog::on_show(wxShowEvent &event)
+13 -65
View File
@@ -7,6 +7,7 @@
#include "format.hpp" #include "format.hpp"
#include "MsgDialog.hpp" #include "MsgDialog.hpp"
#include "slic3r/Utils/CalibUtils.hpp" #include "slic3r/Utils/CalibUtils.hpp"
#include "Widgets/DialogButtons.hpp"
#include <wx/gbsizer.h> #include <wx/gbsizer.h>
#include "Plater.hpp" #include "Plater.hpp"
@@ -114,15 +115,7 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector<PACalibResult>&
scroll_window->SetSizer(scroll_sizer); scroll_window->SetSizer(scroll_sizer);
Button * mew_btn = new Button(scroll_window, _L("New")); Button * mew_btn = new Button(scroll_window, _L("New"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), mew_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
mew_btn->SetBackgroundColour(*wxWHITE);
mew_btn->SetBackgroundColor(btn_bg_green);
mew_btn->SetBorderColor(wxColour(0, 150, 136));
mew_btn->SetTextColor(wxColour("#FFFFFE"));
mew_btn->SetMinSize(wxSize(FromDIP(100), FromDIP(24)));
mew_btn->SetMaxSize(wxSize(FromDIP(100), FromDIP(24)));
mew_btn->SetCornerRadius(FromDIP(12));
mew_btn->Bind(wxEVT_BUTTON, &HistoryWindow::on_click_new_button, this); mew_btn->Bind(wxEVT_BUTTON, &HistoryWindow::on_click_new_button, this);
scroll_sizer->Add(mew_btn, 0, wxLEFT, FromDIP(20)); scroll_sizer->Add(mew_btn, 0, wxLEFT, FromDIP(20));
@@ -379,9 +372,7 @@ void HistoryWindow::sync_history_data() {
auto n_value = new Label(m_history_data_panel, n_str); auto n_value = new Label(m_history_data_panel, n_str);
n_value->Hide(); n_value->Hide();
auto delete_button = new Button(m_history_data_panel, _L("Delete")); auto delete_button = new Button(m_history_data_panel, _L("Delete"));
delete_button->SetBackgroundColour(*wxWHITE); delete_button->SetStyle(ButtonStyle::Alert, ButtonType::Window);
delete_button->SetMinSize(wxSize(-1, FromDIP(24)));
delete_button->SetCornerRadius(FromDIP(12));
delete_button->Bind(wxEVT_BUTTON, [this, gbSizer, i, &result](auto& e) { delete_button->Bind(wxEVT_BUTTON, [this, gbSizer, i, &result](auto& e) {
if (m_ui_op_lock) { if (m_ui_op_lock) {
return; return;
@@ -405,15 +396,7 @@ void HistoryWindow::sync_history_data() {
}); });
auto edit_button = new Button(m_history_data_panel, _L("Edit")); auto edit_button = new Button(m_history_data_panel, _L("Edit"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), edit_button->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
edit_button->SetBackgroundColour(*wxWHITE);
edit_button->SetBackgroundColor(btn_bg_green);
edit_button->SetBorderColor(wxColour(0, 150, 136));
edit_button->SetTextColor(wxColour("#FFFFFE"));
edit_button->SetMinSize(wxSize(-1, FromDIP(24)));
edit_button->SetCornerRadius(FromDIP(12));
edit_button->Bind(wxEVT_BUTTON, [this, result, k_value, name_value, edit_button](auto& e) { edit_button->Bind(wxEVT_BUTTON, [this, result, k_value, name_value, edit_button](auto& e) {
if (m_ui_op_lock) return; if (m_ui_op_lock) return;
@@ -580,29 +563,11 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow
panel_sizer->AddSpacer(FromDIP(25)); panel_sizer->AddSpacer(FromDIP(25));
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto dlg_btns = new DialogButtons(top_panel, {"OK", "Cancel"});
Button* save_btn = new Button(top_panel, _L("Save")); dlg_btns->GetOK()->SetLabel(_L("Save"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), dlg_btns->GetOK()->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_save, this);
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_cancel, this);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)); panel_sizer->Add(dlg_btns, 0, wxEXPAND, 0);
save_btn->SetBackgroundColour(*wxWHITE);
save_btn->SetBackgroundColor(btn_bg_green);
save_btn->SetBorderColor(wxColour(0, 150, 136));
save_btn->SetTextColor(wxColour("#FFFFFE"));
save_btn->SetMinSize(wxSize(-1, FromDIP(24)));
save_btn->SetCornerRadius(FromDIP(12));
Button* cancel_btn = new Button(top_panel, _L("Cancel"));
cancel_btn->SetBackgroundColour(*wxWHITE);
cancel_btn->SetMinSize(wxSize(-1, FromDIP(24)));
cancel_btn->SetCornerRadius(FromDIP(12));
save_btn->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_save, this);
cancel_btn->Bind(wxEVT_BUTTON, &EditCalibrationHistoryDialog::on_cancel, this);
btn_sizer->AddStretchSpacer();
btn_sizer->Add(save_btn);
btn_sizer->AddSpacer(FromDIP(20));
btn_sizer->Add(cancel_btn);
panel_sizer->Add(btn_sizer, 0, wxEXPAND, 0);
main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20)); main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20));
@@ -844,27 +809,10 @@ NewCalibrationHistoryDialog::NewCalibrationHistoryDialog(wxWindow *parent, const
panel_sizer->AddSpacer(FromDIP(25)); panel_sizer->AddSpacer(FromDIP(25));
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto dlg_btns = new DialogButtons(top_panel, {"OK", "Cancel"});
Button * ok_btn = new Button(top_panel, _L("OK")); dlg_btns->GetOK()->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_ok, this);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_cancel, this);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)); panel_sizer->Add(dlg_btns, 0, wxEXPAND, 0);
ok_btn->SetBackgroundColour(*wxWHITE);
ok_btn->SetBackgroundColor(btn_bg_green);
ok_btn->SetBorderColor(wxColour(0, 150, 136));
ok_btn->SetTextColor(wxColour("#FFFFFE"));
ok_btn->SetMinSize(wxSize(-1, FromDIP(24)));
ok_btn->SetCornerRadius(FromDIP(12));
Button *cancel_btn = new Button(top_panel, _L("Cancel"));
cancel_btn->SetBackgroundColour(*wxWHITE);
cancel_btn->SetMinSize(wxSize(-1, FromDIP(24)));
cancel_btn->SetCornerRadius(FromDIP(12));
ok_btn->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_ok, this);
cancel_btn->Bind(wxEVT_BUTTON, &NewCalibrationHistoryDialog::on_cancel, this);
btn_sizer->AddStretchSpacer();
btn_sizer->Add(ok_btn);
btn_sizer->AddSpacer(FromDIP(20));
btn_sizer->Add(cancel_btn);
panel_sizer->Add(btn_sizer, 0, wxEXPAND, 0);
main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20)); main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20));
+1 -9
View File
@@ -141,16 +141,8 @@ CalibrationDialog::CalibrationDialog(Plater *plater)
m_calibration_flow->SetMinSize(wxSize(CALI_FLOW_CONTENT_WIDTH, FromDIP(160))); m_calibration_flow->SetMinSize(wxSize(CALI_FLOW_CONTENT_WIDTH, FromDIP(160)));
m_calibration_flow->SetSize(wxSize(CALI_FLOW_CONTENT_WIDTH, FromDIP(160))); m_calibration_flow->SetSize(wxSize(CALI_FLOW_CONTENT_WIDTH, FromDIP(160)));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_calibration_btn = new Button(cali_right_panel, _L("Start Calibration")); m_calibration_btn = new Button(cali_right_panel, _L("Start Calibration"));
m_calibration_btn->SetBackgroundColor(btn_bg_green); m_calibration_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_calibration_btn->SetBorderColor(btn_bd_green);
m_calibration_btn->SetTextColor(wxColour("#FFFFFE"));
m_calibration_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_calibration_btn->SetMinSize(wxSize(FromDIP(128), FromDIP(26)));
cali_right_sizer_v->Add(cali_text_right_top, 0, wxALIGN_CENTER, 0); cali_right_sizer_v->Add(cali_text_right_top, 0, wxALIGN_CENTER, 0);
cali_right_sizer_v->Add(0, 0, 0, wxTOP, FromDIP(7)); cali_right_sizer_v->Add(0, 0, 0, wxTOP, FromDIP(7));
+4 -7
View File
@@ -42,13 +42,10 @@ CloneDialog::CloneDialog(wxWindow *parent)
m_progress->Hide(); m_progress->Hide();
bottom_sizer->Add(m_progress, 2, wxEXPAND | wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(10)); bottom_sizer->Add(m_progress, 2, wxEXPAND | wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(10));
// used next button to get automatic left alignment auto dlg_btns = new DialogButtons(this, {"Fill", "OK", "Cancel"}, "", 1 /*left_aligned*/);
// will add a left_align_first_n parameter to DialogButtons. current method not good
auto dlg_btns = new DialogButtons(this, {"Next", "OK", "Cancel"});
dlg_btns->GetNEXT()->SetLabel(_L("Fill")); dlg_btns->GetFIRST()->SetToolTip(_L("Fill bed with copies"));
dlg_btns->GetNEXT()->SetToolTip(_L("Fill bed with copies")); dlg_btns->GetFIRST()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
dlg_btns->GetNEXT()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
m_plater->fill_bed_with_instances(); m_plater->fill_bed_with_instances();
EndModal(wxID_OK); EndModal(wxID_OK);
}); });
@@ -63,7 +60,7 @@ CloneDialog::CloneDialog(wxWindow *parent)
m_progress->Show(); m_progress->Show();
dlg_btns->GetOK()->Hide(); dlg_btns->GetOK()->Hide();
dlg_btns->GetNEXT()->Hide(); dlg_btns->GetFIRST()->Hide();
this->Layout(); this->Layout();
v_sizer->Fit(this); v_sizer->Fit(this);
+2 -20
View File
@@ -49,24 +49,7 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons
sizer_connect->Add(FromDIP(20), 0); sizer_connect->Add(FromDIP(20), 0);
m_button_confirm = new Button(this, _L("Confirm")); m_button_confirm = new Button(this, _L("Confirm"));
m_button_confirm->SetFont(Label::Body_12); m_button_confirm->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_confirm->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
StateColor btn_bg(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_text(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
m_button_confirm->SetBackgroundColor(btn_bg);
m_button_confirm->SetBorderColor(btn_bd);
m_button_confirm->SetTextColor(btn_text);
sizer_connect->Add(m_button_confirm, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0); sizer_connect->Add(m_button_confirm, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0);
@@ -193,8 +176,7 @@ void ConnectPrinterDialog::on_dpi_changed(const wxRect &suggested_rect)
m_textCtrl_code->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(22))); m_textCtrl_code->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(22)));
m_textCtrl_code->GetTextCtrl()->SetMinSize(wxSize(-1, FromDIP(22))); m_textCtrl_code->GetTextCtrl()->SetMinSize(wxSize(-1, FromDIP(22)));
m_button_confirm->SetCornerRadius(FromDIP(12)); m_button_confirm->Rescale(); // ORCA No need to set style again
m_button_confirm->Rescale();
Layout(); Layout();
this->Refresh(); this->Refresh();
+3 -3
View File
@@ -2737,7 +2737,7 @@ wxBoxSizer *CreatePrinterPresetDialog::create_presets_template_item(wxWindow *pa
wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *parent) wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *parent)
{ {
auto dlg_btns = new DialogButtons(parent, {"Return", "OK", "Cancel"}); auto dlg_btns = new DialogButtons(parent, {"Return", "OK", "Cancel"}, "", 1 /*left_aligned*/);
dlg_btns->GetRETURN()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { show_page1(); }); dlg_btns->GetRETURN()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { show_page1(); });
@@ -4741,9 +4741,9 @@ wxBoxSizer *EditFilamentPresetDialog::create_preset_tree_sizer()
wxWindow *EditFilamentPresetDialog::create_dialog_buttons() wxWindow *EditFilamentPresetDialog::create_dialog_buttons()
{ {
auto dlg_btns = new DialogButtons(this, {"Delete", "OK"}); auto dlg_btns = new DialogButtons(this, {"Delete", "OK"}, "", 1 /*left_aligned*/);
dlg_btns->GetButtonFromID(wxID_DELETE)->Bind(wxEVT_BUTTON, ([this](wxCommandEvent &e) { dlg_btns->GetFIRST()->Bind(wxEVT_BUTTON, ([this](wxCommandEvent &e) {
WarningDialog dlg(this, _L("All the filament presets belong to this filament would be deleted.\n" WarningDialog dlg(this, _L("All the filament presets belong to this filament would be deleted.\n"
"If you are using this filament on your printer, please reset the filament information for that slot."), "If you are using this filament on your printer, please reset the filament information for that slot."),
_L("Delete filament"), wxYES | wxCANCEL | wxCANCEL_DEFAULT | wxCENTRE); _L("Delete filament"), wxYES | wxCANCEL | wxCANCEL_DEFAULT | wxCENTRE);
+1 -1
View File
@@ -4319,7 +4319,7 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_
void MachineObject::set_ctt_dlg( wxString text){ void MachineObject::set_ctt_dlg( wxString text){
if (!m_set_ctt_dlg) { if (!m_set_ctt_dlg) {
m_set_ctt_dlg = true; m_set_ctt_dlg = true;
auto print_error_dlg = new GUI::SecondaryCheckDialog(nullptr, wxID_ANY, _L("Warning"), GUI::SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM); auto print_error_dlg = new GUI::SecondaryCheckDialog(nullptr, wxID_ANY, _L("Warning"), GUI::SecondaryCheckDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
print_error_dlg->update_text(text); print_error_dlg->update_text(text);
print_error_dlg->Bind(wxEVT_SHOW, [this](auto& e) { print_error_dlg->Bind(wxEVT_SHOW, [this](auto& e) {
if (!e.IsShown()) { if (!e.IsShown()) {
+5 -38
View File
@@ -171,37 +171,16 @@ void ExtrusionCalibration::create()
m_error_text->Hide(); m_error_text->Hide();
m_button_cali = new Button(m_step_1_panel, _L("Start calibration")); m_button_cali = new Button(m_step_1_panel, _L("Start calibration"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), m_button_cali->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_cali->SetBackgroundColor(m_btn_bg_green);
m_button_cali->SetFont(Label::Body_13);
m_button_cali->SetBorderColor({ std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Enabled) });
m_button_cali->SetTextColor({ std::pair<wxColour, int>(wxColour(172, 172, 172), StateColor::Disabled), std::pair<wxColour, int>(EXTRUSION_CALIBRATION_GREY200, StateColor::Enabled) });
m_button_cali->SetCornerRadius(FromDIP(12));
m_button_cali->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_cali->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_cali, this); m_button_cali->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_cali, this);
m_cali_cancel = new Button(m_step_1_panel, _L("Cancel")); m_cali_cancel = new Button(m_step_1_panel, _L("Cancel"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), m_cali_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_cali_cancel->SetBackgroundColor(m_btn_bg_green);
m_cali_cancel->SetBorderColor(wxColour(0, 150, 136));
m_cali_cancel->SetTextColor(EXTRUSION_CALIBRATION_GREY200);
m_cali_cancel->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_cali_cancel->SetCornerRadius(FromDIP(12));
m_cali_cancel->Hide(); m_cali_cancel->Hide();
m_cali_cancel->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_cancel, this); m_cali_cancel->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_cancel, this);
m_button_next_step = new Button(m_step_1_panel, _L("Next")); m_button_next_step = new Button(m_step_1_panel, _L("Next"));
m_btn_bg_gray = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(*wxWHITE, StateColor::Focused), m_button_next_step->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_next_step->SetBackgroundColor(m_btn_bg_gray);
m_button_next_step->SetFont(Label::Body_13);
m_button_next_step->SetBorderColor(EXTRUSION_CALIBRATION_GREY900);
m_button_next_step->SetTextColor(EXTRUSION_CALIBRATION_GREY900);
m_button_next_step->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_button_next_step->SetCornerRadius(FromDIP(12));
m_button_next_step->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_next, this); m_button_next_step->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_next, this);
m_button_next_step->Hide(); m_button_next_step->Hide();
@@ -257,23 +236,11 @@ void ExtrusionCalibration::create()
// save button // save button
m_button_save_result = new Button(m_step_2_panel, _L("Save")); m_button_save_result = new Button(m_step_2_panel, _L("Save"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), m_button_save_result->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_save_result->SetBackgroundColor(m_btn_bg_green);
m_button_save_result->SetFont(Label::Body_13);
m_button_save_result->SetBorderColor(wxColour(0, 150, 136));
m_button_save_result->SetTextColor(EXTRUSION_CALIBRATION_GREY200);
m_button_save_result->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_button_save_result->SetCornerRadius(FromDIP(12));
m_button_save_result->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_save, this); m_button_save_result->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_save, this);
m_button_last_step = new Button(m_step_2_panel, _L("Last Step")); // Back for english m_button_last_step = new Button(m_step_2_panel, _L("Last Step")); // Back for english
m_button_last_step->SetBackgroundColor(m_btn_bg_gray); m_button_last_step->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_last_step->SetFont(Label::Body_13);
m_button_last_step->SetBorderColor(EXTRUSION_CALIBRATION_GREY900);
m_button_last_step->SetTextColor(EXTRUSION_CALIBRATION_GREY900);
m_button_last_step->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE);
m_button_last_step->SetCornerRadius(FromDIP(12));
m_button_last_step->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_last, this); m_button_last_step->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_last, this);
-3
View File
@@ -91,9 +91,6 @@ protected:
int get_bed_temp(DynamicPrintConfig* config); int get_bed_temp(DynamicPrintConfig* config);
protected: protected:
StateColor m_btn_bg_green;
StateColor m_btn_bg_gray;
wxPanel* m_step_1_panel; wxPanel* m_step_1_panel;
wxPanel* m_step_2_panel; wxPanel* m_step_2_panel;
+6 -57
View File
@@ -7,6 +7,7 @@
#include "Widgets/Label.hpp" #include "Widgets/Label.hpp"
#include "Widgets/Button.hpp" #include "Widgets/Button.hpp"
#include "Widgets/StateColor.hpp" #include "Widgets/StateColor.hpp"
#include "Widgets/DialogButtons.hpp"
#include "wxExtensions.hpp" #include "wxExtensions.hpp"
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/sizer.h> #include <wx/sizer.h>
@@ -97,8 +98,11 @@ FilamentPickerDialog::FilamentPickerDialog(wxWindow *parent, const wxString& fil
main_sizer->AddSpacer(FromDIP(8)); main_sizer->AddSpacer(FromDIP(8));
// OK / Cancel buttons // OK / Cancel buttons
wxBoxSizer* btn_sizer = CreateButtonPanel(); auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
main_sizer->Add(btn_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(10)); m_ok_btn = dlg_btns->GetOK();
m_cancel_btn = dlg_btns->GetCANCEL();
main_sizer->Add(dlg_btns, 0, wxEXPAND);
container_sizer->Add(main_sizer, 1, wxEXPAND | wxALL, FromDIP(16)); container_sizer->Add(main_sizer, 1, wxEXPAND | wxALL, FromDIP(16));
SetSizer(container_sizer); SetSizer(container_sizer);
@@ -542,61 +546,6 @@ void FilamentPickerDialog::CreateMoreInfoButton()
m_more_btn->SetCornerRadius(FromDIP(0)); m_more_btn->SetCornerRadius(FromDIP(0));
} }
wxBoxSizer* FilamentPickerDialog::CreateButtonPanel()
{
wxBoxSizer* btn_sizer = new wxBoxSizer(wxHORIZONTAL);
// Add spacer to push buttons to the right
btn_sizer->AddStretchSpacer();
// standard button color style
StateColor btn_bg_green(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor btn_bd_green(
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor btn_text_green(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
);
StateColor btn_bg_white(
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
);
StateColor btn_bd_white(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor btn_text_white(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
// Create Cancel button using project's Button class
m_cancel_btn = new Button(this, _L("Cancel"), "", 0, 0, wxID_CANCEL);
m_cancel_btn->SetMinSize(wxSize(FromDIP(55), FromDIP(24)));
m_cancel_btn->SetCornerRadius(FromDIP(12));
m_cancel_btn->SetBackgroundColor(btn_bg_white);
m_cancel_btn->SetBorderColor(btn_bd_white);
m_cancel_btn->SetTextColor(btn_text_white);
btn_sizer->Add(m_cancel_btn, 0, wxEXPAND, 0);
btn_sizer->AddSpacer(FromDIP(10));
// Create OK button using project's Button class
m_ok_btn = new Button(this, _L("OK"), "", 0, 0, wxID_OK);
m_ok_btn->SetMinSize(wxSize(FromDIP(55), FromDIP(24)));
m_ok_btn->SetCornerRadius(FromDIP(12));
m_ok_btn->SetBackgroundColor(btn_bg_green);
m_ok_btn->SetBorderColor(btn_bd_green);
m_ok_btn->SetTextColor(btn_text_green);
m_ok_btn->SetFocus();
btn_sizer->Add(m_ok_btn, 0, wxEXPAND, 0);
return btn_sizer;
}
wxColourData FilamentPickerDialog::GetSingleColorData() wxColourData FilamentPickerDialog::GetSingleColorData()
{ {
wxColourData data; wxColourData data;
-1
View File
@@ -55,7 +55,6 @@ private:
wxScrolledWindow* CreateColorGrid(); wxScrolledWindow* CreateColorGrid();
wxBoxSizer* CreateSeparatorLine(); wxBoxSizer* CreateSeparatorLine();
void CreateMoreInfoButton(); void CreateMoreInfoButton();
wxBoxSizer* CreateButtonPanel();
void BindEvents(); void BindEvents();
// Preview panel helper methods // Preview panel helper methods
+2 -27
View File
@@ -282,29 +282,10 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
); );
//edit prints //edit prints
auto m_btn_bg_enable = StateColor(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor clean_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
StateColor clean_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor clean_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
auto sizer_button_printer = new wxBoxSizer(wxHORIZONTAL); auto sizer_button_printer = new wxBoxSizer(wxHORIZONTAL);
sizer_button_printer->SetMinSize(wxSize(FromDIP(DEVICE_ITEM_MAX_WIDTH), -1)); sizer_button_printer->SetMinSize(wxSize(FromDIP(DEVICE_ITEM_MAX_WIDTH), -1));
m_button_edit = new Button(m_main_panel, _L("Edit Printers")); m_button_edit = new Button(m_main_panel, _L("Edit Printers"));
m_button_edit->SetBackgroundColor(clean_bg); m_button_edit->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_edit->SetBorderColor(clean_bd);
m_button_edit->SetTextColor(clean_text);
m_button_edit->SetFont(Label::Body_12);
m_button_edit->SetCornerRadius(6);
m_button_edit->SetMinSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_edit->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_edit->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) { m_button_edit->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) {
MultiMachinePickPage dlg; MultiMachinePickPage dlg;
@@ -405,13 +386,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
m_tip_text->Wrap(-1); m_tip_text->Wrap(-1);
m_button_add = new Button(m_main_panel, _L("Add")); m_button_add = new Button(m_main_panel, _L("Add"));
m_button_add->SetBackgroundColor(m_btn_bg_enable); m_button_add->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_add->SetBorderColor(m_btn_bg_enable);
m_button_add->SetTextColor(*wxWHITE);
m_button_add->SetFont(Label::Body_12);
m_button_add->SetCornerRadius(6);
m_button_add->SetMinSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) { m_button_add->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) {
MultiMachinePickPage dlg; MultiMachinePickPage dlg;
+4 -5
View File
@@ -4,6 +4,7 @@
#include "Jobs/BoostThreadWorker.hpp" #include "Jobs/BoostThreadWorker.hpp"
#include "Jobs/PlaterWorker.hpp" #include "Jobs/PlaterWorker.hpp"
#include "wxExtensions.hpp" #include "wxExtensions.hpp"
#include "Widgets/DialogButtons.hpp"
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {
@@ -20,10 +21,8 @@ OAuthDialog::OAuthDialog(wxWindow* parent, OAuthParams params)
m_worker = std::make_unique<PlaterWorker<BoostThreadWorker>>(this, nullptr, "auth_worker"); m_worker = std::make_unique<PlaterWorker<BoostThreadWorker>>(this, nullptr, "auth_worker");
wxStdDialogButtonSizer* btns = this->CreateStdDialogButtonSizer(wxCANCEL); auto dlg_btns = new DialogButtons(this, {"Cancel"});
btnCancel = static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this)); dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &OAuthDialog::on_cancel, this);
wxGetApp().UpdateDarkUI(btnCancel);
btnCancel->Bind(wxEVT_BUTTON, &OAuthDialog::on_cancel, this);
const auto message_sizer = new wxBoxSizer(wxVERTICAL); const auto message_sizer = new wxBoxSizer(wxVERTICAL);
const auto message = new wxStaticText(this, wxID_ANY, _L("Authorizing..."), wxDefaultPosition, wxDefaultSize, 0); const auto message = new wxStaticText(this, wxID_ANY, _L("Authorizing..."), wxDefaultPosition, wxDefaultSize, 0);
@@ -32,7 +31,7 @@ OAuthDialog::OAuthDialog(wxWindow* parent, OAuthParams params)
const auto topSizer = new wxBoxSizer(wxVERTICAL); const auto topSizer = new wxBoxSizer(wxVERTICAL);
topSizer->Add(message_sizer, 0, wxEXPAND | wxALL, BORDER_W); topSizer->Add(message_sizer, 0, wxEXPAND | wxALL, BORDER_W);
topSizer->Add(btns, 0, wxEXPAND | wxALL, BORDER_W); topSizer->Add(dlg_btns, 0, wxEXPAND);
Bind(wxEVT_CLOSE_WINDOW, &OAuthDialog::on_cancel, this); Bind(wxEVT_CLOSE_WINDOW, &OAuthDialog::on_cancel, this);
-1
View File
@@ -14,7 +14,6 @@ private:
OAuthParams _params; OAuthParams _params;
std::shared_ptr<OAuthResult> _result; std::shared_ptr<OAuthResult> _result;
wxButton* btnCancel{nullptr};
std::unique_ptr<Worker> m_worker; std::unique_ptr<Worker> m_worker;
void on_cancel(wxEvent& event); void on_cancel(wxEvent& event);
+16 -114
View File
@@ -12,6 +12,7 @@
#include "libslic3r/Config.hpp" #include "libslic3r/Config.hpp"
#include "BitmapComboBox.hpp" #include "BitmapComboBox.hpp"
#include "Widgets/ComboBox.hpp" #include "Widgets/ComboBox.hpp"
#include "Widgets/DialogButtons.hpp"
#include <wx/sizer.h> #include <wx/sizer.h>
#include "libslic3r/ObjColorUtils.hpp" #include "libslic3r/ObjColorUtils.hpp"
@@ -40,12 +41,7 @@ static void update_ui(wxWindow* window)
static const char g_min_cluster_color = 1; static const char g_min_cluster_color = 1;
static const char g_max_color = (int) EnforcerBlockerType::ExtruderMax; static const char g_max_color = (int) EnforcerBlockerType::ExtruderMax;
const StateColor ok_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
const StateColor ok_btn_disable_bg(std::pair<wxColour, int>(wxColour(205, 201, 201), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(205, 201, 201), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(205, 201, 201), StateColor::Normal));
wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error) wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error)
{ {
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
@@ -58,7 +54,7 @@ wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error)
auto font = tips->GetFont(); auto font = tips->GetFont();
font.SetUnderlined(true); font.SetUnderlined(true);
tips->SetFont(font); tips->SetFont(font);
tips->SetForegroundColour(wxColour(0, 174, 100)); tips->SetForegroundColour(wxColour("#009687"));
tips->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { tips->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
bool is_zh = wxGetApp().app_config->get("language") == "zh_CN"; bool is_zh = wxGetApp().app_config->get("language") == "zh_CN";
if (is_zh) { if (is_zh) {
@@ -71,79 +67,16 @@ wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error)
} }
btn_sizer->AddStretchSpacer(); btn_sizer->AddStretchSpacer();
StateColor ok_btn_bd( auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal) m_button_list[wxOK] = dlg_btns->GetOK();
); m_button_list[wxCANCEL] = dlg_btns->GetCANCEL();
StateColor ok_btn_text(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal) btn_sizer->Add(dlg_btns, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL);
);
StateColor cancel_btn_bg(
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
);
StateColor cancel_btn_bd_(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor cancel_btn_text(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor calc_btn_bg(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor calc_btn_bd(
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor calc_btn_text(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
);
if (flags & wxOK) {
Button* ok_btn = new Button(this, _L("OK"));
ok_btn->SetMinSize(BTN_SIZE);
ok_btn->SetCornerRadius(FromDIP(12));
ok_btn->Enable(false);
ok_btn->SetBackgroundColor(ok_btn_disable_bg);
ok_btn->SetBorderColor(ok_btn_bd);
ok_btn->SetTextColor(ok_btn_text);
ok_btn->SetFocus();
ok_btn->SetId(wxID_OK);
btn_sizer->Add(ok_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, BTN_GAP);
m_button_list[wxOK] = ok_btn;
}
if (flags & wxCANCEL) {
Button* cancel_btn = new Button(this, _L("Cancel"));
cancel_btn->SetMinSize(BTN_SIZE);
cancel_btn->SetCornerRadius(FromDIP(12));
cancel_btn->SetBackgroundColor(cancel_btn_bg);
cancel_btn->SetBorderColor(cancel_btn_bd_);
cancel_btn->SetTextColor(cancel_btn_text);
cancel_btn->SetId(wxID_CANCEL);
btn_sizer->Add(cancel_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, BTN_GAP);
m_button_list[wxCANCEL] = cancel_btn;
}
return btn_sizer; return btn_sizer;
} }
void ObjColorDialog::on_dpi_changed(const wxRect &suggested_rect) void ObjColorDialog::on_dpi_changed(const wxRect &suggested_rect)
{ {
for (auto button_item : m_button_list)
{
if (button_item.first == wxRESET)
{
button_item.second->SetMinSize(wxSize(FromDIP(75), FromDIP(24)));
button_item.second->SetCornerRadius(FromDIP(12));
}
if (button_item.first == wxOK) {
button_item.second->SetMinSize(BTN_SIZE);
button_item.second->SetCornerRadius(FromDIP(12));
}
if (button_item.first == wxCANCEL) {
button_item.second->SetMinSize(BTN_SIZE);
button_item.second->SetCornerRadius(FromDIP(12));
}
}
m_panel_ObjColor->msw_rescale(); m_panel_ObjColor->msw_rescale();
this->Refresh(); this->Refresh();
} }
@@ -215,12 +148,12 @@ ObjColorDialog::ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out,
if (!ok) { if (!ok) {
m_button_list[wxCANCEL]->Hide(); m_button_list[wxCANCEL]->Hide();
m_button_list[wxOK]->Enable(true); m_button_list[wxOK]->Enable(true);
m_button_list[wxOK]->SetBackgroundColor(ok_btn_bg); // ORCA no need to set colors again
} else { } else {
m_button_list[wxOK]->Bind(wxEVT_UPDATE_UI, ([this](wxUpdateUIEvent &e) { m_button_list[wxOK]->Bind(wxEVT_UPDATE_UI, ([this](wxUpdateUIEvent &e) {
if (m_panel_ObjColor->is_ok() == m_button_list[wxOK]->IsEnabled()) { return; } if (m_panel_ObjColor->is_ok() == m_button_list[wxOK]->IsEnabled()) { return; }
m_button_list[wxOK]->Enable(m_panel_ObjColor->is_ok()); m_button_list[wxOK]->Enable(m_panel_ObjColor->is_ok());
m_button_list[wxOK]->SetBackgroundColor(m_panel_ObjColor->is_ok() ? ok_btn_bg : ok_btn_disable_bg); // ORCA no need to set colors again
})); }));
} }
m_main_sizer->Add(m_buttons_sizer, 0, wxBOTTOM | wxTOP | wxRIGHT | wxEXPAND, BTN_GAP); m_main_sizer->Add(m_buttons_sizer, 0, wxBOTTOM | wxTOP | wxRIGHT | wxEXPAND, BTN_GAP);
@@ -556,23 +489,12 @@ void ObjColorPanel::do_layout_callback() {
wxBoxSizer *ObjColorPanel::create_approximate_match_btn_sizer(wxWindow *parent) wxBoxSizer *ObjColorPanel::create_approximate_match_btn_sizer(wxWindow *parent)
{ {
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor calc_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_text(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal));
//create btn
m_quick_approximate_match_btn = new Button(parent, _L("Color match")); m_quick_approximate_match_btn = new Button(parent, _L("Color match"));
m_quick_approximate_match_btn->SetToolTip(_L("Approximate color matching.")); m_quick_approximate_match_btn->SetToolTip(_L("Approximate color matching."));
auto cur_btn = m_quick_approximate_match_btn; m_quick_approximate_match_btn->SetStyle(ButtonStyle::Regular, ButtonType::Window);
cur_btn->SetFont(Label::Body_13); m_quick_approximate_match_btn->SetFocus();
cur_btn->SetMinSize(wxSize(FromDIP(60), FromDIP(20))); btn_sizer->Add(m_quick_approximate_match_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
cur_btn->SetCornerRadius(FromDIP(10)); m_quick_approximate_match_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {
cur_btn->SetBackgroundColor(calc_btn_bg);
cur_btn->SetBorderColor(calc_btn_bd);
cur_btn->SetTextColor(calc_btn_text);
cur_btn->SetFocus();
btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {
deal_approximate_match_btn(); deal_approximate_match_btn();
deal_thumbnail(); deal_thumbnail();
}); });
@@ -582,20 +504,10 @@ wxBoxSizer *ObjColorPanel::create_approximate_match_btn_sizer(wxWindow *parent)
wxBoxSizer *ObjColorPanel::create_add_btn_sizer(wxWindow *parent) wxBoxSizer *ObjColorPanel::create_add_btn_sizer(wxWindow *parent)
{ {
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor calc_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_text(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal));
// create btn
m_quick_add_btn = new Button(parent, _L("Append")); m_quick_add_btn = new Button(parent, _L("Append"));
m_quick_add_btn->SetToolTip(_L("Append to existing filaments")); m_quick_add_btn->SetToolTip(_L("Append to existing filaments"));
auto cur_btn = m_quick_add_btn; auto cur_btn = m_quick_add_btn;
cur_btn->SetFont(Label::Body_13); cur_btn->SetStyle(ButtonStyle::Regular, ButtonType::Window);
cur_btn->SetMinSize(wxSize(FromDIP(60), FromDIP(20)));
cur_btn->SetCornerRadius(FromDIP(10));
cur_btn->SetBackgroundColor(calc_btn_bg);
cur_btn->SetBorderColor(calc_btn_bd);
cur_btn->SetTextColor(calc_btn_text);
cur_btn->SetFocus(); cur_btn->SetFocus();
btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0); btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {
@@ -608,20 +520,10 @@ wxBoxSizer *ObjColorPanel::create_add_btn_sizer(wxWindow *parent)
wxBoxSizer *ObjColorPanel::create_reset_btn_sizer(wxWindow *parent) wxBoxSizer *ObjColorPanel::create_reset_btn_sizer(wxWindow *parent)
{ {
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor calc_btn_bg(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_bd(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor calc_btn_text(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal));
// create btn
m_quick_reset_btn = new Button(parent, _L("Reset")); m_quick_reset_btn = new Button(parent, _L("Reset"));
m_quick_reset_btn->SetToolTip(_L("Reset mapped extruders.")); m_quick_reset_btn->SetToolTip(_L("Reset mapped extruders."));
auto cur_btn = m_quick_reset_btn; auto cur_btn = m_quick_reset_btn;
cur_btn->SetFont(Label::Body_13); cur_btn->SetStyle(ButtonStyle::Regular, ButtonType::Window);
cur_btn->SetMinSize(wxSize(FromDIP(60), FromDIP(20)));
cur_btn->SetCornerRadius(FromDIP(10));
cur_btn->SetBackgroundColor(calc_btn_bg);
cur_btn->SetBorderColor(calc_btn_bd);
cur_btn->SetTextColor(calc_btn_text);
cur_btn->SetFocus(); cur_btn->SetFocus();
btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0); btn_sizer->Add(cur_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 0);
cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { cur_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) {
+5 -32
View File
@@ -129,42 +129,16 @@ wxBoxSizer *TipsDialog::create_item_checkbox(wxString title, wxWindow *parent, w
Button *TipsDialog::add_button(wxWindowID btn_id, const wxString &label, bool set_focus /*= false*/) Button *TipsDialog::add_button(wxWindowID btn_id, const wxString &label, bool set_focus /*= false*/)
{ {
Button* btn = new Button(this, label, "", 0, 0, btn_id); Button* btn = new Button(this, label, "", 0, 0, btn_id);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)); if (btn_id == wxID_OK || btn_id == wxID_YES)
btn->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
StateColor btn_text_green(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)); if (btn_id == wxID_CANCEL || btn_id == wxID_NO)
btn->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
StateColor btn_bg_white(
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
);
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal));
StateColor btn_text_white(std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal));
if (btn_id == wxID_OK || btn_id == wxID_YES) {
btn->SetBackgroundColor(btn_bg_green);
btn->SetBorderColor(btn_bd_green);
btn->SetTextColor(btn_text_green);
}
if (btn_id == wxID_CANCEL || btn_id == wxID_NO) {
btn->SetBackgroundColor(btn_bg_white);
btn->SetBorderColor(btn_bd_white);
btn->SetTextColor(btn_text_white);
}
if (set_focus) if (set_focus)
btn->SetFocus(); btn->SetFocus();
btn->SetSize(TIPS_DIALOG_BUTTON_SIZE);
btn->SetMinSize(TIPS_DIALOG_BUTTON_SIZE);
btn->SetCornerRadius(FromDIP(12));
btn->Bind(wxEVT_BUTTON, [this, btn_id](wxCommandEvent &) { btn->Bind(wxEVT_BUTTON, [this, btn_id](wxCommandEvent &) {
if (m_show_again) { if (m_show_again) {
if (!m_app_key.empty()) { if (!m_app_key.empty()) {
@@ -184,8 +158,7 @@ Button *TipsDialog::add_button(wxWindowID btn_id, const wxString &label, bool se
void TipsDialog::on_dpi_changed(const wxRect &suggested_rect) void TipsDialog::on_dpi_changed(const wxRect &suggested_rect)
{ {
if (m_confirm) m_confirm->SetMinSize(TIPS_DIALOG_BUTTON_SIZE); if (m_confirm) m_confirm->Rescale(); // ORCA
if (m_cancel) m_cancel->SetMinSize(TIPS_DIALOG_BUTTON_SIZE);
Fit(); Fit();
Refresh(); Refresh();
} }
-2
View File
@@ -34,8 +34,6 @@
class SwitchButton; class SwitchButton;
class StaticBox; class StaticBox;
#define TIPS_DIALOG_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {
+1 -1
View File
@@ -1594,7 +1594,7 @@ wxBoxSizer* PreferencesDialog::create_debug_page()
wxGetApp().request_user_logout(); wxGetApp().request_user_logout();
agent->set_country_code(country_code); agent->set_country_code(country_code);
} }
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Warning"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM); ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Warning"), ConfirmBeforeSendDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
confirm_dlg.update_text(_L("Cloud environment switched, please login again!")); confirm_dlg.update_text(_L("Cloud environment switched, please login again!"));
confirm_dlg.on_show(); confirm_dlg.on_show();
} }
+3 -19
View File
@@ -31,7 +31,7 @@ static std::string url_encode(const std::string& value) {
return escaped.str(); return escaped.str();
} }
PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style) PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum VisibleButtons btn_style, const wxPoint& pos, const wxSize& size, long style) // ORCA VisibleButtons instead ButtonStyle
:DPIDialog(parent, id, title, pos, size, style) :DPIDialog(parent, id, title, pos, size, style)
{ {
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
@@ -63,11 +63,6 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
m_sizer_right->Add(m_vebview_release_note, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(15)); m_sizer_right->Add(m_vebview_release_note, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(15));
auto sizer_button = new wxBoxSizer(wxHORIZONTAL); auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(220, 220, 220), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Normal));
#ifndef __WINDOWS__ #ifndef __WINDOWS__
m_vebview_release_note->Bind(wxEVT_WEBVIEW_LOADED, [this](auto& e) { m_vebview_release_note->Bind(wxEVT_WEBVIEW_LOADED, [this](auto& e) {
@@ -83,13 +78,7 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
//m_vebview_release_note->Bind(wxEVT_WEBVIEW_NAVIGATING , &PrivacyUpdateDialog::OnNavigating, this); //m_vebview_release_note->Bind(wxEVT_WEBVIEW_NAVIGATING , &PrivacyUpdateDialog::OnNavigating, this);
m_button_ok = new Button(this, _L("Accept")); m_button_ok = new Button(this, _L("Accept"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(-1, FromDIP(36)));
m_button_ok->SetMinSize(wxSize(-1, FromDIP(36)));
m_button_ok->SetCornerRadius(FromDIP(3));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_PRIVACY_UPDATE_CONFIRM, GetId()); wxCommandEvent evt(EVT_PRIVACY_UPDATE_CONFIRM, GetId());
@@ -99,12 +88,7 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
}); });
m_button_cancel = new Button(this, _L("Log Out")); m_button_cancel = new Button(this, _L("Log Out"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(*wxWHITE);
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(-1, FromDIP(36)));
m_button_cancel->SetMinSize(wxSize(-1, FromDIP(36)));
m_button_cancel->SetCornerRadius(FromDIP(3));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_PRIVACY_UPDATE_CANCEL); wxCommandEvent evt(EVT_PRIVACY_UPDATE_CANCEL);
+2 -2
View File
@@ -17,7 +17,7 @@ wxDECLARE_EVENT(EVT_PRIVACY_UPDATE_CANCEL, wxCommandEvent);
class PrivacyUpdateDialog : public DPIDialog class PrivacyUpdateDialog : public DPIDialog
{ {
public: public:
enum ButtonStyle { enum VisibleButtons { // ORCA VisibleButtons instead ButtonStyle
ONLY_CONFIRM = 0, ONLY_CONFIRM = 0,
CONFIRM_AND_CANCEL = 1, CONFIRM_AND_CANCEL = 1,
MAX_STYLE_NUM = 2 MAX_STYLE_NUM = 2
@@ -26,7 +26,7 @@ public:
wxWindow* parent, wxWindow* parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL, enum VisibleButtons btn_style = CONFIRM_AND_CANCEL, // ORCA VisibleButtons instead ButtonStyle
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxPD_APP_MODAL| wxCAPTION long style = wxPD_APP_MODAL| wxCAPTION
+8 -31
View File
@@ -4,6 +4,7 @@
#include <wx/dcgraph.h> #include <wx/dcgraph.h>
#include <wx/dcmemory.h> #include <wx/dcmemory.h>
#include <slic3r/GUI/Widgets/Label.hpp> #include <slic3r/GUI/Widgets/Label.hpp>
#include <slic3r/GUI/Widgets/DialogButtons.hpp>
#define BORDER FromDIP(25) #define BORDER FromDIP(25)
#define DRAW_PANEL_SIZE wxSize(FromDIP(475), FromDIP(100)) #define DRAW_PANEL_SIZE wxSize(FromDIP(475), FromDIP(100))
@@ -27,34 +28,13 @@ RecenterDialog::RecenterDialog(wxWindow* parent, wxWindowID id, const wxString&
wxPanel* m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL); wxPanel* m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
m_line_top->SetBackgroundColour(wxColour(166, 169, 170)); m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
m_button_confirm = new Button(this, _L("Go Home")); auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
m_button_confirm->SetFont(Label::Body_14); dlg_btns->GetOK()->SetLabel(_L("Go Home"));
m_button_confirm->SetMinSize(wxSize(-1, FromDIP(24))); dlg_btns->GetCANCEL()->SetLabel(_L("Close"));
m_button_confirm->SetCornerRadius(FromDIP(12));
StateColor confirm_btn_bg(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_confirm->SetBackgroundColor(confirm_btn_bg);
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(*wxWHITE);
m_button_close = new Button(this, _L("Close"));
m_button_close->SetFont(Label::Body_14);
m_button_close->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_close->SetCornerRadius(FromDIP(12));
StateColor close_btn_bg(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_close->SetBackgroundColor(close_btn_bg);
m_button_close->SetBorderColor(wxColour(38, 46, 48));
m_button_close->SetTextColor(wxColour(38, 46, 48));
button_sizer->AddStretchSpacer();
button_sizer->Add(m_button_confirm);
button_sizer->AddSpacer(FromDIP(20));
button_sizer->Add(m_button_close);
main_sizer->Add(m_line_top, 0, wxEXPAND, 0); main_sizer->Add(m_line_top, 0, wxEXPAND, 0);
main_sizer->AddSpacer(DRAW_PANEL_SIZE.y); main_sizer->AddSpacer(DRAW_PANEL_SIZE.y);
main_sizer->Add(button_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND, BORDER); main_sizer->Add(dlg_btns, 0, wxBOTTOM | wxRIGHT | wxEXPAND, FromDIP(ButtonProps::ChoiceButtonGap()));
SetSizer(main_sizer); SetSizer(main_sizer);
@@ -65,8 +45,8 @@ RecenterDialog::RecenterDialog(wxWindow* parent, wxWindowID id, const wxString&
Layout(); Layout();
Fit(); Fit();
this->Bind(wxEVT_PAINT, &RecenterDialog::OnPaint, this); this->Bind(wxEVT_PAINT, &RecenterDialog::OnPaint, this);
m_button_confirm->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_confirm, this); dlg_btns->GetOK()->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_confirm, this);
m_button_close->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_close, this); dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_close, this);
wxGetApp().UpdateDlgDarkUI(this); wxGetApp().UpdateDlgDarkUI(this);
} }
@@ -178,10 +158,7 @@ void RecenterDialog::on_button_close(wxCommandEvent& event) {
void RecenterDialog::on_dpi_changed(const wxRect& suggested_rect) { void RecenterDialog::on_dpi_changed(const wxRect& suggested_rect) {
init_bitmap(); init_bitmap();
m_button_confirm->SetMinSize(wxSize(-1, FromDIP(24))); // ORCA no need to reapply button sizes
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_close->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_close->SetCornerRadius(FromDIP(12));
Layout(); Layout();
} }
-2
View File
@@ -11,8 +11,6 @@ class RecenterDialog : public DPIDialog
{ {
private: private:
wxStaticText* m_staticText_hint; wxStaticText* m_staticText_hint;
Button* m_button_confirm;
Button* m_button_close;
wxStaticBitmap* m_bitmap_home; wxStaticBitmap* m_bitmap_home;
ScalableBitmap m_home_bmp; ScalableBitmap m_home_bmp;
wxString hint1; wxString hint1;
+39 -231
View File
@@ -147,32 +147,15 @@ UpdatePluginDialog::UpdatePluginDialog(wxWindow* parent /*= nullptr*/)
auto sizer_button = new wxBoxSizer(wxHORIZONTAL); auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
auto m_button_ok = new Button(this, _L("OK")); auto m_button_ok = new Button(this, _L("OK"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour(0xFFFFFE));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
EndModal(wxID_OK); EndModal(wxID_OK);
}); });
auto m_button_cancel = new Button(this, _L("Cancel")); auto m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
EndModal(wxID_NO); EndModal(wxID_NO);
@@ -319,33 +302,15 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
auto sizer_button = new wxBoxSizer(wxHORIZONTAL); auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_download = new Button(this, _L("Download")); m_button_download = new Button(this, _L("Download"));
m_button_download->SetBackgroundColor(btn_bg_green); m_button_download->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_download->SetBorderColor(*wxWHITE);
m_button_download->SetTextColor(wxColour("#FFFFFE"));
m_button_download->SetFont(Label::Body_12);
m_button_download->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_download->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_download->SetCornerRadius(FromDIP(12));
m_button_download->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_download->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxID_YES); EndModal(wxID_YES);
}); });
m_button_skip_version = new Button(this, _L("Skip this Version")); m_button_skip_version = new Button(this, _L("Skip this Version"));
m_button_skip_version->SetBackgroundColor(btn_bg_white); m_button_skip_version->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_skip_version->SetBorderColor(wxColour(38, 46, 48));
m_button_skip_version->SetFont(Label::Body_12);
m_button_skip_version->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_skip_version->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_skip_version->SetCornerRadius(FromDIP(12));
m_button_skip_version->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_skip_version->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
wxGetApp().set_skip_version(true); wxGetApp().set_skip_version(true);
@@ -365,12 +330,7 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
stable_only_label->SetFont(Label::Body_12); stable_only_label->SetFont(Label::Body_12);
m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxID_NO); EndModal(wxID_NO);
@@ -537,7 +497,7 @@ void UpdateVersionDialog::update_version_info(wxString release_note, wxString ve
Fit(); Fit();
} }
SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check) SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum VisibleButtons btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check) // ORCA VisibleButtons instead ButtonStyle
:DPIFrame(parent, id, title, pos, size, style) :DPIFrame(parent, id, title, pos, size, style)
{ {
m_button_style = btn_style; m_button_style = btn_style;
@@ -562,12 +522,6 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
auto bottom_sizer = new wxBoxSizer(wxVERTICAL); auto bottom_sizer = new wxBoxSizer(wxVERTICAL);
auto sizer_button = new wxBoxSizer(wxHORIZONTAL); auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
btn_bg_white = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
if (not_show_again_check) { if (not_show_again_check) {
auto checkbox_sizer = new wxBoxSizer(wxHORIZONTAL); auto checkbox_sizer = new wxBoxSizer(wxHORIZONTAL);
@@ -581,14 +535,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
bottom_sizer->Add(checkbox_sizer, 0, wxBOTTOM | wxEXPAND, 0); bottom_sizer->Add(checkbox_sizer, 0, wxBOTTOM | wxEXPAND, 0);
} }
m_button_ok = new Button(this, _L("Confirm")); m_button_ok = new Button(this, _L("Confirm"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_ok->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) { m_button_ok->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CONFIRM, GetId()); wxCommandEvent evt(EVT_SECONDARY_CHECK_CONFIRM, GetId());
@@ -598,14 +545,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
}); });
m_button_retry = new Button(this, _L("Retry")); m_button_retry = new Button(this, _L("Retry"));
m_button_retry->SetBackgroundColor(btn_bg_green); m_button_retry->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_retry->SetBorderColor(*wxWHITE);
m_button_retry->SetTextColor(wxColour("#FFFFFE"));
m_button_retry->SetFont(Label::Body_12);
m_button_retry->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_retry->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetCornerRadius(FromDIP(12));
m_button_retry->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) { m_button_retry->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_RETRY, GetId()); wxCommandEvent evt(EVT_SECONDARY_CHECK_RETRY, GetId());
@@ -615,13 +555,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
}); });
m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_cancel->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) { m_button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CANCEL); wxCommandEvent evt(EVT_SECONDARY_CHECK_CANCEL);
@@ -631,13 +565,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
}); });
m_button_fn = new Button(this, _L("Done")); m_button_fn = new Button(this, _L("Done"));
m_button_fn->SetBackgroundColor(btn_bg_white); m_button_fn->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_fn->SetBorderColor(wxColour(38, 46, 48));
m_button_fn->SetFont(Label::Body_12);
m_button_fn->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_fn->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_fn->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_fn->SetCornerRadius(FromDIP(12));
m_button_fn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) { m_button_fn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
post_event(wxCommandEvent(EVT_SECONDARY_CHECK_DONE)); post_event(wxCommandEvent(EVT_SECONDARY_CHECK_DONE));
@@ -645,13 +573,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
}); });
m_button_resume = new Button(this, _L("Resume")); m_button_resume = new Button(this, _L("Resume"));
m_button_resume->SetBackgroundColor(btn_bg_white); m_button_resume->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_resume->SetBorderColor(wxColour(38, 46, 48));
m_button_resume->SetFont(Label::Body_12);
m_button_resume->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_resume->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_resume->SetMaxSize(wxSize(-1, FromDIP(24)));
m_button_resume->SetCornerRadius(FromDIP(12));
m_button_resume->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) { m_button_resume->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent& e) {
post_event(wxCommandEvent(EVT_SECONDARY_CHECK_RESUME)); post_event(wxCommandEvent(EVT_SECONDARY_CHECK_RESUME));
@@ -782,7 +704,7 @@ void SecondaryCheckDialog::on_hide()
} }
} }
void SecondaryCheckDialog::update_title_style(wxString title, SecondaryCheckDialog::ButtonStyle style, wxWindow* parent) void SecondaryCheckDialog::update_title_style(wxString title, SecondaryCheckDialog::VisibleButtons style, wxWindow* parent) // ORCA VisibleButtons instead ButtonStyle
{ {
if (m_button_style == style && title == GetTitle()) return; if (m_button_style == style && title == GetTitle()) return;
@@ -866,9 +788,6 @@ PrintErrorDialog::PrintErrorDialog(wxWindow* parent, wxWindowID id, const wxStri
{ {
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
btn_bg_white = StateColor(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_sizer_main = new wxBoxSizer(wxVERTICAL); m_sizer_main = new wxBoxSizer(wxVERTICAL);
auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(350), 1)); auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(350), 1));
m_line_top->SetBackgroundColour(wxColour(166, 169, 170)); m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
@@ -1102,13 +1021,10 @@ void PrintErrorDialog::update_title_style(wxString title, std::vector<int> butto
void PrintErrorDialog::init_button(PrintErrorButton style,wxString buton_text) void PrintErrorDialog::init_button(PrintErrorButton style,wxString buton_text)
{ {
Button* print_error_button = new Button(this, buton_text); Button* print_error_button = new Button(this, buton_text);
print_error_button->SetBackgroundColor(btn_bg_white); print_error_button->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
print_error_button->SetBorderColor(wxColour(38, 46, 48));
print_error_button->SetFont(Label::Body_14);
print_error_button->SetSize(wxSize(FromDIP(300), FromDIP(30))); print_error_button->SetSize(wxSize(FromDIP(300), FromDIP(30)));
print_error_button->SetMinSize(wxSize(FromDIP(300), FromDIP(30))); print_error_button->SetMinSize(wxSize(FromDIP(300), FromDIP(30)));
print_error_button->SetMaxSize(wxSize(-1, FromDIP(30))); print_error_button->SetMaxSize(wxSize(-1, FromDIP(30)));
print_error_button->SetCornerRadius(FromDIP(5));
print_error_button->Hide(); print_error_button->Hide();
m_button_list[style] = print_error_button; m_button_list[style] = print_error_button;
m_button_list[style]->Bind(wxEVT_LEFT_DOWN, [this, style](wxMouseEvent& e) m_button_list[style]->Bind(wxEVT_LEFT_DOWN, [this, style](wxMouseEvent& e)
@@ -1167,7 +1083,7 @@ void PrintErrorDialog::rescale()
} }
} }
ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check) ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum VisibleButtons btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check)
:DPIDialog(parent, id, title, pos, size, style) :DPIDialog(parent, id, title, pos, size, style)
{ {
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
@@ -1190,12 +1106,6 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
auto bottom_sizer = new wxBoxSizer(wxVERTICAL); auto bottom_sizer = new wxBoxSizer(wxVERTICAL);
auto sizer_button = new wxBoxSizer(wxHORIZONTAL); auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
if (not_show_again_check) { if (not_show_again_check) {
auto checkbox_sizer = new wxBoxSizer(wxHORIZONTAL); auto checkbox_sizer = new wxBoxSizer(wxHORIZONTAL);
@@ -1209,13 +1119,7 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
bottom_sizer->Add(checkbox_sizer, 0, wxBOTTOM | wxEXPAND, 0); bottom_sizer->Add(checkbox_sizer, 0, wxBOTTOM | wxEXPAND, 0);
} }
m_button_ok = new Button(this, _L("Confirm")); m_button_ok = new Button(this, _L("Confirm"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(-1, FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CONFIRM, GetId()); wxCommandEvent evt(EVT_SECONDARY_CHECK_CONFIRM, GetId());
@@ -1225,12 +1129,7 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
}); });
m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(-1, FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_CANCEL); wxCommandEvent evt(EVT_SECONDARY_CHECK_CANCEL);
@@ -1245,12 +1144,7 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
m_button_cancel->Show(); m_button_cancel->Show();
m_button_update_nozzle = new Button(this, _L("Confirm and Update Nozzle")); m_button_update_nozzle = new Button(this, _L("Confirm and Update Nozzle"));
m_button_update_nozzle->SetBackgroundColor(btn_bg_white); m_button_update_nozzle->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_update_nozzle->SetBorderColor(wxColour(38, 46, 48));
m_button_update_nozzle->SetFont(Label::Body_12);
m_button_update_nozzle->SetSize(wxSize(-1, FromDIP(24)));
m_button_update_nozzle->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_update_nozzle->SetCornerRadius(FromDIP(12));
m_button_update_nozzle->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { m_button_update_nozzle->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_UPDATE_NOZZLE); wxCommandEvent evt(EVT_UPDATE_NOZZLE);
@@ -1445,18 +1339,12 @@ void ConfirmBeforeSendDialog::edit_cancel_button_txt(const wxString& txt, bool s
void ConfirmBeforeSendDialog::disable_button_ok() void ConfirmBeforeSendDialog::disable_button_ok()
{ {
m_button_ok->Disable(); m_button_ok->Disable(); // ORCA enabling / disabling buttons with conditions enough to change its style
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
} }
void ConfirmBeforeSendDialog::enable_button_ok() void ConfirmBeforeSendDialog::enable_button_ok()
{ {
m_button_ok->Enable(); m_button_ok->Enable(); // ORCA enabling / disabling buttons with conditions enough to change its style
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(btn_bg_green);
} }
void ConfirmBeforeSendDialog::rescale() void ConfirmBeforeSendDialog::rescale()
@@ -1628,41 +1516,22 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow *parent)
auto m_sizer_button = new wxBoxSizer(wxHORIZONTAL); auto m_sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_ok = new Button(this, _L("Connect")); m_button_ok = new Button(this, _L("Connect"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour(0xFFFFFE));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_ok->Bind(wxEVT_LEFT_DOWN, &InputIpAddressDialog::on_ok, this);
m_button_ok->Enable(false); m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90)); m_button_ok->Bind(wxEVT_LEFT_DOWN, &InputIpAddressDialog::on_ok, this);
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_manual_setup = new Button(this, _L("Manual Setup")); m_button_manual_setup = new Button(this, _L("Manual Setup"));
m_button_manual_setup->SetBackgroundColor(btn_bg_green); m_button_manual_setup->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_manual_setup->SetBorderColor(*wxWHITE); m_button_manual_setup->Enable(false);
m_button_manual_setup->SetTextColor(wxColour(0xFFFFFE));
m_button_manual_setup->SetFont(Label::Body_12);
m_button_manual_setup->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_manual_setup->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_manual_setup->SetCornerRadius(FromDIP(12));
m_button_manual_setup->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent&) { m_button_manual_setup->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent&) {
wxCommandEvent event(EVT_CHECK_IP_ADDRESS_LAYOUT); wxCommandEvent event(EVT_CHECK_IP_ADDRESS_LAYOUT);
event.SetEventObject(this); event.SetEventObject(this);
event.SetInt(1); event.SetInt(1);
wxPostEvent(this, event); wxPostEvent(this, event);
}); });
m_button_manual_setup->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_manual_setup->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_manual_setup->Hide(); m_button_manual_setup->Hide();
m_sizer_button->AddStretchSpacer(); m_sizer_button->AddStretchSpacer();
@@ -1803,9 +1672,8 @@ void InputIpAddressDialog::switch_input_panel(int index)
m_step_icon_panel3->Show(); m_step_icon_panel3->Show();
m_tip3->Show(); m_tip3->Show();
// ORCA enabling / disabling buttons with conditions enough to change its style
m_button_ok->Enable(false); m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
} }
current_input_index = index; current_input_index = index;
} }
@@ -1842,18 +1710,8 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
auto str_ip = m_input_ip->GetTextCtrl()->GetValue(); auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue(); auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8) { // ORCA enabling / disabling buttons with conditions enough to change its style
m_button_ok->Enable(true); m_button_ok->Enable(isIp(str_ip.ToStdString()) && str_access_code.Length() == 8);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
}
else {
m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
}
Layout(); Layout();
Fit(); Fit();
@@ -1929,12 +1787,9 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
str_model_id = it->second; str_model_id = it->second;
} }
// ORCA enabling / disabling buttons with conditions enough to change its style
m_button_manual_setup->Enable(false); m_button_manual_setup->Enable(false);
m_button_manual_setup->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_manual_setup->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->Enable(false); m_button_ok->Enable(false);
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
Refresh(); Refresh();
Layout(); Layout();
@@ -1971,9 +1826,7 @@ void InputIpAddressDialog::on_send_retry()
return; return;
} }
m_button_ok->Enable(false); m_button_ok->Enable(false); // ORCA enabling / disabling buttons with conditions enough to change its style
m_button_ok->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ok->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_worker->wait_for_idle(); m_worker->wait_for_idle();
@@ -2170,10 +2023,7 @@ void InputIpAddressDialog::on_check_ip_address_failed(wxCommandEvent& evt)
} }
m_button_ok->Enable(true); m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), // ORCA enabling / disabling buttons with conditions enough to change its style
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
} }
void InputIpAddressDialog::on_text(wxCommandEvent &evt) void InputIpAddressDialog::on_text(wxCommandEvent &evt)
@@ -2191,34 +2041,14 @@ void InputIpAddressDialog::on_text(wxCommandEvent &evt)
} }
} }
const auto enable_btn = [](Button* btn, bool enabled) { // ORCA enabling / disabling buttons with conditions enough to change its style
btn->Enable(enabled); bool enable_btns = isIp(str_ip.ToStdString()) && str_access_code.Length() == 8 && invalid_access_code;
if (enabled) { m_button_manual_setup->Enable(enable_btns);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), m_button_ok->Enable(enable_btns);
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
btn->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
btn->SetBackgroundColor(btn_bg_green);
} else {
btn->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
btn->SetBorderColor(wxColour(0x90, 0x90, 0x90));
}
};
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8 && invalid_access_code) { if (current_input_index == 1)
enable_btn(m_button_manual_setup, true); m_button_ok->Enable(!str_name.IsEmpty() && str_sn.length() == 15);
enable_btn(m_button_ok, true);
} else {
enable_btn(m_button_manual_setup, false);
enable_btn(m_button_ok, false);
}
if (current_input_index == 1){
if (!str_name.IsEmpty() && str_sn.length() == 15) {
enable_btn(m_button_ok, true);
} else {
enable_btn(m_button_ok, false);
}
}
} }
InputIpAddressDialog::~InputIpAddressDialog() InputIpAddressDialog::~InputIpAddressDialog()
@@ -2242,9 +2072,6 @@ void InputIpAddressDialog::on_dpi_changed(const wxRect& suggested_rect)
SetMinSize(wxSize(FromDIP(560), -1)); SetMinSize(wxSize(FromDIP(560), -1));
SetMaxSize(wxSize(FromDIP(560), -1)); SetMaxSize(wxSize(FromDIP(560), -1));
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
auto m_sizer_main = new wxBoxSizer(wxVERTICAL); auto m_sizer_main = new wxBoxSizer(wxVERTICAL);
auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(400), 1)); auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(400), 1));
@@ -2258,34 +2085,15 @@ void InputIpAddressDialog::on_dpi_changed(const wxRect& suggested_rect)
wxBoxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
auto m_button_retry = new Button(this, _L("Retry")); auto m_button_retry = new Button(this, _L("Retry"));
m_button_retry->SetBackgroundColor(btn_bg_green); m_button_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_retry->SetBorderColor(*wxWHITE);
m_button_retry->SetTextColor(wxColour("#FFFFFE"));
m_button_retry->SetFont(Label::Body_12);
m_button_retry->SetSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_retry->SetCornerRadius(FromDIP(12));
m_button_retry->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_retry->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxYES); EndModal(wxYES);
}); });
auto m_button_input = new Button(this, _L("reconnect")); auto m_button_input = new Button(this, _L("reconnect"));
m_button_input->SetBackgroundColor(btn_bg_white); m_button_input->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_input->SetBorderColor(wxColour(38, 46, 48));
m_button_input->SetFont(Label::Body_12);
m_button_input->SetSize(wxSize(-1, FromDIP(24)));
m_button_input->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_input->SetCornerRadius(FromDIP(12));
m_button_input->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_input->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxAPPLY); EndModal(wxAPPLY);
}); });
+6 -7
View File
@@ -114,7 +114,7 @@ class SecondaryCheckDialog : public DPIFrame
private: private:
wxWindow* event_parent { nullptr }; wxWindow* event_parent { nullptr };
public: public:
enum ButtonStyle { enum VisibleButtons { // ORCA VisibleButtons instead ButtonStyle
ONLY_CONFIRM = 0, ONLY_CONFIRM = 0,
CONFIRM_AND_CANCEL = 1, CONFIRM_AND_CANCEL = 1,
CONFIRM_AND_DONE = 2, CONFIRM_AND_DONE = 2,
@@ -127,7 +127,7 @@ public:
wxWindow* parent, wxWindow* parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL, enum VisibleButtons btn_style = CONFIRM_AND_CANCEL, // ORCA VisibleButtons instead ButtonStyle
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxCLOSE_BOX | wxCAPTION, long style = wxCLOSE_BOX | wxCAPTION,
@@ -137,7 +137,7 @@ public:
void on_show(); void on_show();
void on_hide(); void on_hide();
void update_btn_label(wxString ok_btn_text, wxString cancel_btn_text); void update_btn_label(wxString ok_btn_text, wxString cancel_btn_text);
void update_title_style(wxString title, SecondaryCheckDialog::ButtonStyle style, wxWindow* parent = nullptr); void update_title_style(wxString title, SecondaryCheckDialog::VisibleButtons style, wxWindow* parent = nullptr); // ORCA VisibleButtons instead ButtonStyle
void post_event(wxCommandEvent&& event); void post_event(wxCommandEvent&& event);
void rescale(); void rescale();
~SecondaryCheckDialog(); ~SecondaryCheckDialog();
@@ -156,7 +156,7 @@ public:
Button* m_button_fn { nullptr }; Button* m_button_fn { nullptr };
Button* m_button_resume { nullptr }; Button* m_button_resume { nullptr };
wxCheckBox* m_show_again_checkbox; wxCheckBox* m_show_again_checkbox;
ButtonStyle m_button_style; VisibleButtons m_button_style; // ORCA VisibleButtons instead ButtonStyle
bool not_show_again = false; bool not_show_again = false;
std::string show_again_config_text = ""; std::string show_again_config_text = "";
}; };
@@ -215,7 +215,6 @@ public:
void init_button_list(); void init_button_list();
void on_webrequest_state(wxWebRequestEvent& evt); void on_webrequest_state(wxWebRequestEvent& evt);
StateColor btn_bg_white;
wxWebRequest web_request; wxWebRequest web_request;
wxStaticBitmap* m_error_prompt_pic_static; wxStaticBitmap* m_error_prompt_pic_static;
Label* m_staticText_release_note{ nullptr }; Label* m_staticText_release_note{ nullptr };
@@ -243,7 +242,7 @@ public:
class ConfirmBeforeSendDialog : public DPIDialog class ConfirmBeforeSendDialog : public DPIDialog
{ {
public: public:
enum ButtonStyle { enum VisibleButtons { // ORCA VisibleButtons instead ButtonStyle
ONLY_CONFIRM = 0, ONLY_CONFIRM = 0,
CONFIRM_AND_CANCEL = 1, CONFIRM_AND_CANCEL = 1,
MAX_STYLE_NUM = 2 MAX_STYLE_NUM = 2
@@ -252,7 +251,7 @@ public:
wxWindow* parent, wxWindow* parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL, enum VisibleButtons btn_style = CONFIRM_AND_CANCEL, // ORCA VisibleButtons instead ButtonStyle
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxCLOSE_BOX | wxCAPTION, long style = wxCLOSE_BOX | wxCAPTION,
+4 -14
View File
@@ -575,15 +575,8 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
wxBoxSizer *m_sizer_prepare = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *m_sizer_prepare = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *m_sizer_pcont = new wxBoxSizer(wxVERTICAL); wxBoxSizer *m_sizer_pcont = new wxBoxSizer(wxVERTICAL);
m_btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_ensure = new Button(m_panel_prepare, _L("Send")); m_button_ensure = new Button(m_panel_prepare, _L("Send"));
m_button_ensure->SetBackgroundColor(m_btn_bg_enable); m_button_ensure->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ensure->SetBorderColor(m_btn_bg_enable);
m_button_ensure->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE2);
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE2);
m_button_ensure->SetCornerRadius(FromDIP(4));
m_button_ensure->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_ok_btn, this); m_button_ensure->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_ok_btn, this);
m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0); m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0);
@@ -3661,14 +3654,12 @@ void SelectMachineDialog::Enable_Send_Button(bool en)
if (!en) { if (!en) {
if (m_button_ensure->IsEnabled()) { if (m_button_ensure->IsEnabled()) {
m_button_ensure->Disable(); m_button_ensure->Disable();
m_button_ensure->SetBackgroundColor(wxColour(200, 200, 200)); // ORCA no need to set colors again
m_button_ensure->SetBorderColor(wxColour(200, 200, 200));
} }
} else { } else {
if (!m_button_ensure->IsEnabled()) { if (!m_button_ensure->IsEnabled()) {
m_button_ensure->Enable(); m_button_ensure->Enable();
m_button_ensure->SetBackgroundColor(m_btn_bg_enable); // ORCA no need to set colors again
m_button_ensure->SetBorderColor(m_btn_bg_enable);
} }
} }
} }
@@ -3685,8 +3676,7 @@ void SelectMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
ams_mapping_help_icon->msw_rescale(); ams_mapping_help_icon->msw_rescale();
if (img_amsmapping_tip)img_amsmapping_tip->SetBitmap(ams_mapping_help_icon->bmp()); if (img_amsmapping_tip)img_amsmapping_tip->SetBitmap(ams_mapping_help_icon->bmp());
} }
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE2); m_button_ensure->Rescale(); // ORCA
m_button_ensure->SetCornerRadius(FromDIP(4));
m_status_bar->msw_rescale(); m_status_bar->msw_rescale();
for (auto material1 : m_materialList) { for (auto material1 : m_materialList) {
+4 -30
View File
@@ -341,12 +341,8 @@ void SendMultiMachinePage::on_dpi_changed(const wxRect& suggested_rect)
print_weight->msw_rescale(); print_weight->msw_rescale();
timeimg->SetBitmap(print_time->bmp()); timeimg->SetBitmap(print_time->bmp());
weightimg->SetBitmap(print_weight->bmp()); weightimg->SetBitmap(print_weight->bmp());
m_button_add->Rescale(); m_button_add->Rescale(); // ORCA no need to re set size
m_button_add->SetMinSize(wxSize(FromDIP(90), FromDIP(36))); m_button_send->Rescale(); // ORCA no need to re set size
m_button_add->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_send->Rescale();
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
for (auto it = m_device_items.begin(); it != m_device_items.end(); ++it) { for (auto it = m_device_items.begin(); it != m_device_items.end(); ++it) {
it->second->Refresh(); it->second->Refresh();
@@ -1349,21 +1345,8 @@ wxPanel* SendMultiMachinePage::create_page()
m_tip_text->SetFont(::Label::Head_20); m_tip_text->SetFont(::Label::Head_20);
m_tip_text->Wrap(-1); m_tip_text->Wrap(-1);
auto m_btn_bg_enable = StateColor(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
m_button_add = new Button(main_page, _L("Add")); m_button_add = new Button(main_page, _L("Add"));
m_button_add->SetBackgroundColor(m_btn_bg_enable); m_button_add->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_add->SetBorderColor(m_btn_bg_enable);
m_button_add->SetTextColor(*wxWHITE);
m_button_add->SetFont(Label::Body_12);
m_button_add->SetCornerRadius(6);
m_button_add->SetMinSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->SetMaxSize(wxSize(FromDIP(90), FromDIP(36)));
m_button_add->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) { m_button_add->Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) {
MultiMachinePickPage dlg; MultiMachinePickPage dlg;
dlg.ShowModal(); dlg.ShowModal();
@@ -1412,17 +1395,8 @@ wxPanel* SendMultiMachinePage::create_page()
sizer->AddSpacer(FromDIP(10)); sizer->AddSpacer(FromDIP(10));
// add send button // add send button
btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_send = new Button(main_page, _L("Send")); m_button_send = new Button(main_page, _L("Send"));
m_button_send->SetBackgroundColor(btn_bg_enable); m_button_send->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_send->SetBorderColor(btn_bg_enable);
m_button_send->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_send->SetSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetMinSize(wxSize(FromDIP(120), FromDIP(40)));
m_button_send->SetCornerRadius(FromDIP(5));
m_button_send->Bind(wxEVT_BUTTON, &SendMultiMachinePage::on_send, this); m_button_send->Bind(wxEVT_BUTTON, &SendMultiMachinePage::on_send, this);
//m_button_send->Disable(); //m_button_send->Disable();
//m_button_send->SetBackgroundColor(wxColour(0x90, 0x90, 0x90)); //m_button_send->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
+6 -28
View File
@@ -285,16 +285,9 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SendToPrinterDialog::on_selection_changed, this); m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SendToPrinterDialog::on_selection_changed, this);
m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5)); m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5));
btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_refresh = new Button(this, _L("Refresh")); m_button_refresh = new Button(this, _L("Refresh"));
m_button_refresh->SetBackgroundColor(btn_bg_enable); m_button_refresh->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_refresh->SetBorderColor(btn_bg_enable);
m_button_refresh->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_refresh->SetSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetCornerRadius(FromDIP(10));
m_button_refresh->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_refresh, this); m_button_refresh->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_refresh, this);
m_sizer_printer->Add(m_button_refresh, 0, wxALL | wxLEFT, FromDIP(5)); m_sizer_printer->Add(m_button_refresh, 0, wxALL | wxLEFT, FromDIP(5));
@@ -347,12 +340,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
m_sizer_prepare->Add(0, 0, 1, wxTOP, FromDIP(22)); m_sizer_prepare->Add(0, 0, 1, wxTOP, FromDIP(22));
m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0); m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0);
m_button_ensure = new Button(m_panel_prepare, _L("Send")); m_button_ensure = new Button(m_panel_prepare, _L("Send"));
m_button_ensure->SetBackgroundColor(btn_bg_enable); m_button_ensure->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ensure->SetBorderColor(btn_bg_enable);
m_button_ensure->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ensure->SetSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetCornerRadius(6);
m_button_ensure->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_ok, this); m_button_ensure->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_ok, this);
m_sizer_pcont->Add(m_button_ensure, 0, wxEXPAND | wxBOTTOM, FromDIP(10)); m_sizer_pcont->Add(m_button_ensure, 0, wxEXPAND | wxBOTTOM, FromDIP(10));
@@ -1363,15 +1351,11 @@ void SendToPrinterDialog::Enable_Refresh_Button(bool en)
{ {
if (!en) { if (!en) {
if (m_button_refresh->IsEnabled()) { if (m_button_refresh->IsEnabled()) {
m_button_refresh->Disable(); m_button_refresh->Disable(); // ORCA no need to set colors again
m_button_refresh->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_refresh->SetBorderColor(wxColour(0x90, 0x90, 0x90));
} }
} else { } else {
if (!m_button_refresh->IsEnabled()) { if (!m_button_refresh->IsEnabled()) {
m_button_refresh->Enable(); m_button_refresh->Enable(); // ORCA no need to set colors again
m_button_refresh->SetBackgroundColor(btn_bg_enable);
m_button_refresh->SetBorderColor(btn_bg_enable);
} }
} }
} }
@@ -1523,15 +1507,11 @@ void SendToPrinterDialog::Enable_Send_Button(bool en)
if (!en) { if (!en) {
if (m_button_ensure->IsEnabled()) { if (m_button_ensure->IsEnabled()) {
m_button_ensure->Disable(); m_button_ensure->Disable();
m_button_ensure->SetBackgroundColor(wxColour(0x90, 0x90, 0x90));
m_button_ensure->SetBorderColor(wxColour(0x90, 0x90, 0x90));
m_storage_panel->Hide(); m_storage_panel->Hide();
} }
} else { } else {
if (!m_button_ensure->IsEnabled()) { if (!m_button_ensure->IsEnabled()) {
m_button_ensure->Enable(); m_button_ensure->Enable();
m_button_ensure->SetBackgroundColor(btn_bg_enable);
m_button_ensure->SetBorderColor(btn_bg_enable);
m_storage_panel->Show(); m_storage_panel->Show();
} }
} }
@@ -1539,10 +1519,8 @@ void SendToPrinterDialog::Enable_Send_Button(bool en)
void SendToPrinterDialog::on_dpi_changed(const wxRect &suggested_rect) void SendToPrinterDialog::on_dpi_changed(const wxRect &suggested_rect)
{ {
m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE); m_button_refresh->Rescale(); // ORCA
m_button_refresh->SetCornerRadius(FromDIP(12)); m_button_ensure->Rescale(); // ORCA
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetCornerRadius(FromDIP(12));
m_status_bar->msw_rescale(); m_status_bar->msw_rescale();
Fit(); Fit();
Refresh(); Refresh();
+20 -106
View File
@@ -356,28 +356,13 @@ ExtruderSwithingStatus::ExtruderSwithingStatus(wxWindow *parent)
{ m_switching_status_label->SetBackgroundColour(parent->GetBackgroundColour()); { m_switching_status_label->SetBackgroundColour(parent->GetBackgroundColour());
} }
StateColor e_ctrl_bg(std::pair<wxColour, int>(BUTTON_PRESS_COL, StateColor::Pressed), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
StateColor e_ctrl_bd(std::pair<wxColour, int>(BUTTON_HOVER_COL, StateColor::Hovered), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
m_button_quit = new Button(this, _CTX(L_CONTEXT("Quit", "Quit_Switching"), "Quit_Switching"), "", 0, FromDIP(22)); m_button_quit = new Button(this, _CTX(L_CONTEXT("Quit", "Quit_Switching"), "Quit_Switching"), "", 0, FromDIP(22));
m_button_quit->SetFont(::Label::Body_13); m_button_quit->SetStyle(ButtonStyle::Regular, ButtonType::Window);
m_button_quit->Bind(wxEVT_BUTTON, &ExtruderSwithingStatus::on_quit, this); m_button_quit->Bind(wxEVT_BUTTON, &ExtruderSwithingStatus::on_quit, this);
m_button_quit->SetMinSize(SWITCHING_STATUS_BTN_SIZE);
m_button_quit->SetMaxSize(SWITCHING_STATUS_BTN_SIZE);
m_button_quit->SetBackgroundColor(e_ctrl_bg);
m_button_quit->SetBorderColor(e_ctrl_bd);
m_button_quit->SetBorderWidth(2);
if (parent) { m_button_quit->SetBackgroundColour(parent->GetBackgroundColour()); }
m_button_retry = new Button(this, _L("Retry"), "", 0, FromDIP(22)); m_button_retry = new Button(this, _L("Retry"), "", 0, FromDIP(22));
m_button_retry->SetFont(::Label::Body_13); m_button_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_retry->Bind(wxEVT_BUTTON, &ExtruderSwithingStatus::on_retry, this); m_button_retry->Bind(wxEVT_BUTTON, &ExtruderSwithingStatus::on_retry, this);
m_button_retry->SetMinSize(SWITCHING_STATUS_BTN_SIZE);
m_button_retry->SetMaxSize(SWITCHING_STATUS_BTN_SIZE);
m_button_retry->SetBackgroundColor(e_ctrl_bg);
m_button_retry->SetBorderColor(e_ctrl_bd);
m_button_retry->SetBorderWidth(2);
if (parent) { m_button_retry->SetBackgroundColour(parent->GetBackgroundColour()); }
wxBoxSizer *btn_sizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *btn_sizer = new wxBoxSizer(wxHORIZONTAL);
btn_sizer->Add(m_button_quit, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(10)); btn_sizer->Add(m_button_quit, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(10));
@@ -476,10 +461,8 @@ bool ExtruderSwithingStatus::has_content_shown() const
void ExtruderSwithingStatus::msw_rescale() void ExtruderSwithingStatus::msw_rescale()
{ {
m_button_quit->SetMinSize(SWITCHING_STATUS_BTN_SIZE); m_button_quit->Rescale(); // ORCA
m_button_quit->SetMaxSize(SWITCHING_STATUS_BTN_SIZE); m_button_retry->Rescale(); // ORCA
m_button_retry->SetMinSize(SWITCHING_STATUS_BTN_SIZE);
m_button_retry->SetMaxSize(SWITCHING_STATUS_BTN_SIZE);
Layout(); Layout();
} }
@@ -870,18 +853,7 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
static_text_sizer->Add(m_error_text, 1, wxEXPAND | wxLEFT, FromDIP(17)); static_text_sizer->Add(m_error_text, 1, wxEXPAND | wxLEFT, FromDIP(17));
m_button_clean = new Button(m_panel_error_txt, _L("Clear")); m_button_clean = new Button(m_panel_error_txt, _L("Clear"));
StateColor clean_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), m_button_clean->SetStyle(ButtonStyle::Regular, ButtonType::Window);
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
StateColor clean_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor clean_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_clean->SetBackgroundColor(clean_bg);
m_button_clean->SetBorderColor(clean_bd);
m_button_clean->SetTextColor(clean_text);
m_button_clean->SetFont(Label::Body_10);
m_button_clean->SetMinSize(TASK_BUTTON_SIZE2);
static_text_sizer->Add( FromDIP(10), 0, 0, 0, 0 ); static_text_sizer->Add( FromDIP(10), 0, 0, 0, 0 );
static_text_sizer->Add(m_button_clean, 0, wxALIGN_CENTRE_VERTICAL|wxRIGHT, FromDIP(5)); static_text_sizer->Add(m_button_clean, 0, wxALIGN_CENTRE_VERTICAL|wxRIGHT, FromDIP(5));
@@ -911,16 +883,10 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
m_request_failed_info->SetForegroundColour(*wxRED); m_request_failed_info->SetForegroundColour(*wxRED);
m_request_failed_info->SetFont(::Label::Body_10); m_request_failed_info->SetFont(::Label::Body_10);
static_request_failed_panel_sizer->Add(m_request_failed_info, 0, wxEXPAND | wxALL, FromDIP(10)); static_request_failed_panel_sizer->Add(m_request_failed_info, 0, wxEXPAND | wxALL, FromDIP(10));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_button_market_retry = new Button(m_request_failed_panel, _L("Retry")); m_button_market_retry = new Button(m_request_failed_panel, _L("Retry"));
m_button_market_retry->SetBackgroundColor(btn_bg_green); m_button_market_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_market_retry->SetBorderColor(btn_bd_green);
m_button_market_retry->SetTextColor(wxColour("#FFFFFE"));
m_button_market_retry->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_button_market_retry->SetMinSize(wxSize(-1, FromDIP(26)));
m_button_market_retry->SetCornerRadius(FromDIP(13));
static_request_failed_panel_sizer->Add(0, 0, 1, wxEXPAND, 0); static_request_failed_panel_sizer->Add(0, 0, 1, wxEXPAND, 0);
static_request_failed_panel_sizer->Add(m_button_market_retry, 0, wxEXPAND | wxALL, FromDIP(10)); static_request_failed_panel_sizer->Add(m_button_market_retry, 0, wxEXPAND | wxALL, FromDIP(10));
m_request_failed_panel->SetSizer(static_request_failed_panel_sizer); m_request_failed_panel->SetSizer(static_request_failed_panel_sizer);
@@ -969,12 +935,7 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
} }
m_button_market_scoring = new Button(m_score_subtask_info, _L("Rate")); m_button_market_scoring = new Button(m_score_subtask_info, _L("Rate"));
m_button_market_scoring->SetBackgroundColor(btn_bg_green); m_button_market_scoring->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_button_market_scoring->SetBorderColor(btn_bd_green);
m_button_market_scoring->SetTextColor(wxColour("#FFFFFE"));
m_button_market_scoring->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_button_market_scoring->SetMinSize(wxSize(-1, FromDIP(26)));
m_button_market_scoring->SetCornerRadius(FromDIP(13));
m_button_market_scoring->Enable(false); m_button_market_scoring->Enable(false);
static_score_star_sizer->Add(0, 0, 1, wxEXPAND, 0); static_score_star_sizer->Add(0, 0, 1, wxEXPAND, 0);
@@ -1619,37 +1580,17 @@ wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent)
//m_staticText_control->SetFont(PAGE_TITLE_FONT); //m_staticText_control->SetFont(PAGE_TITLE_FONT);
m_staticText_control->SetForegroundColour(PAGE_TITLE_FONT_COL); m_staticText_control->SetForegroundColour(PAGE_TITLE_FONT_COL);
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_parts_btn = new Button(m_panel_control_title, _L("Printer Parts")); m_parts_btn = new Button(m_panel_control_title, _L("Printer Parts"));
m_parts_btn->SetBackgroundColor(btn_bg_green); m_parts_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_parts_btn->SetBorderColor(btn_bd_green);
m_parts_btn->SetTextColor(wxColour("#FFFFFE"));
m_parts_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_parts_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_options_btn = new Button(m_panel_control_title, _L("Print Options")); m_options_btn = new Button(m_panel_control_title, _L("Print Options"));
m_options_btn->SetBackgroundColor(btn_bg_green); m_options_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_options_btn->SetBorderColor(btn_bd_green);
m_options_btn->SetTextColor(wxColour("#FFFFFE"));
m_options_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_options_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_safety_btn = new Button(m_panel_control_title, _L("Safety Options")); m_safety_btn = new Button(m_panel_control_title, _L("Safety Options"));
m_safety_btn->SetBackgroundColor(btn_bg_green); m_safety_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_safety_btn->SetBorderColor(btn_bd_green);
m_safety_btn->SetTextColor(wxColour("#FFFFFE"));
m_safety_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_safety_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_calibration_btn = new Button(m_panel_control_title, _L("Calibration")); m_calibration_btn = new Button(m_panel_control_title, _L("Calibration"));
m_calibration_btn->SetBackgroundColor(btn_bg_green); m_calibration_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
m_calibration_btn->SetBorderColor(btn_bd_green);
m_calibration_btn->SetTextColor(wxColour("#FFFFFE"));
m_calibration_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
m_calibration_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_calibration_btn->EnableTooltipEvenDisabled(); m_calibration_btn->EnableTooltipEvenDisabled();
m_options_btn->Hide(); m_options_btn->Hide();
@@ -2171,18 +2112,8 @@ wxBoxSizer* StatusBasePanel::create_filament_group(wxWindow* parent)
steps_sizer->Add(m_filament_load_img, 0, wxALIGN_TOP, FromDIP(30)); steps_sizer->Add(m_filament_load_img, 0, wxALIGN_TOP, FromDIP(30));
steps_sizer->AddStretchSpacer(); steps_sizer->AddStretchSpacer();
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_text_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Pressed),
std::pair<wxColour, int>(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Normal));
m_button_retry = new Button(m_filament_load_box, _L("Retry")); m_button_retry = new Button(m_filament_load_box, _L("Retry"));
m_button_retry->SetFont(Label::Body_13); m_button_retry->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_retry->SetBorderColor(btn_bd_white);
m_button_retry->SetTextColor(btn_text_white);
m_button_retry->SetMinSize(wxSize(FromDIP(80), FromDIP(31)));
m_button_retry->SetBackgroundColor(btn_bg_white);
//m_button_retry->Hide(); //m_button_retry->Hide();
m_button_retry->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { m_button_retry->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
@@ -4052,7 +3983,7 @@ void StatusPanel::on_axis_ctrl_z_down_10(wxCommandEvent &event)
void StatusPanel::axis_ctrl_e_hint(bool up_down) void StatusPanel::axis_ctrl_e_hint(bool up_down)
{ {
if (ctrl_e_hint_dlg == nullptr) { if (ctrl_e_hint_dlg == nullptr) {
/* ctrl_e_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::ButtonStyle::CONFIRM_AND_CANCEL, wxDefaultPosition, /* ctrl_e_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::VisibleButtons::CONFIRM_AND_CANCEL, wxDefaultPosition,
ctrl_e_hint_dlg->update_text(_L("Please heat the nozzle to above 170°C before loading or unloading filament.")); ctrl_e_hint_dlg->update_text(_L("Please heat the nozzle to above 170°C before loading or unloading filament."));
ctrl_e_hint_dlg->m_show_again_checkbox->Hide(); ctrl_e_hint_dlg->m_show_again_checkbox->Hide();
ctrl_e_hint_dlg->m_button_cancel->Hide(); ctrl_e_hint_dlg->m_button_cancel->Hide();
@@ -4898,7 +4829,7 @@ void StatusPanel::on_camera_enter(wxMouseEvent& event)
m_camera_popup->Bind(EVT_VCAMERA_SWITCH, &StatusPanel::on_switch_vcamera, this); m_camera_popup->Bind(EVT_VCAMERA_SWITCH, &StatusPanel::on_switch_vcamera, this);
m_camera_popup->Bind(EVT_SDCARD_ABSENT_HINT, [this](wxCommandEvent &e) { m_camera_popup->Bind(EVT_SDCARD_ABSENT_HINT, [this](wxCommandEvent &e) {
if (sdcard_hint_dlg == nullptr) { if (sdcard_hint_dlg == nullptr) {
sdcard_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM); sdcard_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
sdcard_hint_dlg->update_text(_L("Can't start this without storage.")); sdcard_hint_dlg->update_text(_L("Can't start this without storage."));
} }
sdcard_hint_dlg->on_show(); sdcard_hint_dlg->on_show();
@@ -5851,18 +5782,9 @@ wxBoxSizer *ScoreDialog::get_button_sizer()
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->Add(0, 0, 1, wxEXPAND, 0); bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok = new Button(this, _L("Submit")); m_button_ok = new Button(this, _L("Submit"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_ok->SetBorderColor(*wxWHITE); bSizer_button->Add(m_button_ok, 0, wxRIGHT, FromDIP(ButtonProps::ChoiceButtonGap()));
m_button_ok->SetTextColor(wxColour("#FFFFFE"));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_ok, 0, wxRIGHT, FromDIP(24));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
m_upload_status_code = StatusCode::UPLOAD_PROGRESS; m_upload_status_code = StatusCode::UPLOAD_PROGRESS;
@@ -5997,17 +5919,9 @@ wxBoxSizer *ScoreDialog::get_button_sizer()
} }
}); });
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48)); bSizer_button->Add(m_button_cancel, 0, wxRIGHT, FromDIP(ButtonProps::ChoiceButtonGap()));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_cancel, 0, wxRIGHT, FromDIP(24));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); }); m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
+2 -3
View File
@@ -1808,13 +1808,12 @@ FullCompareDialog::FullCompareDialog(const wxString& option_name, const wxString
sizer->Add(grid_sizer, 1, wxEXPAND); sizer->Add(grid_sizer, 1, wxEXPAND);
wxStdDialogButtonSizer* buttons = this->CreateStdDialogButtonSizer(wxOK); auto dlg_btns = new DialogButtons(this, {"OK"});
wxGetApp().UpdateDarkUI(static_cast<wxButton*>(this->FindWindowById(wxID_OK, this)), true);
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
topSizer->Add(sizer, 1, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, border); topSizer->Add(sizer, 1, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, border);
topSizer->Add(buttons, 0, wxEXPAND | wxALL, border); topSizer->Add(dlg_btns , 0, wxEXPAND);
SetSizer(topSizer); SetSizer(topSizer);
topSizer->SetSizeHints(this); topSizer->SetSizeHints(this);
+2 -22
View File
@@ -138,31 +138,11 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector<Update> &updates, bool force_
auto sizer_button = new wxBoxSizer(wxHORIZONTAL); auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
sizer_button->Add(0, 0, 1, wxEXPAND, 5); sizer_button->Add(0, 0, 1, wxEXPAND, 5);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
auto m_butto_ok = new Button(this, _L("OK")); auto m_butto_ok = new Button(this, _L("OK"));
m_butto_ok->SetBackgroundColor(btn_bg_green); m_butto_ok->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_butto_ok->SetBorderColor(*wxWHITE);
m_butto_ok->SetTextColor(*wxWHITE);
m_butto_ok->SetFont(Label::Body_12);
m_butto_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_butto_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
auto m_button_cancel = new Button(this, _L("Cancel")); auto m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(*wxWHITE); m_button_cancel->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
sizer_button->Add(m_butto_ok, 0, wxALL, 5); sizer_button->Add(m_butto_ok, 0, wxALL, 5);
sizer_button->Add(m_button_cancel, 0, wxALL, 5); sizer_button->Add(m_button_cancel, 0, wxALL, 5);
+3 -13
View File
@@ -226,17 +226,7 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
m_main_right_sizer->Add(0, FromDIP(50), 0, wxEXPAND, FromDIP(5)); m_main_right_sizer->Add(0, FromDIP(50), 0, wxEXPAND, FromDIP(5));
m_button_upgrade_firmware = new Button(this, _L("Update firmware")); m_button_upgrade_firmware = new Button(this, _L("Update firmware"));
StateColor btn_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), m_button_upgrade_firmware->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Enabled));
StateColor btn_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled));
m_button_upgrade_firmware->SetBackgroundColor(btn_bg);
m_button_upgrade_firmware->SetBorderColor(btn_bd);
m_button_upgrade_firmware->SetTextColor(btn_text);
m_button_upgrade_firmware->SetFont(Label::Body_10);
m_button_upgrade_firmware->SetMinSize(wxSize(FromDIP(-1), FromDIP(24)));
m_button_upgrade_firmware->SetCornerRadius(FromDIP(12));
m_main_right_sizer->Add(m_button_upgrade_firmware, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, FromDIP(5)); m_main_right_sizer->Add(m_button_upgrade_firmware, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, FromDIP(5));
m_staticText_upgrading_info = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0); m_staticText_upgrading_info = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0);
@@ -1440,7 +1430,7 @@ void UpgradePanel::update(MachineObject *obj)
if (m_obj->upgrade_force_upgrade) { if (m_obj->upgrade_force_upgrade) {
m_show_forced_hint = false; //lock hint m_show_forced_hint = false; //lock hint
if (force_dlg == nullptr) { if (force_dlg == nullptr) {
force_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::ButtonStyle::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize); force_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::VisibleButtons::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize); // ORCA VisibleButtons instead ButtonStyle
force_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) { force_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
if (m_obj) { if (m_obj) {
m_obj->command_upgrade_confirm(); m_obj->command_upgrade_confirm();
@@ -1465,7 +1455,7 @@ void UpgradePanel::update(MachineObject *obj)
if (m_obj->upgrade_consistency_request) { if (m_obj->upgrade_consistency_request) {
m_show_consistency_hint = false; m_show_consistency_hint = false;
if (consistency_dlg == nullptr) { if (consistency_dlg == nullptr) {
consistency_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::ButtonStyle::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize); consistency_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Update firmware"), SecondaryCheckDialog::VisibleButtons::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize); // ORCA VisibleButtons instead ButtonStyle
consistency_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) { consistency_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
if (m_obj) { if (m_obj) {
m_obj->command_consistency_upgrade_confirm(); m_obj->command_consistency_upgrade_confirm();
+6 -47
View File
@@ -133,37 +133,9 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_panel_option_right->SetMinSize(wxSize(FromDIP(180), -1)); m_panel_option_right->SetMinSize(wxSize(FromDIP(180), -1));
m_panel_option_right->SetMaxSize(wxSize(FromDIP(180), -1)); m_panel_option_right->SetMaxSize(wxSize(FromDIP(180), -1));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Pressed),
std::pair<wxColour, int>(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_text_green(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Enabled));
StateColor btn_text_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
/*option left*/ /*option left*/
m_button_auto_refill = new Button(m_panel_option_left, _L("Auto-refill")); m_button_auto_refill = new Button(m_panel_option_left, _L("Auto-refill"));
m_button_auto_refill->SetBackgroundColor(btn_bg_white); m_button_auto_refill->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_auto_refill->SetBorderColor(btn_bd_white);
m_button_auto_refill->SetTextColor(btn_text_white);
m_button_auto_refill->SetFont(Label::Body_13);
m_button_auto_refill->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_auto_refill->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_ams_setting_normal = ScalableBitmap(this, "ams_setting_normal", 24); m_button_ams_setting_normal = ScalableBitmap(this, "ams_setting_normal", 24);
m_button_ams_setting_hover = ScalableBitmap(this, "ams_setting_hover", 24); m_button_ams_setting_hover = ScalableBitmap(this, "ams_setting_hover", 24);
@@ -182,12 +154,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
/*option right*/ /*option right*/
m_button_extruder_feed = new Button(m_panel_option_right, _L("Load")); m_button_extruder_feed = new Button(m_panel_option_right, _L("Load"));
m_button_extruder_feed->SetFont(Label::Body_13); m_button_extruder_feed->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_extruder_feed->SetBackgroundColor(btn_bg_green);
m_button_extruder_feed->SetBorderColor(btn_bd_green);
m_button_extruder_feed->SetTextColor(btn_text_green);
m_button_extruder_feed->SetMinSize(wxSize(FromDIP(80),FromDIP(34)));
m_button_extruder_feed->SetMaxSize(wxSize(FromDIP(80),FromDIP(34)));
m_button_extruder_feed->EnableTooltipEvenDisabled(); m_button_extruder_feed->EnableTooltipEvenDisabled();
@@ -203,12 +170,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
if (wxGetApp().app_config->get("language") == "pt_BR") m_button_extruder_feed->SetLabel("Load"); if (wxGetApp().app_config->get("language") == "pt_BR") m_button_extruder_feed->SetLabel("Load");
m_button_extruder_back = new Button(m_panel_option_right, _L("Unload")); m_button_extruder_back = new Button(m_panel_option_right, _L("Unload"));
m_button_extruder_back->SetBackgroundColor(btn_bg_white); m_button_auto_refill->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_extruder_back->SetBorderColor(btn_bd_white);
m_button_extruder_back->SetTextColor(btn_text_white);
m_button_extruder_back->SetFont(Label::Body_13);
m_button_extruder_back->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_extruder_back->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
m_button_extruder_back->EnableTooltipEvenDisabled(); m_button_extruder_back->EnableTooltipEvenDisabled();
if (wxGetApp().app_config->get("language") == "de_DE") m_button_extruder_back->SetFont(Label::Body_9); if (wxGetApp().app_config->get("language") == "de_DE") m_button_extruder_back->SetFont(Label::Body_9);
@@ -502,12 +464,9 @@ void AMSControl::msw_rescale()
m_extruder->msw_rescale(); m_extruder->msw_rescale();
if (m_button_extruder_feed) m_button_extruder_feed->SetMinSize(wxSize(FromDIP(80), FromDIP(34))); if (m_button_extruder_feed) m_button_extruder_feed->Rescale(); // ORCA
if (m_button_extruder_feed) m_button_extruder_feed->SetMaxSize(wxSize(FromDIP(80), FromDIP(34))); if (m_button_extruder_back) m_button_extruder_back->Rescale(); // ORCA
if (m_button_extruder_back) m_button_extruder_back->SetMinSize(wxSize(FromDIP(80), FromDIP(34))); if (m_button_auto_refill) m_button_auto_refill->Rescale(); // ORCA
if (m_button_extruder_back) m_button_extruder_back->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_auto_refill) m_button_auto_refill->SetMinSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_auto_refill) m_button_auto_refill->SetMaxSize(wxSize(FromDIP(80), FromDIP(34)));
if (m_button_ams_setting) m_button_ams_setting->SetMinSize(wxSize(FromDIP(25), FromDIP(24))); if (m_button_ams_setting) m_button_ams_setting->SetMinSize(wxSize(FromDIP(25), FromDIP(24)));
+13 -8
View File
@@ -174,7 +174,7 @@ void Button::SetVertical(bool vertical)
// Background Foreground Border on focus // Background Foreground Border on focus
// Button Colors 0-Disabled 1-Pressed 2-Hover 3-Normal 4-Enabled 5-Disabled 6-Normal 7-Hover 8-Dark 9-Light // Button Colors 0-Disabled 1-Pressed 2-Hover 3-Normal 4-Enabled 5-Disabled 6-Normal 7-Hover 8-Dark 9-Light
wxString btn_regular[10] = {"#DFDFDF", "#DFDFDF", "#D4D4D4", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#262E30", "#262E30", "#009688", "#009688"}; wxString btn_regular[10] = {"#DFDFDF", "#DFDFDF", "#D4D4D4", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#262E30", "#262E30", "#009688", "#009688"};
wxString btn_confirm[10] = {"#DFDFDF", "#009688", "#26A69A", "#009688", "#009688", "#6B6A6A", "#FEFEFE", "#FEFEFE", "#26A69A", "#00FFD4"}; wxString btn_confirm[10] = {"#DFDFDF", "#009688", "#26A69A", "#009688", "#009688", "#6B6A6A", "#FEFEFE", "#FEFEFE", "#22bfb0", "#00FFD4"};
wxString btn_alert[10] = {"#DFDFDF", "#DFDFDF", "#E14747", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#262E30", "#FFFFFD", "#009688", "#009688"}; wxString btn_alert[10] = {"#DFDFDF", "#DFDFDF", "#E14747", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#262E30", "#FFFFFD", "#009688", "#009688"};
wxString btn_disabled[10] = {"#DFDFDF", "#DFDFDF", "#DFDFDF", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#6B6A6A", "#262E30", "#DFDFDF", "#DFDFDF"}; wxString btn_disabled[10] = {"#DFDFDF", "#DFDFDF", "#DFDFDF", "#DFDFDF", "#DFDFDF", "#6B6A6A", "#6B6A6A", "#262E30", "#DFDFDF", "#DFDFDF"};
@@ -220,19 +220,24 @@ void Button::SetStyle(const ButtonStyle style, const ButtonType type)
style == ButtonStyle::Disabled ? btn_disabled : style == ButtonStyle::Disabled ? btn_disabled :
btn_regular ; btn_regular ;
this->SetBackgroundColor(StateColor( auto bg_color = StateColor(
std::pair(wxColour(clr_arr[3]), (int)StateColor::NotHovered),
std::pair(wxColour(clr_arr[0]), (int)StateColor::Disabled), std::pair(wxColour(clr_arr[0]), (int)StateColor::Disabled),
std::pair(wxColour(clr_arr[1]), (int)StateColor::Pressed), std::pair(wxColour(clr_arr[1]), (int)StateColor::Pressed),
std::pair(wxColour(clr_arr[2]), (int)StateColor::Hovered), std::pair(wxColour(clr_arr[2]), (int)StateColor::Hovered),
std::pair(wxColour(clr_arr[3]), (int)StateColor::Normal), std::pair(wxColour(clr_arr[3]), (int)StateColor::Normal),
std::pair(wxColour(clr_arr[4]), (int)StateColor::Enabled) std::pair(wxColour(clr_arr[4]), (int)StateColor::Enabled)
)); );
this->SetBorderColor(StateColor( bg_color.setTakeFocusedAsHovered(false);
std::pair(wxColour(clr_arr[3]), (int)StateColor::NotFocused), this->SetBackgroundColor(bg_color);
wxColour focus_clr = clr_arr[is_dark ? 8 : 9];
auto border_color = StateColor(
std::pair(wxColour(clr_arr[0]), (int)StateColor::Disabled), std::pair(wxColour(clr_arr[0]), (int)StateColor::Disabled),
std::pair(wxColour(clr_arr[is_dark ? 8 : 9]), (int)StateColor::Focused) std::pair(wxColour(clr_arr[2]), (int)(StateColor::Hovered | ~StateColor::Focused)),
)); std::pair(wxColour(focus_clr ), (int)StateColor::Focused),
std::pair(wxColour(clr_arr[3]), (int)StateColor::Normal)
);
border_color.setTakeFocusedAsHovered(false);
this->SetBorderColor(border_color);
this->SetTextColor(StateColor( this->SetTextColor(StateColor(
std::pair(wxColour(clr_arr[5]), (int)StateColor::Disabled), std::pair(wxColour(clr_arr[5]), (int)StateColor::Disabled),
std::pair(wxColour(clr_arr[7]), (int)StateColor::Hovered), std::pair(wxColour(clr_arr[7]), (int)StateColor::Hovered),
+25 -17
View File
@@ -5,13 +5,14 @@
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
// ORCA standardize dialog buttons // ORCA standardize dialog buttons
DialogButtons::DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_translated_label) DialogButtons::DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_translated_label, const int left_aligned_buttons_count)
: wxPanel(parent, wxID_ANY) : wxPanel(parent, wxID_ANY)
{ {
m_parent = parent; m_parent = parent;
m_sizer = new wxBoxSizer(wxHORIZONTAL); m_sizer = new wxBoxSizer(wxHORIZONTAL);
m_primary = primary_btn_translated_label; m_primary = primary_btn_translated_label;
m_alert = wxEmptyString; m_alert = wxEmptyString;
m_left_aligned_buttons_count = left_aligned_buttons_count;
SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF"))); SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF")));
// Add all to array // Add all to array
@@ -55,6 +56,13 @@ Button* DialogButtons::GetButtonFromLabel(wxString translated_label) {
return nullptr; return nullptr;
} }
Button* DialogButtons::GetButtonFromIndex(int index) {
if(index >= 0 && index < m_buttons.size())
return m_buttons[index];
else
return nullptr;
}
Button* DialogButtons::PickFromList(std::set<wxStandardID> ID_list) { Button* DialogButtons::PickFromList(std::set<wxStandardID> ID_list) {
// Picks first button from given list // Picks first button from given list
Button* b; Button* b;
@@ -75,6 +83,8 @@ Button* DialogButtons::GetNO() {return GetButtonFromID(wxID_NO) ;}
Button* DialogButtons::GetCANCEL() {return GetButtonFromID(wxID_CANCEL) ;} Button* DialogButtons::GetCANCEL() {return GetButtonFromID(wxID_CANCEL) ;}
Button* DialogButtons::GetRETURN() {return GetButtonFromID(wxID_BACKWARD);} // gets Return button Button* DialogButtons::GetRETURN() {return GetButtonFromID(wxID_BACKWARD);} // gets Return button
Button* DialogButtons::GetNEXT() {return GetButtonFromID(wxID_FORWARD) ;} Button* DialogButtons::GetNEXT() {return GetButtonFromID(wxID_FORWARD) ;}
Button* DialogButtons::GetFIRST() {return GetButtonFromIndex(0) ;}
Button* DialogButtons::GetLAST() {return GetButtonFromIndex(m_buttons.size() - 1);}
void DialogButtons::SetPrimaryButton(wxString translated_label) { void DialogButtons::SetPrimaryButton(wxString translated_label) {
// use _L("Create") translated text for custom buttons // use _L("Create") translated text for custom buttons
@@ -127,25 +137,18 @@ void DialogButtons::UpdateButtons() {
btn->Bind(wxEVT_KEY_DOWN, &DialogButtons::on_keydown, this); btn->Bind(wxEVT_KEY_DOWN, &DialogButtons::on_keydown, this);
} }
int btn_gap = FromDIP(10); int btn_gap = FromDIP(ButtonProps::ChoiceButtonGap());
auto list = m_left_align_IDs; if(m_left_aligned_buttons_count == 0)
auto on_left = [list](int id){
return list.find(wxStandardID(id)) != list.end();
};
for (Button* btn : m_buttons) // Left aligned
if(on_left(btn->GetId()))
m_sizer->Add(btn, 0, wxLEFT | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap);
m_sizer->AddStretchSpacer();
if(m_sizer->IsEmpty()) // add left margin if no button on left. fixes no gap on small windows
m_sizer->AddSpacer(btn_gap); m_sizer->AddSpacer(btn_gap);
for (Button* btn : m_buttons) // Right aligned for (int i = 0; i < m_buttons.size(); i++) {
if(!on_left(btn->GetId())) if(m_left_aligned_buttons_count == i)
m_sizer->Add(btn, 0, wxRIGHT | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap); m_sizer->AddStretchSpacer();
auto margin_to = (i >= m_left_aligned_buttons_count ? wxRIGHT : wxLEFT);
m_sizer->Add(m_buttons[i], 0, margin_to | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap);
}
SetPrimaryButton(m_primary); SetPrimaryButton(m_primary);
SetAlertButton(m_alert); SetAlertButton(m_alert);
@@ -158,6 +161,11 @@ int DialogButtons::FromDIP(int d) {
return m_parent->FromDIP(d); return m_parent->FromDIP(d);
} }
void DialogButtons::SetLeftAlignedButtonsCount(int left_aligned_buttons_count){
m_left_aligned_buttons_count = left_aligned_buttons_count;
UpdateButtons();
}
// This might be helpful for future use // This might be helpful for future use
// Append Button // Append Button
+8 -7
View File
@@ -16,7 +16,7 @@ namespace Slic3r { namespace GUI {
class DialogButtons : public wxPanel{ class DialogButtons : public wxPanel{
public: public:
DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_label = ""); DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_label = "", const int left_aligned_buttons_count = 0);
wxBoxSizer* GetSizer() const { return m_sizer; } wxBoxSizer* GetSizer() const { return m_sizer; }
@@ -24,6 +24,8 @@ public:
Button* GetButtonFromLabel(wxString label); Button* GetButtonFromLabel(wxString label);
Button* GetButtonFromIndex(int index);
Button* GetOK(); Button* GetOK();
Button* GetYES(); Button* GetYES();
Button* GetAPPLY(); Button* GetAPPLY();
@@ -32,11 +34,15 @@ public:
Button* GetCANCEL(); Button* GetCANCEL();
Button* GetRETURN(); Button* GetRETURN();
Button* GetNEXT(); Button* GetNEXT();
Button* GetFIRST();
Button* GetLAST();
void SetPrimaryButton(wxString label); void SetPrimaryButton(wxString label);
void SetAlertButton(wxString label); void SetAlertButton(wxString label);
void SetLeftAlignedButtonsCount(int left_aligned_buttons_count);
void UpdateButtons(); void UpdateButtons();
~DialogButtons(); ~DialogButtons();
@@ -47,6 +53,7 @@ private:
std::vector<Button*> m_buttons; std::vector<Button*> m_buttons;
wxString m_primary; wxString m_primary;
wxString m_alert; wxString m_alert;
int m_left_aligned_buttons_count;
// missing ones Transfer / Update / Create // missing ones Transfer / Update / Create
const std::map<wxString, wxStandardID> m_standardIDs = { const std::map<wxString, wxStandardID> m_standardIDs = {
@@ -106,12 +113,6 @@ private:
wxID_EXIT wxID_EXIT
}; };
std::set<wxStandardID> m_left_align_IDs {
wxID_DELETE,
wxID_BACKWARD,
wxID_FORWARD
};
Button* PickFromList(std::set<wxStandardID> ID_list); Button* PickFromList(std::set<wxStandardID> ID_list);
int FromDIP(int d); int FromDIP(int d);
+1
View File
@@ -14,6 +14,7 @@ static std::map<wxColour, wxColour> gDarkColors{
{"#DFDFDF", "#3E3E45"}, // rgb(223, 223, 223) Button Background color {"#DFDFDF", "#3E3E45"}, // rgb(223, 223, 223) Button Background color
{"#D4D4D4", "#4D4D54"}, // rgb(212, 212, 212) Button Background color on Hover {"#D4D4D4", "#4D4D54"}, // rgb(212, 212, 212) Button Background color on Hover
{"#6B6A6A", "#909090"}, // rgb(107, 107, 106) Button Dimmed text {"#6B6A6A", "#909090"}, // rgb(107, 107, 106) Button Dimmed text
{"#26A69A", "#008172"}, // rgb(0, 150, 136) Button Confirm Color hover | ORCA Color Hover
{"#6B6B6A", "#B3B3B5"}, // rgb(107, 107, 106) Input box side text {"#6B6B6A", "#B3B3B5"}, // rgb(107, 107, 106) Input box side text
{"#2C2C2E", "#B3B3B4"}, // rgb(44, 44, 46) ??? {"#2C2C2E", "#B3B3B4"}, // rgb(44, 44, 46) ???
{"#6B6B6B", "#818183"}, // rgb(107, 107, 107) Disabled Text {"#6B6B6B", "#818183"}, // rgb(107, 107, 107) Disabled Text