NEW:added dark mode
Change-Id: I3f61f1d93020e0a9dfba2c7d6cf6bf5194effcfa
|
@ -1,12 +1,3 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.60031 3.36816C1.60031 2.53974 2.27188 1.86816 3.10031 1.86816H14.7634C15.5918 1.86816 16.2634 2.53974 16.2634 3.36816V10.0047H1.60031V3.36816ZM3.10031 2.86816C2.82417 2.86816 2.60031 3.09202 2.60031 3.36816V9.00474H15.2634V3.36816C15.2634 3.09202 15.0395 2.86816 14.7634 2.86816H3.10031Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.252106 10.5047C0.252106 9.6763 0.923678 9.00473 1.75211 9.00473H15.9972C16.8256 9.00473 17.4972 9.6763 17.4972 10.5047V15.6229C17.4972 16.4514 16.8256 17.1229 15.9972 17.1229H1.7521C0.923676 17.1229 0.252106 16.4514 0.252106 15.6229V10.5047ZM1.75211 10.0047C1.47596 10.0047 1.25211 10.2286 1.25211 10.5047V15.6229C1.25211 15.8991 1.47596 16.1229 1.7521 16.1229H15.9972C16.2733 16.1229 16.4972 15.8991 16.4972 15.6229V10.5047C16.4972 10.2286 16.2734 10.0047 15.9972 10.0047H1.75211Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.15292 3.96497H6.79239V10.0046H3.15292V3.96497ZM4.15292 4.96497V9.00458H5.79239V4.96497H4.15292Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.79236 3.96484H9.43183V10.0045H5.79236V3.96484ZM6.79236 4.96484V9.00446H8.43183V4.96484H6.79236Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.43182 3.96484H12.0713V10.0045H8.43182V3.96484ZM9.43182 4.96484V9.00446H11.0713V4.96484H9.43182Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.0713 3.9649H14.7107V10.0045H11.0713V3.9649ZM12.0713 4.9649V9.00452H13.7107V4.9649H12.0713Z" fill="#262E30"/>
|
||||
<path d="M19.7747 13.0638C19.7747 16.4492 17.0303 19.1936 13.6449 19.1936C10.2595 19.1936 7.51514 16.4492 7.51514 13.0638C7.51514 9.67844 10.2595 6.93405 13.6449 6.93405C17.0303 6.93405 19.7747 9.67844 19.7747 13.0638Z" fill="#F5F5F5"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.6449 18.1936C16.478 18.1936 18.7747 15.8969 18.7747 13.0638C18.7747 10.2307 16.478 7.93405 13.6449 7.93405C10.8118 7.93405 8.51514 10.2307 8.51514 13.0638C8.51514 15.8969 10.8118 18.1936 13.6449 18.1936ZM13.6449 19.1936C17.0303 19.1936 19.7747 16.4492 19.7747 13.0638C19.7747 9.67844 17.0303 6.93405 13.6449 6.93405C10.2595 6.93405 7.51514 9.67844 7.51514 13.0638C7.51514 16.4492 10.2595 19.1936 13.6449 19.1936Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.455 10.2222C14.6503 10.0269 14.9669 10.0269 15.1621 10.2222L16.6376 11.6976C16.7806 11.8406 16.8234 12.0557 16.746 12.2425C16.6686 12.4294 16.4863 12.5512 16.284 12.5512H11.0631C10.787 12.5512 10.5631 12.3273 10.5631 12.0512C10.5631 11.775 10.787 11.5512 11.0631 11.5512H15.0769L14.455 10.9293C14.2598 10.734 14.2598 10.4174 14.455 10.2222Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.8347 15.9055C12.6395 16.1007 12.3229 16.1007 12.1276 15.9055L10.6522 14.43C10.5092 14.287 10.4664 14.0719 10.5438 13.8851C10.6212 13.6983 10.8035 13.5764 11.0057 13.5764L16.2266 13.5764C16.5028 13.5764 16.7266 13.8003 16.7266 14.0764C16.7266 14.3526 16.5028 14.5764 16.2266 14.5764L12.2128 14.5764L12.8347 15.1984C13.03 15.3936 13.03 15.7102 12.8347 15.9055Z" fill="#262E30"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.10031 1.86719C2.27188 1.86719 1.60031 2.53877 1.60031 3.36719V9.01149C0.843171 9.08758 0.252106 9.72671 0.252106 10.5039V15.6221C0.252106 16.4506 0.923676 17.1221 1.7521 17.1221H9.05122C10.1743 18.3923 11.8161 19.1931 13.6449 19.1931C17.0303 19.1931 19.7747 16.4487 19.7747 13.0633C19.7747 10.6147 18.339 8.50146 16.2634 7.51942V3.36719C16.2634 2.53877 15.5918 1.86719 14.7634 1.86719H3.10031ZM15.2634 7.14953V3.36719C15.2634 3.09105 15.0395 2.86719 14.7634 2.86719H3.10031C2.82417 2.86719 2.60031 3.09105 2.60031 3.36719V9.00377H3.15292V3.96484H5.79236H6.79239H8.43182H9.43183H11.0713H12.0713H14.7107V7.02592C14.898 7.05876 15.0824 7.1001 15.2634 7.14953ZM13.7107 6.93394V4.96484H12.0713V7.13745C12.5735 7.00446 13.1009 6.93359 13.6449 6.93359C13.6669 6.93359 13.6888 6.93371 13.7107 6.93394ZM11.0713 7.49841V4.96484H9.43182L9.43183 8.61091C9.91152 8.15685 10.4645 7.77947 11.0713 7.49841ZM8.3317 10.0045H5.79236V10.0045H3.15292V10.0039H1.75211C1.47596 10.0039 1.25211 10.2278 1.25211 10.5039V15.6221C1.25211 15.8983 1.47596 16.1221 1.7521 16.1221H8.33162C7.81228 15.2219 7.51514 14.1773 7.51514 13.0633C7.51514 11.9493 7.81231 10.9047 8.3317 10.0045ZM8.43183 4.96484V9.00377H6.79239V4.96484H8.43183ZM5.79236 4.96484H4.15292V9.00377H5.79236V4.96484ZM18.7747 13.0633C18.7747 15.8964 16.478 18.1931 13.6449 18.1931C10.8118 18.1931 8.51514 15.8964 8.51514 13.0633C8.51514 10.2302 10.8118 7.93359 13.6449 7.93359C16.478 7.93359 18.7747 10.2302 18.7747 13.0633ZM14.455 10.2226C14.6503 10.0273 14.9669 10.0273 15.1621 10.2226L16.6376 11.698C16.7806 11.841 16.8234 12.0561 16.746 12.2429C16.6686 12.4298 16.4863 12.5516 16.284 12.5516H11.0631C10.787 12.5516 10.5631 12.3277 10.5631 12.0516C10.5631 11.7754 10.787 11.5516 11.0631 11.5516H15.0769L14.455 10.9297C14.2598 10.7344 14.2598 10.4178 14.455 10.2226ZM12.1276 15.9053C12.3229 16.1005 12.6395 16.1005 12.8347 15.9053C13.03 15.71 13.03 15.3934 12.8347 15.1982L12.2128 14.5762H16.2266C16.5028 14.5762 16.7266 14.3524 16.7266 14.0762C16.7266 13.8001 16.5028 13.5762 16.2266 13.5762H11.0057C10.8035 13.5762 10.6212 13.6981 10.5438 13.8849C10.4664 14.0717 10.5092 14.2868 10.6522 14.4298L12.1276 15.9053Z" fill="#262E30"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
@ -1,57 +1,56 @@
|
|||
<svg width="36" height="55" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" version="1.1">
|
||||
|
||||
<g>
|
||||
<title>Layer 1</title>
|
||||
<path id="svg_1" fill="#FFFFFF" d="m-1.18502,-0.17467l0,55l38,0l0,-55l-38,0zm19.6,42.1c-6.8,0 -12.3,-5.5 -12.3,-12.3c0,-6.8 5.5,-12.3 12.3,-12.3c6.8,0 12.3,5.5 12.3,12.3c0,6.7 -5.5,12.3 -12.3,12.3z" class="st0"/>
|
||||
<path id="svg_2" fill="#ACACAC" d="m25.81498,7.52533l-15.7,0c-5.7,0 -10.4,4.6 -10.4,10.4l0,33.1l36.5,0l0,-33.1c0,-5.7 -4.6,-10.4 -10.4,-10.4zm-7.8,29.6c-4.2,0 -7.6,-3.4 -7.6,-7.6s3.4,-7.6 7.6,-7.6s7.6,3.4 7.6,7.6c0,4.2 -3.4,7.6 -7.6,7.6z" class="st1"/>
|
||||
<path id="svg_3" fill="#C0C0C0" d="m24.31498,11.22533l-12.7,0c-4.3,0 -7.8,3.5 -7.8,7.8l0,27.8l28.2,0l0,-27.8c0.1,-4.3 -3.4,-7.8 -7.7,-7.8zm-6.3,25.9c-4.2,0 -7.6,-3.4 -7.6,-7.6s3.4,-7.6 7.6,-7.6s7.6,3.4 7.6,7.6c0,4.2 -3.4,7.6 -7.6,7.6z" class="st2"/>
|
||||
<g id="svg_4">
|
||||
<path id="svg_5" fill="#818181" d="m18.01498,21.92533l0.4,-2.8l-0.9,0l0.4,2.8c0,0 0,0 0.1,0l0,0z" class="st3"/>
|
||||
<path id="svg_6" fill="#818181" d="m16.61498,19.22533l-0.9,0.2l0.8,2.7l0.1,0l0,-2.9z" class="st3"/>
|
||||
<path id="svg_7" fill="#818181" d="m14.81498,19.62533l-0.8,0.3l1.3,2.5c0,0 0.1,0 0.1,-0.1l-0.6,-2.7z" class="st3"/>
|
||||
<path id="svg_8" fill="#818181" d="m13.11498,20.32533l-0.8,0.4l1.7,2.2l0.1,-0.1l-1,-2.5z" class="st3"/>
|
||||
<path id="svg_9" fill="#818181" d="m11.61498,21.32533l-0.7,0.5l2.1,1.9l0.1,-0.1l-1.5,-2.3z" class="st3"/>
|
||||
<path id="svg_10" fill="#818181" d="m10.31498,22.52533l-0.6,0.7l2.4,1.5l0.1,-0.1l-1.9,-2.1z" class="st3"/>
|
||||
<path id="svg_11" fill="#818181" d="m9.21498,23.92533l-0.4,0.8l2.6,1.1l0.1,-0.1l-2.3,-1.8z" class="st3"/>
|
||||
<path id="svg_12" fill="#818181" d="m8.31498,25.52533l-0.3,0.8l2.7,0.6c0,0 0,-0.1 0.1,-0.1l-2.5,-1.3z" class="st3"/>
|
||||
<path id="svg_13" fill="#818181" d="m7.81498,27.32533l-0.2,0.9l2.8,0.1l0,-0.1l-2.6,-0.9z" class="st3"/>
|
||||
<path id="svg_14" fill="#818181" d="m10.31498,29.42533l-2.8,-0.4l0,0.9l2.8,-0.4c0,0.1 0,0 0,-0.1c0,0.1 0,0.1 0,0z" class="st3"/>
|
||||
<path id="svg_15" fill="#818181" d="m7.61498,30.92533l0.2,0.9l2.7,-0.8l0,-0.1l-2.9,0z" class="st3"/>
|
||||
<path id="svg_16" fill="#818181" d="m8.01498,32.72533l0.3,0.8l2.5,-1.3c0,0 0,-0.1 -0.1,-0.1l-2.7,0.6z" class="st3"/>
|
||||
<path id="svg_17" fill="#818181" d="m8.71498,34.32533l0.4,0.8l2.2,-1.7l-0.1,-0.1l-2.5,1z" class="st3"/>
|
||||
<path id="svg_18" fill="#818181" d="m9.71498,35.92533l0.6,0.7l1.9,-2.1l-0.1,-0.1l-2.4,1.5z" class="st3"/>
|
||||
<path id="svg_19" fill="#818181" d="m10.91498,37.22533l0.7,0.6l1.5,-2.4l-0.1,-0.1l-2.1,1.9z" class="st3"/>
|
||||
<path id="svg_20" fill="#818181" d="m12.41498,38.32533l0.8,0.4l1.1,-2.6l-0.1,-0.1l-1.8,2.3z" class="st3"/>
|
||||
<path id="svg_21" fill="#818181" d="m14.01498,39.12533l0.8,0.3l0.6,-2.7c0,0 -0.1,0 -0.1,-0.1l-1.3,2.5z" class="st3"/>
|
||||
<path id="svg_22" fill="#818181" d="m15.71498,39.72533l0.9,0.2l0.1,-2.8l-0.1,0l-0.9,2.6z" class="st3"/>
|
||||
<path id="svg_23" fill="#818181" d="m17.91498,37.12533l-0.4,2.8l0.9,0l-0.4,-2.8c0,0 0,0 -0.1,0l0,0z" class="st3"/>
|
||||
<path id="svg_24" fill="#818181" d="m19.31498,39.82533l0.9,-0.2l-0.8,-2.7l-0.1,0l0,2.9z" class="st3"/>
|
||||
<path id="svg_25" fill="#818181" d="m21.11498,39.42533l0.8,-0.3l-1.3,-2.5c0,0 -0.1,0 -0.1,0.1l0.6,2.7z" class="st3"/>
|
||||
<path id="svg_26" fill="#818181" d="m22.81498,38.72533l0.8,-0.4l-1.8,-2.2l-0.1,0.1l1.1,2.5z" class="st3"/>
|
||||
<path id="svg_27" fill="#818181" d="m24.31498,37.82533l0.7,-0.6l-2.1,-1.9l-0.1,0.1l1.5,2.4z" class="st3"/>
|
||||
<path id="svg_28" fill="#818181" d="m25.61498,36.52533l0.6,-0.7l-2.4,-1.4l-0.1,0.1l1.9,2z" class="st3"/>
|
||||
<path id="svg_29" fill="#818181" d="m26.71498,35.12533l0.4,-0.8l-2.6,-1.1l-0.1,0.1l2.3,1.8z" class="st3"/>
|
||||
<path id="svg_30" fill="#818181" d="m27.61498,33.52533l0.3,-0.8l-2.7,-0.6c0,0 0,0.1 -0.1,0.1l2.5,1.3z" class="st3"/>
|
||||
<path id="svg_31" fill="#818181" d="m28.11498,31.82533l0.2,-0.9l-2.8,-0.1l0,0.1l2.6,0.9z" class="st3"/>
|
||||
<path id="svg_32" fill="#818181" d="m25.61498,29.62533l2.8,0.4l0,-0.9l-2.8,0.4c0,0 0,0 0,0.1c0,-0.1 0,0 0,0z" class="st3"/>
|
||||
<path id="svg_33" fill="#818181" d="m28.31498,28.12533l-0.2,-0.9l-2.7,0.8l0,0.1l2.9,0z" class="st3"/>
|
||||
<path id="svg_34" fill="#818181" d="m27.91498,26.42533l-0.3,-0.8l-2.5,1.2c0,0 0,0.1 0.1,0.1l2.7,-0.5z" class="st3"/>
|
||||
<path id="svg_35" fill="#818181" d="m27.21498,24.72533l-0.4,-0.8l-2.2,1.7l0.1,0.1l2.5,-1z" class="st3"/>
|
||||
<path id="svg_36" fill="#818181" d="m26.21498,23.22533l-0.6,-0.7l-1.9,2.1l0.1,0.1l2.4,-1.5z" class="st3"/>
|
||||
<path id="svg_37" fill="#818181" d="m25.01498,21.82533l-0.7,-0.6l-1.5,2.4l0.1,0.1l2.1,-1.9z" class="st3"/>
|
||||
<path id="svg_38" fill="#818181" d="m23.51498,20.72533l-0.7,-0.4l-1.1,2.6l0.1,0.1l1.7,-2.3z" class="st3"/>
|
||||
<path id="svg_39" fill="#818181" d="m21.91498,19.92533l-0.8,-0.3l-0.6,2.7c0,0 0.1,0 0.1,0.1l1.3,-2.5z" class="st3"/>
|
||||
<path id="svg_40" fill="#818181" d="m20.21498,19.32533l-0.9,-0.2l-0.1,2.8l0.1,0l0.9,-2.6z" class="st3"/>
|
||||
</g>
|
||||
<path id="svg_41" fill="#ACACAC" d="m14.01498,51.02533l8.3,0l-0.6,2.8l-6.9,0l-0.8,-2.8z" class="st1"/>
|
||||
<path id="svg_42" fill="#D0D0D0" d="m16.81498,53.82533l2.3,0l-0.2,0.9l-1.9,0l-0.2,-0.9z" class="st4"/>
|
||||
<path id="svg_43" fill="#BBBBBB" d="m-0.28502,45.92533l7.9,0l0,7.4l-4,0l-3.9,-1.9c0,0 0,-5.5 0,-5.5z" class="st5"/>
|
||||
<path id="svg_44" fill="#BBBBBB" d="m36.21498,45.92533l-7.9,0l0,7.4l3.9,0l3.9,-1.9l0.1,-5.5l0,0z" class="st5"/>
|
||||
<path id="svg_45" fill="#CFCFCF" d="m3.81498,45.92533l28.2,0l0,5.5l-28.2,0l0,-5.5z" class="st6"/>
|
||||
<path id="svg_46" fill="#DDDDDD" d="m3.81498,47.32533l28.2,0l0,4.2l-28.2,0l0,-4.2z" class="st7"/>
|
||||
<path id="svg_47" fill="#8C8C8C" d="m22.81498,8.22533c0,0.4 -2.2,0.7 -4.9,0.7s-4.9,-0.3 -4.9,-0.7c0,-0.4 2.2,-0.7 4.9,-0.7s4.9,0.3 4.9,0.7z" class="st8"/>
|
||||
<path id="svg_48" fill="#C0C0C0" clip-rule="evenodd" fill-rule="evenodd" d="m15.25297,0.12533c-0.6,0 -1,0.4 -1,1l0,5.9c0,0.3 0,0.9 0,1c0,0.3 1.7,0.5 3.7,0.5s3.7,-0.2 3.7,-0.5c0,-0.1 0,-0.7 0,-1l0,-5.9c0,-0.6 -0.4,-1 -1,-1c0,0 -5.4,0 -5.4,0z" class="st9"/>
|
||||
<path id="svg_49" fill="#D2D2D2" d="m15.77729,2.52533c0,-0.6 0.4,-1 1,-1l2.5,0c0.6,0 1,0.4 1,1l0,3.3c0,0.6 -0.4,1 -1,1l-2.5,0c-0.6,0 -1,-0.4 -1,-1l0,-3.3z" class="st10"/>
|
||||
<path id="svg_50" d="m-11.10943,16.06187l0.56913,0l0.17587,-0.54067l0.17587,0.54067l0.56913,0l-0.46044,0.33415l0.17588,0.54067l-0.46044,-0.33416l-0.46044,0.33416l0.17588,-0.54067l-0.46044,-0.33415z" fill="#D2D2D2"/>
|
||||
</g>
|
||||
<svg width="36" height="55" viewBox="0 0 36 55" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_207_1489)">
|
||||
<path d="M25.8148 7.52539H10.1148C4.41484 7.52539 -0.285156 12.1254 -0.285156 17.9254V51.0254H36.2148V17.9254C36.2148 12.2254 31.6148 7.52539 25.8148 7.52539V7.52539ZM18.0148 37.1254C13.8148 37.1254 10.4148 33.7254 10.4148 29.5254C10.4148 25.3254 13.8148 21.9254 18.0148 21.9254C22.2148 21.9254 25.6148 25.3254 25.6148 29.5254C25.6148 33.7254 22.2148 37.1254 18.0148 37.1254V37.1254Z" fill="#ACACAC"/>
|
||||
<path d="M24.3149 11.2256H11.6149C7.31494 11.2256 3.81494 14.7256 3.81494 19.0256V46.8256H32.0149V19.0256C32.1149 14.7256 28.6149 11.2256 24.3149 11.2256V11.2256ZM18.0149 37.1256C13.8149 37.1256 10.4149 33.7256 10.4149 29.5256C10.4149 25.3256 13.8149 21.9256 18.0149 21.9256C22.2149 21.9256 25.6149 25.3256 25.6149 29.5256C25.6149 33.7256 22.2149 37.1256 18.0149 37.1256V37.1256Z" fill="#C0C0C0"/>
|
||||
<path d="M18.0151 21.925L18.4151 19.125H17.5151L17.9151 21.925C17.9151 21.925 17.9151 21.925 18.0151 21.925Z" fill="#818181"/>
|
||||
<path d="M16.6153 19.2246L15.7153 19.4246L16.5153 22.1246H16.6153V19.2246Z" fill="#818181"/>
|
||||
<path d="M14.8151 19.625L14.0151 19.925L15.3151 22.425C15.3151 22.425 15.4151 22.425 15.4151 22.325L14.8151 19.625Z" fill="#818181"/>
|
||||
<path d="M13.1149 20.3242L12.3149 20.7242L14.0149 22.9242L14.1149 22.8242L13.1149 20.3242V20.3242Z" fill="#818181"/>
|
||||
<path d="M11.615 21.3242L10.915 21.8242L13.015 23.7242L13.115 23.6242L11.615 21.3242V21.3242Z" fill="#818181"/>
|
||||
<path d="M10.3153 22.5254L9.71533 23.2254L12.1153 24.7254L12.2153 24.6254L10.3153 22.5254V22.5254Z" fill="#818181"/>
|
||||
<path d="M9.21494 23.9258L8.81494 24.7258L11.4149 25.8258L11.5149 25.7258L9.21494 23.9258Z" fill="#818181"/>
|
||||
<path d="M8.31514 25.5254L8.01514 26.3254L10.7151 26.9254C10.7151 26.9254 10.7151 26.8254 10.8151 26.8254L8.31514 25.5254Z" fill="#818181"/>
|
||||
<path d="M7.81523 27.3242L7.61523 28.2242L10.4152 28.3242V28.2242L7.81523 27.3242Z" fill="#818181"/>
|
||||
<path d="M10.3151 29.4254L7.51514 29.0254V29.9254L10.3151 29.5254C10.3151 29.6254 10.3151 29.5254 10.3151 29.4254C10.3151 29.5254 10.3151 29.5254 10.3151 29.4254Z" fill="#818181"/>
|
||||
<path d="M7.61523 30.9258L7.81523 31.8258L10.5152 31.0258V30.9258H7.61523V30.9258Z" fill="#818181"/>
|
||||
<path d="M8.01514 32.725L8.31514 33.525L10.8151 32.225C10.8151 32.225 10.8151 32.125 10.7151 32.125L8.01514 32.725V32.725Z" fill="#818181"/>
|
||||
<path d="M8.71533 34.3242L9.11533 35.1242L11.3153 33.4242L11.2153 33.3242L8.71533 34.3242V34.3242Z" fill="#818181"/>
|
||||
<path d="M9.71533 35.9258L10.3153 36.6258L12.2153 34.5258L12.1153 34.4258L9.71533 35.9258Z" fill="#818181"/>
|
||||
<path d="M10.915 37.2242L11.615 37.8242L13.115 35.4242L13.015 35.3242L10.915 37.2242Z" fill="#818181"/>
|
||||
<path d="M12.415 38.3254L13.215 38.7254L14.315 36.1254L14.215 36.0254L12.415 38.3254V38.3254Z" fill="#818181"/>
|
||||
<path d="M14.0151 39.125L14.8151 39.425L15.4151 36.725C15.4151 36.725 15.3151 36.725 15.3151 36.625L14.0151 39.125V39.125Z" fill="#818181"/>
|
||||
<path d="M15.7153 39.725L16.6153 39.925L16.7153 37.125H16.6153L15.7153 39.725V39.725Z" fill="#818181"/>
|
||||
<path d="M17.9151 37.125L17.5151 39.925H18.4151L18.0151 37.125C18.0151 37.125 18.0151 37.125 17.9151 37.125Z" fill="#818181"/>
|
||||
<path d="M19.3149 39.8258L20.2149 39.6258L19.4149 36.9258H19.3149V39.8258V39.8258Z" fill="#818181"/>
|
||||
<path d="M21.1151 39.425L21.9151 39.125L20.6151 36.625C20.6151 36.625 20.5151 36.625 20.5151 36.725L21.1151 39.425V39.425Z" fill="#818181"/>
|
||||
<path d="M22.8153 38.725L23.6153 38.325L21.8153 36.125L21.7153 36.225L22.8153 38.725Z" fill="#818181"/>
|
||||
<path d="M24.3149 37.8242L25.0149 37.2242L22.9149 35.3242L22.8149 35.4242L24.3149 37.8242V37.8242Z" fill="#818181"/>
|
||||
<path d="M25.6153 36.5258L26.2153 35.8258L23.8153 34.4258L23.7153 34.5258L25.6153 36.5258Z" fill="#818181"/>
|
||||
<path d="M26.715 35.1246L27.115 34.3246L24.515 33.2246L24.415 33.3246L26.715 35.1246V35.1246Z" fill="#818181"/>
|
||||
<path d="M27.6152 33.525L27.9152 32.725L25.2152 32.125C25.2152 32.125 25.2152 32.225 25.1152 32.225L27.6152 33.525Z" fill="#818181"/>
|
||||
<path d="M28.1151 31.8242L28.3151 30.9242L25.5151 30.8242V30.9242L28.1151 31.8242Z" fill="#818181"/>
|
||||
<path d="M25.6152 29.625L28.4152 30.025V29.125L25.6152 29.525C25.6152 29.525 25.6152 29.525 25.6152 29.625C25.6152 29.625 25.6152 29.525 25.6152 29.625Z" fill="#818181"/>
|
||||
<path d="M28.315 28.1246L28.115 27.2246L25.415 28.0246V28.1246H28.315V28.1246Z" fill="#818181"/>
|
||||
<path d="M27.9152 26.425L27.6152 25.625L25.1152 26.825C25.1152 26.825 25.1152 26.925 25.2152 26.925L27.9152 26.425Z" fill="#818181"/>
|
||||
<path d="M27.2152 24.7258L26.8152 23.9258L24.6152 25.6258L24.7152 25.7258L27.2152 24.7258V24.7258Z" fill="#818181"/>
|
||||
<path d="M26.2153 23.2254L25.6153 22.5254L23.7153 24.6254L23.8153 24.7254L26.2153 23.2254V23.2254Z" fill="#818181"/>
|
||||
<path d="M25.0149 21.8246L24.3149 21.2246L22.8149 23.6246L22.9149 23.7246L25.0149 21.8246V21.8246Z" fill="#818181"/>
|
||||
<path d="M23.5153 20.7242L22.8153 20.3242L21.7153 22.9242L21.8153 23.0242L23.5153 20.7242V20.7242Z" fill="#818181"/>
|
||||
<path d="M21.9151 19.925L21.1151 19.625L20.5151 22.325C20.5151 22.325 20.6151 22.325 20.6151 22.425L21.9151 19.925Z" fill="#818181"/>
|
||||
<path d="M20.2153 19.325L19.3153 19.125L19.2153 21.925H19.3153L20.2153 19.325Z" fill="#818181"/>
|
||||
<path d="M14.0151 51.0254H22.3151L21.7151 53.8254H14.8151L14.0151 51.0254V51.0254Z" fill="#ACACAC"/>
|
||||
<path d="M16.8149 53.8242H19.1149L18.9149 54.7242H17.0149L16.8149 53.8242V53.8242Z" fill="#D0D0D0"/>
|
||||
<path d="M-0.285156 45.9258H7.61484V53.3258H3.61484L-0.285156 51.4258V45.9258V45.9258Z" fill="#BBBBBB"/>
|
||||
<path d="M36.2149 45.9258H28.3149V53.3258H32.2149L36.1149 51.4258L36.2149 45.9258Z" fill="#BBBBBB"/>
|
||||
<path d="M3.81494 45.9258H32.0149V51.4258H3.81494V45.9258V45.9258Z" fill="#CFCFCF"/>
|
||||
<path d="M3.81494 47.3242H32.0149V51.5242H3.81494V47.3242V47.3242Z" fill="#DDDDDD"/>
|
||||
<path d="M22.8151 8.22539C22.8151 8.62539 20.6151 8.92539 17.9151 8.92539C15.2151 8.92539 13.0151 8.62539 13.0151 8.22539C13.0151 7.82539 15.2151 7.52539 17.9151 7.52539C20.6151 7.52539 22.8151 7.82539 22.8151 8.22539Z" fill="#8C8C8C"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.2529 0.125C14.6529 0.125 14.2529 0.525 14.2529 1.125V7.025C14.2529 7.325 14.2529 7.925 14.2529 8.025C14.2529 8.325 15.9529 8.525 17.9529 8.525C19.9529 8.525 21.6529 8.325 21.6529 8.025C21.6529 7.925 21.6529 7.325 21.6529 7.025V1.125C21.6529 0.525 21.2529 0.125 20.6529 0.125H15.2529V0.125Z" fill="#C0C0C0"/>
|
||||
<path d="M15.7773 2.52539C15.7773 1.92539 16.1773 1.52539 16.7773 1.52539H19.2773C19.8773 1.52539 20.2773 1.92539 20.2773 2.52539V5.82539C20.2773 6.42539 19.8773 6.82539 19.2773 6.82539H16.7773C16.1773 6.82539 15.7773 6.42539 15.7773 5.82539V2.52539V2.52539Z" fill="#D2D2D2"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_207_1489">
|
||||
<rect width="36" height="55" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.6 KiB |
|
@ -1,4 +1,3 @@
|
|||
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs><style>.cls-1{fill:none;}.cls-2{fill:#2b3436;}</style></defs><title>Slice 41</title>
|
||||
<path fill="#2b3436" d="M13.74,5.85,10.15,2.26A.85.85,0,0,0,9.53,2H2.89A.89.89,0,0,0,2,2.89V13.11a.89.89,0,0,0,.89.89H13.11a.89.89,0,0,0,.89-.89V6.47A.85.85,0,0,0,13.74,5.85Zm-8.85-3H7.56V4.44H4.89V2.89Zm6.22,10.22H4.89v-2h6.22Zm2,0H12V10.67a.45.45,0,0,0-.44-.45H4.44a.45.45,0,0,0-.44.45v2.44H2.89V2.89H4v2a.44.44,0,0,0,.44.44H8a.43.43,0,0,0,.44-.44v-2H9.53l3.58,3.58v6.64Z"/>
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.7398 5.84619L10.1538 2.26016C9.98676 2.09311 9.76084 2 9.52533 2H2.88864C2.39708 2 2 2.39845 2 2.88864V13.1114C2 13.6029 2.39845 14 2.88864 14H13.1114C13.6029 14 14 13.6016 14 13.1114V6.47467C14 6.23916 13.9055 6.01324 13.7398 5.84619ZM4.88909 2.88864H7.55637V4.44409H4.88909V2.88864ZM11.1109 13.1114H4.88909V11.1109H11.1109V13.1114ZM13.1114 13.1114H12.0009V10.6673C12.0009 10.4222 11.8024 10.2223 11.5559 10.2223H4.44409C4.19899 10.2223 3.99909 10.4208 3.99909 10.6673V13.1114H2.88864V2.88864H3.99909V4.88909C3.99909 5.13419 4.19763 5.33409 4.44409 5.33409H8C8.24509 5.33409 8.445 5.13555 8.445 4.88909V2.88864H9.52533L13.1114 6.47467V13.1114Z" fill="#262E30"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 578 B After Width: | Height: | Size: 779 B |
|
@ -1,6 +1,11 @@
|
|||
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs><style>.cls-1,.cls-2{fill:none;}.cls-2{stroke:#2b3436;}</style></defs>
|
||||
<title>Slice 41</title>
|
||||
<circle fill="none" stroke="#2b3436" cx="5.97" cy="5.93" r="5"/>
|
||||
<line fill="none" stroke="#2b3436" x1="10.3" y1="10.34" x2="15.03" y2="15.07"/>
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_2225_21739)">
|
||||
<circle cx="6.5" cy="6.5" r="5" stroke="#262E30"/>
|
||||
<line x1="10.8272" y1="10.9101" x2="15.564" y2="15.647" stroke="#262E30"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_2225_21739">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 377 B |
|
@ -1,9 +1,9 @@
|
|||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_0_3)">
|
||||
<path d="M18 0H0V18H18V0Z" fill="#262E30"/>
|
||||
<g clip-path="url(#clip0_1_12)">
|
||||
<path d="M18 0H0V18H18V0Z" fill="#262E2F"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_0_3">
|
||||
<clipPath id="clip0_1_12">
|
||||
<rect width="18" height="18" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
|
|
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 283 B |
|
@ -185,13 +185,13 @@ void AppConfig::set_defaults()
|
|||
|
||||
#ifdef SUPPORT_DARK_MODE
|
||||
if (get("dark_color_mode").empty())
|
||||
set_bool("dark_color_mode", false);
|
||||
set("dark_color_mode", "0");
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_SYS_MENU
|
||||
//#ifdef SUPPORT_SYS_MENU
|
||||
if (get("sys_menu_enabled").empty())
|
||||
set_bool("sys_menu_enabled", true);
|
||||
#endif
|
||||
set("sys_menu_enabled", "1");
|
||||
//#endif
|
||||
#endif // _WIN32
|
||||
|
||||
// BBS
|
||||
|
|
|
@ -17,6 +17,9 @@ using namespace nlohmann;
|
|||
#define ENV_PRE_HOST "2"
|
||||
#define ENV_PRODUCT_HOST "3"
|
||||
|
||||
#define SUPPORT_DARK_MODE
|
||||
//#define _MSW_DARK_MODE
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
|
|
@ -405,6 +405,16 @@ set(SLIC3R_GUI_SOURCES
|
|||
Utils/NetworkAgent.hpp
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND SLIC3R_GUI_SOURCES
|
||||
GUI/dark_mode/dark_mode.hpp
|
||||
GUI/dark_mode/IatHook.hpp
|
||||
GUI/dark_mode/UAHMenuBar.hpp
|
||||
GUI/dark_mode.hpp
|
||||
GUI/dark_mode.cpp
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
list(APPEND SLIC3R_GUI_SOURCES
|
||||
Utils/RetinaHelperImpl.mm
|
||||
|
|
|
@ -15,6 +15,7 @@ AMSMaterialsSetting::AMSMaterialsSetting(wxWindow *parent, wxWindowID id)
|
|||
: DPIDialog(parent, id, _L("AMS Materials Setting"), wxDefaultPosition, wxDefaultSize, wxBORDER_NONE)
|
||||
{
|
||||
create();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void AMSMaterialsSetting::create()
|
||||
|
@ -63,12 +64,13 @@ void AMSMaterialsSetting::create()
|
|||
m_clrData->SetChooseFull(true);
|
||||
m_clrData->SetChooseAlpha(false);
|
||||
|
||||
m_clr_picker = new Button(this, "", "");
|
||||
m_clr_picker = new wxButton(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,wxBU_AUTODRAW);
|
||||
m_clr_picker->SetCanFocus(false);
|
||||
m_clr_picker->SetSize(FromDIP(50), FromDIP(25));
|
||||
m_clr_picker->SetMinSize(wxSize(FromDIP(50), FromDIP(25)));
|
||||
m_clr_picker->SetCornerRadius(FromDIP(6));
|
||||
m_clr_picker->SetBorderColor(wxColour(172, 172, 172));
|
||||
//m_clr_picker->SetCornerRadius(FromDIP(6));
|
||||
//m_clr_picker->SetBorderColor(wxColour(172, 172, 172));
|
||||
m_clr_picker->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
m_clr_picker->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_clr_picker, this);
|
||||
m_sizer_colour->Add(m_clr_picker, 0, 0, 0);
|
||||
|
||||
|
@ -197,7 +199,7 @@ void AMSMaterialsSetting::create()
|
|||
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
|
||||
m_button_confirm->SetBackgroundColor(m_btn_bg_green);
|
||||
m_button_confirm->SetBorderColor(wxColour(0, 174, 66));
|
||||
m_button_confirm->SetTextColor(AMS_MATERIALS_SETTING_GREY200);
|
||||
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);
|
||||
|
@ -234,15 +236,15 @@ void AMSMaterialsSetting::create()
|
|||
Layout();
|
||||
Fit();
|
||||
|
||||
Bind(wxEVT_PAINT, &AMSMaterialsSetting::paintEvent, this);
|
||||
COMBOBOX_FILAMENT->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(AMSMaterialsSetting::on_select_filament), NULL, this);
|
||||
Bind(wxEVT_PAINT, &AMSMaterialsSetting::paintEvent, this);
|
||||
COMBOBOX_FILAMENT->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(AMSMaterialsSetting::on_select_filament), NULL, this);
|
||||
}
|
||||
|
||||
void AMSMaterialsSetting::paintEvent(wxPaintEvent &evt)
|
||||
{
|
||||
auto size = GetSize();
|
||||
wxPaintDC dc(this);
|
||||
dc.SetPen(wxPen(wxColour(38, 46, 48), 1, wxSOLID));
|
||||
dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour(38, 46, 48)), 1, wxSOLID));
|
||||
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
|
||||
dc.DrawRectangle(0, 0, size.x, size.y);
|
||||
}
|
||||
|
@ -363,7 +365,7 @@ void AMSMaterialsSetting::on_clr_picker(wxCommandEvent & event)
|
|||
show_flag = true;
|
||||
if (clr_dialog->ShowModal() == wxID_OK) {
|
||||
m_clrData = &(clr_dialog->GetColourData());
|
||||
m_clr_picker->SetBackgroundColor(m_clrData->GetColour());
|
||||
m_clr_picker->SetBackgroundColour(m_clrData->GetColour());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -379,7 +381,7 @@ bool AMSMaterialsSetting::Show(bool show)
|
|||
|
||||
void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_min, wxString temp_max)
|
||||
{
|
||||
m_clr_picker->SetBackgroundColor(m_clrData->GetColour());
|
||||
m_clr_picker->SetBackgroundColour(m_clrData->GetColour());
|
||||
|
||||
if (!m_is_third) {
|
||||
m_button_confirm->Hide();
|
||||
|
|
|
@ -83,7 +83,7 @@ protected:
|
|||
Button * m_button_confirm;
|
||||
wxStaticText* m_tip_readonly;
|
||||
Button * m_button_close;
|
||||
Button * m_clr_picker;
|
||||
wxButton * m_clr_picker;
|
||||
wxColourData * m_clrData;
|
||||
#ifdef __APPLE__
|
||||
wxComboBox *m_comboBox_filament_mac;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "AMSSetting.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "I18N.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
@ -7,6 +8,7 @@ AMSSetting::AMSSetting(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
: DPIDialog(parent, id, wxEmptyString, pos, size, style)
|
||||
{
|
||||
create();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
AMSSetting::~AMSSetting() {}
|
||||
|
||||
|
@ -14,13 +16,16 @@ void AMSSetting::create()
|
|||
{
|
||||
wxBoxSizer *m_sizer_main;
|
||||
m_sizer_main = new wxBoxSizer(wxVERTICAL);
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
auto m_static_ams_settings = new wxStaticText(this, wxID_ANY, _L("AMS Settings"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_static_ams_settings->SetFont(::Label::Head_14);
|
||||
m_static_ams_settings->SetForegroundColour(AMS_SETTING_GREY800);
|
||||
m_sizer_main->Add(0,0,0,wxTOP,FromDIP(10));
|
||||
m_sizer_main->Add(m_static_ams_settings, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(24));
|
||||
|
||||
m_panel_body = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL);
|
||||
m_panel_body->SetBackgroundColour(*wxWHITE);
|
||||
wxBoxSizer *m_sizerl_body;
|
||||
m_sizerl_body = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
@ -188,6 +193,7 @@ void AMSSetting::create()
|
|||
m_sizer_main->Fit(this);
|
||||
|
||||
this->Centre(wxBOTH);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void AMSSetting::update_insert_material_read_mode(bool selected)
|
||||
|
|
|
@ -214,9 +214,7 @@ AboutDialog::AboutDialog()
|
|||
wxDefaultSize, /*wxCAPTION*/wxDEFAULT_DIALOG_STYLE)
|
||||
{
|
||||
SetFont(wxGetApp().normal_font());
|
||||
|
||||
wxColour bgr_clr = wxGetApp().get_window_default_clr();//wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||
SetBackgroundColour(bgr_clr);
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
|
||||
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
|
||||
|
@ -259,8 +257,8 @@ AboutDialog::AboutDialog()
|
|||
#endif
|
||||
version_font.SetPointSize(FromDIP(16));
|
||||
version->SetFont(version_font);
|
||||
version->SetForegroundColour(wxColour(255, 255, 255));
|
||||
version->SetBackgroundColour(wxColour(0, 174, 66));
|
||||
version->SetForegroundColour(wxColour("#FFFFFE"));
|
||||
version->SetBackgroundColour(wxColour("#00AF42"));
|
||||
vesizer->Add(version, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, FromDIP(5));
|
||||
vesizer->Add(0, 0, 1, wxEXPAND, FromDIP(5));
|
||||
}
|
||||
|
@ -282,6 +280,7 @@ AboutDialog::AboutDialog()
|
|||
{
|
||||
auto staticText = new wxStaticText( this, wxID_ANY, wxEmptyString,wxDefaultPosition,wxSize(FromDIP(520), -1), wxALIGN_LEFT );
|
||||
staticText->SetForegroundColour(wxColour(107, 107, 107));
|
||||
staticText->SetBackgroundColour(*wxWHITE);
|
||||
staticText->SetMinSize(wxSize(FromDIP(520), -1));
|
||||
staticText->SetFont(Label::Body_12);
|
||||
if (is_zh) {
|
||||
|
@ -366,6 +365,7 @@ AboutDialog::AboutDialog()
|
|||
ver_sizer->Add( 0, 0, 0, wxTOP, FromDIP(30));
|
||||
button_portions->Bind(wxEVT_BUTTON, &AboutDialog::onCopyrightBtn, this);
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
SetSizer(main_sizer);
|
||||
Layout();
|
||||
Fit();
|
||||
|
@ -393,7 +393,6 @@ void AboutDialog::on_dpi_changed(const wxRect &suggested_rect)
|
|||
|
||||
SetMinSize(size);
|
||||
Fit();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ wxDEFINE_EVENT(EVT_SET_FINISH_MAPPING, wxCommandEvent);
|
|||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
Bind(wxEVT_PAINT, &MaterialItem::paintEvent, this);
|
||||
wxGetApp().UpdateDarkUI(this);
|
||||
}
|
||||
|
||||
MaterialItem::~MaterialItem() {}
|
||||
|
@ -482,7 +483,7 @@ void AmsMapingPopup::paintEvent(wxPaintEvent &evt)
|
|||
#ifdef __WINDOWS__
|
||||
SetDoubleBuffered(true);
|
||||
#endif //__WINDOWS__
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
Bind(wxEVT_PAINT, &MappingItem::paintEvent, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ AuFile::AuFile(wxWindow *parent, fs::path file_path, wxString file_name, Auxilia
|
|||
|
||||
wxSize panel_size = m_type == MODEL_PICTURE ? AUFILE_PICTURES_PANEL_SIZE : AUFILE_PANEL_SIZE;
|
||||
wxPanel::Create(parent, id, pos, panel_size, style);
|
||||
SetBackgroundColour(AUFILE_GREY300);
|
||||
SetBackgroundColour(StateColor::darkModeColorFor(AUFILE_GREY300));
|
||||
wxBoxSizer *sizer_body = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
SetSize(panel_size);
|
||||
|
@ -102,12 +102,14 @@ AuFile::AuFile(wxWindow *parent, fs::path file_path, wxString file_name, Auxilia
|
|||
|
||||
|
||||
auto m_text_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(panel_size.x, AUFILE_TEXT_HEIGHT), wxTAB_TRAVERSAL);
|
||||
m_text_panel->SetBackgroundColour(AUFILE_GREY300);
|
||||
m_text_panel->SetBackgroundColour(StateColor::darkModeColorFor(AUFILE_GREY300));
|
||||
|
||||
|
||||
wxBoxSizer *m_text_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_text_name = new wxStaticText(m_text_panel, wxID_ANY, m_file_name, wxDefaultPosition, wxSize(panel_size.x, -1), wxST_ELLIPSIZE_END);
|
||||
m_text_name->Wrap(panel_size.x - FromDIP(10));
|
||||
m_text_name->SetFont(::Label::Body_14);
|
||||
m_text_name->SetForegroundColour(StateColor::darkModeColorFor(*wxBLACK));
|
||||
|
||||
m_input_name = new ::TextInput(m_text_panel, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxSize(panel_size.x - FromDIP(28), FromDIP(32)), wxTE_PROCESS_ENTER);
|
||||
m_input_name->GetTextCtrl()->SetFont(::Label::Body_13);
|
||||
|
@ -205,7 +207,7 @@ void AuFile::PaintBackground(wxDC &dc)
|
|||
{
|
||||
auto pen_width = FromDIP(2);
|
||||
dc.SetPen(wxPen(AUFILE_GREY500, pen_width));
|
||||
dc.SetBrush(AUFILE_GREY200);
|
||||
dc.SetBrush(StateColor::darkModeColorFor(AUFILE_GREY200));
|
||||
dc.DrawRoundedRectangle(pen_width / 2, pen_width / 2, size.x - pen_width / 2, size.y - pen_width / 2, AUFILE_ROUNDING);
|
||||
|
||||
auto line_length = FromDIP(50);
|
||||
|
@ -238,7 +240,7 @@ void AuFile::PaintForeground(wxDC &dc)
|
|||
if (m_type == AddFileButton) {
|
||||
auto pen_width = FromDIP(2);
|
||||
dc.SetPen(wxPen(AUFILE_BRAND, pen_width));
|
||||
dc.SetBrush(AUFILE_BRAND_TRANSPARENT);
|
||||
dc.SetBrush(StateColor::darkModeColorFor(AUFILE_BRAND_TRANSPARENT));
|
||||
dc.DrawRoundedRectangle(pen_width / 2, pen_width / 2, size.x - pen_width / 2, size.y - pen_width / 2, AUFILE_ROUNDING);
|
||||
|
||||
auto line_length = FromDIP(50);
|
||||
|
@ -818,7 +820,7 @@ void AuxiliaryPanel::init_tabpanel()
|
|||
wxBoxSizer *sizer_side_tools = new wxBoxSizer(wxVERTICAL);
|
||||
sizer_side_tools->Add(m_side_tools, 1, wxEXPAND, 0);
|
||||
m_tabpanel = new Tabbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, sizer_side_tools, wxNB_LEFT | wxTAB_TRAVERSAL | wxNB_NOPAGETHEME);
|
||||
m_tabpanel->SetBackgroundColour(*wxWHITE);
|
||||
m_tabpanel->SetBackgroundColour(wxColour("#FEFFFF"));
|
||||
m_tabpanel->Bind(wxEVT_BOOKCTRL_PAGE_CHANGED, [this](wxBookCtrlEvent &e) { ; });
|
||||
|
||||
m_designer_panel = new DesignerPanel(m_tabpanel, AuxiliaryFolderType::DESIGNER);
|
||||
|
|
|
@ -42,10 +42,12 @@ BBLStatusBarSend::BBLStatusBarSend(wxWindow *parent, int id)
|
|||
|
||||
m_sizer_bottom->Add(m_prog, 1, wxALIGN_CENTER, 0);
|
||||
|
||||
StateColor btn_bd_white(std::pair<wxColour, int>(*wxWHITE, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
|
||||
|
||||
m_cancelbutton = new Button(m_self, _L("Cancel"));
|
||||
m_cancelbutton->SetMinSize(wxSize(m_self->FromDIP(64), m_self->FromDIP(24)));
|
||||
m_cancelbutton->SetTextColor(wxColour(107, 107, 107));
|
||||
m_cancelbutton->SetBackgroundColor(wxColour(255, 255, 255));
|
||||
m_cancelbutton->SetBorderColor(btn_bd_white);
|
||||
m_cancelbutton->SetCornerRadius(m_self->FromDIP(12));
|
||||
m_cancelbutton->Bind(wxEVT_BUTTON,
|
||||
[this](wxCommandEvent &evt) {
|
||||
|
|
|
@ -139,7 +139,7 @@ void BedShapeDialog::build_dialog(const ConfigOptionPoints& default_pt, const Co
|
|||
main_sizer->Add(m_panel, 1, wxEXPAND);
|
||||
main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALIGN_CENTER_HORIZONTAL | wxBOTTOM, 10);
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this, true);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
|
||||
SetSizer(main_sizer);
|
||||
SetMinSize(GetSize());
|
||||
|
@ -200,7 +200,7 @@ void BedShapePanel::build_panel(const ConfigOptionPoints& default_pt, const Conf
|
|||
Line line{ "", "" };
|
||||
line.full_width = 1;
|
||||
line.widget = [this](wxWindow* parent) {
|
||||
wxButton* shape_btn = new wxButton(parent, wxID_ANY, _L("Load shape from STL..."));
|
||||
Button* shape_btn = new Button(parent, _L("Load shape from STL..."));
|
||||
wxSizer* shape_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
shape_sizer->Add(shape_btn, 1, wxEXPAND);
|
||||
|
||||
|
@ -269,7 +269,7 @@ void BedShapePanel::activate_options_page(ConfigOptionsGroupShp options_group)
|
|||
wxPanel* BedShapePanel::init_texture_panel()
|
||||
{
|
||||
wxPanel* panel = new wxPanel(this);
|
||||
wxGetApp().UpdateDarkUI(panel, true);
|
||||
panel->SetBackgroundColour(*wxWHITE);
|
||||
ConfigOptionsGroupShp optgroup = std::make_shared<ConfigOptionsGroup>(panel, _L("Texture"));
|
||||
|
||||
optgroup->label_width = 10;
|
||||
|
@ -280,7 +280,17 @@ wxPanel* BedShapePanel::init_texture_panel()
|
|||
Line line{ "", "" };
|
||||
line.full_width = 1;
|
||||
line.widget = [this](wxWindow* parent) {
|
||||
wxButton* load_btn = new wxButton(parent, wxID_ANY, _L("Load..."));
|
||||
|
||||
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
|
||||
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
|
||||
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
|
||||
|
||||
StateColor btn_bd_white(std::pair<wxColour, int>(*wxWHITE, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
|
||||
|
||||
Button* load_btn = new Button(parent, _L("Load..."));
|
||||
load_btn->SetBackgroundColor(btn_bg_white);
|
||||
load_btn->SetBorderColor(btn_bd_white);
|
||||
load_btn->SetBackgroundColour(*wxWHITE);
|
||||
wxSizer* load_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
load_sizer->Add(load_btn, 1, wxEXPAND);
|
||||
|
||||
|
@ -289,10 +299,16 @@ wxPanel* BedShapePanel::init_texture_panel()
|
|||
wxSizer* filename_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
filename_sizer->Add(filename_lbl, 1, wxEXPAND);
|
||||
|
||||
wxButton* remove_btn = new wxButton(parent, wxID_ANY, _L("Remove"));
|
||||
Button* remove_btn = new Button(parent, _L("Remove"));
|
||||
remove_btn->SetBackgroundColor(btn_bg_white);
|
||||
remove_btn->SetBorderColor(btn_bd_white);
|
||||
remove_btn->SetBackgroundColour(*wxWHITE);
|
||||
wxSizer* remove_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
remove_sizer->Add(remove_btn, 1, wxEXPAND);
|
||||
|
||||
wxGetApp().UpdateDarkUI(load_btn);
|
||||
wxGetApp().UpdateDarkUI(remove_btn);
|
||||
|
||||
wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
|
||||
sizer->Add(filename_sizer, 1, wxEXPAND);
|
||||
sizer->Add(load_sizer, 1, wxEXPAND);
|
||||
|
@ -340,7 +356,7 @@ wxPanel* BedShapePanel::init_texture_panel()
|
|||
wxPanel* BedShapePanel::init_model_panel()
|
||||
{
|
||||
wxPanel* panel = new wxPanel(this);
|
||||
wxGetApp().UpdateDarkUI(panel, true);
|
||||
panel->SetBackgroundColour(*wxWHITE);
|
||||
ConfigOptionsGroupShp optgroup = std::make_shared<ConfigOptionsGroup>(panel, _L("Model"));
|
||||
|
||||
optgroup->label_width = 10;
|
||||
|
@ -348,10 +364,21 @@ wxPanel* BedShapePanel::init_model_panel()
|
|||
update_shape();
|
||||
};
|
||||
|
||||
|
||||
Line line{ "", "" };
|
||||
line.full_width = 1;
|
||||
line.widget = [this](wxWindow* parent) {
|
||||
wxButton* load_btn = new wxButton(parent, wxID_ANY, _L("Load..."));
|
||||
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
|
||||
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Hovered),
|
||||
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
|
||||
|
||||
StateColor btn_bd_white(std::pair<wxColour, int>(*wxWHITE, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
|
||||
|
||||
|
||||
Button* load_btn = new Button(parent, _L("Load..."));
|
||||
load_btn->SetBackgroundColor(btn_bg_white);
|
||||
load_btn->SetBorderColor(btn_bd_white);
|
||||
load_btn->SetBackgroundColour(*wxWHITE);
|
||||
wxSizer* load_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
load_sizer->Add(load_btn, 1, wxEXPAND);
|
||||
|
||||
|
@ -359,10 +386,16 @@ wxPanel* BedShapePanel::init_model_panel()
|
|||
wxSizer* filename_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
filename_sizer->Add(filename_lbl, 1, wxEXPAND);
|
||||
|
||||
wxButton* remove_btn = new wxButton(parent, wxID_ANY, _L("Remove"));
|
||||
Button* remove_btn = new Button(parent, _L("Remove"));
|
||||
remove_btn->SetBackgroundColor(btn_bg_white);
|
||||
remove_btn->SetBorderColor(btn_bd_white);
|
||||
remove_btn->SetBackgroundColour(*wxWHITE);
|
||||
wxSizer* remove_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
remove_sizer->Add(remove_btn, 1, wxEXPAND);
|
||||
|
||||
wxGetApp().UpdateDarkUI(load_btn);
|
||||
wxGetApp().UpdateDarkUI(remove_btn);
|
||||
|
||||
wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
|
||||
sizer->Add(filename_sizer, 1, wxEXPAND);
|
||||
sizer->Add(load_sizer, 1, wxEXPAND);
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace GUI {
|
|||
wxBoxSizer *m_sizere_left_v= new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
auto m_printer_img = new wxStaticBitmap(m_panel_left, wxID_ANY, create_scaled_bitmap("printer_thumbnail", nullptr, 96), wxDefaultPosition, wxSize(FromDIP(100), FromDIP(96)), 0);
|
||||
m_printer_img->SetBackgroundColour(BIND_DIALOG_GREY200);
|
||||
m_printer_name = new wxStaticText(m_panel_left, wxID_ANY, wxEmptyString);
|
||||
m_printer_name->SetBackgroundColour(BIND_DIALOG_GREY200);
|
||||
m_printer_name->SetFont(::Label::Head_14);
|
||||
|
@ -133,7 +134,7 @@ namespace GUI {
|
|||
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
|
||||
m_button_bind->SetBackgroundColor(btn_bg_green);
|
||||
m_button_bind->SetBorderColor(wxColour(0, 174, 66));
|
||||
m_button_bind->SetTextColor(*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));
|
||||
|
@ -182,6 +183,8 @@ namespace GUI {
|
|||
this->Connect(EVT_BIND_MACHINE_SUCCESS, wxCommandEventHandler(BindMachineDialog::on_bind_success), NULL, this);
|
||||
this->Connect(EVT_BIND_UPDATE_MESSAGE, wxCommandEventHandler(BindMachineDialog::on_update_message), NULL, this);
|
||||
m_simplebook->SetSelection(1);
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
BindMachineDialog::~BindMachineDialog()
|
||||
|
@ -299,8 +302,8 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
|
|||
wxBoxSizer *m_sizere_left_h = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *m_sizere_left_v= new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
auto m_printer_img = new wxStaticBitmap(m_panel_left, wxID_ANY, create_scaled_bitmap("printer_thumbnail", nullptr, 96), wxDefaultPosition, wxSize(FromDIP(100), FromDIP(96)),
|
||||
0);
|
||||
auto m_printer_img = new wxStaticBitmap(m_panel_left, wxID_ANY, create_scaled_bitmap("printer_thumbnail", nullptr, 96), wxDefaultPosition, wxSize(FromDIP(100), FromDIP(96)),0);
|
||||
m_printer_img->SetBackgroundColour(BIND_DIALOG_GREY200);
|
||||
m_printer_name = new wxStaticText(m_panel_left, wxID_ANY, wxEmptyString);
|
||||
m_printer_name->SetFont(::Label::Head_14);
|
||||
m_printer_name->SetBackgroundColour(BIND_DIALOG_GREY200);
|
||||
|
@ -392,7 +395,7 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
|
|||
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
|
||||
m_button_unbind->SetBackgroundColor(btn_bg_green);
|
||||
m_button_unbind->SetBorderColor(wxColour(0, 174, 66));
|
||||
m_button_unbind->SetTextColor(*wxWHITE);
|
||||
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));
|
||||
|
@ -426,6 +429,7 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
|
|||
Bind(wxEVT_SHOW, &UnBindMachineDialog::on_show, this);
|
||||
m_button_unbind->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(UnBindMachineDialog::on_unbind_printer), NULL, this);
|
||||
m_button_cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(UnBindMachineDialog::on_cancel), NULL, this);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
UnBindMachineDialog::~UnBindMachineDialog()
|
||||
|
|
|
@ -326,6 +326,9 @@ wxBitmap* BitmapCache::load_svg(const std::string &bitmap_name, unsigned target_
|
|||
replaces["\"#262E30\""] = "\"#EFEFF0\"";
|
||||
replaces["\"#323A3D\""] = "\"#B3B3B5\"";
|
||||
replaces["\"#808080\""] = "\"#818183\"";
|
||||
//replaces["\"#ACACAC\""] = "\"#54545A\"";
|
||||
replaces["\"#CECECE\""] = "\"#54545B\"";
|
||||
replaces["\"#6B6B6B\""] = "\"#818182\"";
|
||||
}
|
||||
//if (!new_color.empty())
|
||||
// replaces["\"#ED6B21\""] = "\"" + new_color + "\"";
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
#include <wx/listbook.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef __WINDOWS__
|
||||
#include <wx/msw/dcclient.h>
|
||||
#include <wx/msw/private.h>
|
||||
#ifdef _MSW_DARK_MODE
|
||||
#include <wx/msw/dark_mode.h>
|
||||
#include "dark_mode.hpp"
|
||||
#endif //_MSW_DARK_MODE
|
||||
#endif
|
||||
#endif //__WINDOWS__
|
||||
|
||||
#include "libslic3r/libslic3r.h"
|
||||
#include "libslic3r/PrintConfig.hpp"
|
||||
|
@ -254,11 +254,11 @@ void BitmapComboBox::DrawBackground_(wxDC& dc, const wxRect& rect, int WXUNUSED(
|
|||
dc.SetTextForeground(flags & ODCB_PAINTING_DISABLED ? wxColour(108,108,108) : wxGetApp().get_label_clr_default());
|
||||
|
||||
wxColour selCol = flags & ODCB_PAINTING_DISABLED ?
|
||||
#ifdef _MSW_DARK_MODE
|
||||
wxRGBToColour(NppDarkMode::GetSofterBackgroundColor()) :
|
||||
#else
|
||||
//#ifdef _MSW_DARK_MODE
|
||||
//wxRGBToColour(NppDarkMode::GetSofterBackgroundColor()) :
|
||||
//#else
|
||||
wxGetApp().get_highlight_default_clr() :
|
||||
#endif
|
||||
//#endif
|
||||
wxGetApp().get_window_default_clr();
|
||||
dc.SetPen(selCol);
|
||||
dc.SetBrush(selCol);
|
||||
|
|
|
@ -147,7 +147,7 @@ CalibrationDialog::CalibrationDialog(Plater *plater)
|
|||
m_calibration_btn = new Button(cali_right_panel, _L("Start Calibration"));
|
||||
m_calibration_btn->SetBackgroundColor(btn_bg_green);
|
||||
m_calibration_btn->SetBorderColor(btn_bd_green);
|
||||
m_calibration_btn->SetTextColor(*wxWHITE);
|
||||
m_calibration_btn->SetTextColor(wxColour("#FFFFFE"));
|
||||
m_calibration_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
|
||||
m_calibration_btn->SetMinSize(wxSize(FromDIP(128), FromDIP(26)));
|
||||
|
||||
|
@ -174,6 +174,7 @@ CalibrationDialog::CalibrationDialog(Plater *plater)
|
|||
Fit();
|
||||
|
||||
m_calibration_btn->Bind(wxEVT_LEFT_DOWN, &CalibrationDialog::on_start_calibration, this);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
CalibrationDialog::~CalibrationDialog() {}
|
||||
|
|
|
@ -345,9 +345,14 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
|||
if (titles.size() > 1 || is_variants) {
|
||||
// It only makes sense to add the All / None buttons if there's multiple printers
|
||||
// All Standard button is added when there are more variants for at least one printer
|
||||
auto *sel_all_std = new wxButton(this, wxID_ANY, titles.size() > 1 ? _L("All standard") : _L("Standard"));
|
||||
auto *sel_all = new wxButton(this, wxID_ANY, _L("All"));
|
||||
auto *sel_none = new wxButton(this, wxID_ANY, _L("None"));
|
||||
auto *sel_all_std = new Button(this, titles.size() > 1 ? _L("All standard") : _L("Standard"));
|
||||
auto *sel_all = new Button(this, _L("All"));
|
||||
auto *sel_none = new Button(this, _L("None"));
|
||||
|
||||
wxGetApp().UpdateDarkUI(sel_all_std);
|
||||
wxGetApp().UpdateDarkUI(sel_all);
|
||||
wxGetApp().UpdateDarkUI(sel_none);
|
||||
|
||||
if (is_variants)
|
||||
sel_all_std->Bind(wxEVT_BUTTON, [this](const wxCommandEvent& event) { this->select_all(true, false); });
|
||||
sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &event) { this->select_all(true, true); });
|
||||
|
@ -450,13 +455,12 @@ ConfigWizardPage::ConfigWizardPage(ConfigWizard *parent, wxString title, wxStrin
|
|||
, shortname(std::move(shortname))
|
||||
, indent(indent)
|
||||
{
|
||||
wxGetApp().UpdateDarkUI(this);
|
||||
|
||||
auto *sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
auto *text = new wxStaticText(this, wxID_ANY, std::move(title), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
const auto font = GetFont().MakeBold().Scaled(1.5);
|
||||
text->SetFont(font);
|
||||
text->SetForegroundColour(*wxBLACK);
|
||||
sizer->Add(text, 0, wxALIGN_LEFT, 0);
|
||||
sizer->AddSpacer(10);
|
||||
|
||||
|
@ -474,6 +478,8 @@ ConfigWizardPage::ConfigWizardPage(ConfigWizard *parent, wxString title, wxStrin
|
|||
this->Layout();
|
||||
event.Skip();
|
||||
});
|
||||
|
||||
wxGetApp().UpdateDarkUI(this);
|
||||
}
|
||||
|
||||
ConfigWizardPage::~ConfigWizardPage() {}
|
||||
|
@ -640,6 +646,7 @@ PageMaterials::PageMaterials(ConfigWizard *parent, Materials *materials, wxStrin
|
|||
, list_vendor(new StringList(this))
|
||||
, list_profile(new PresetList(this))
|
||||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
append_spacer(VERTICAL_SPACING);
|
||||
|
||||
const int em = parent->em_unit();
|
||||
|
@ -651,8 +658,6 @@ PageMaterials::PageMaterials(ConfigWizard *parent, Materials *materials, wxStrin
|
|||
list_vendor->SetMinSize(wxSize(13*em, list_h));
|
||||
list_profile->SetMinSize(wxSize(23*em, list_h));
|
||||
|
||||
|
||||
|
||||
grid = new wxFlexGridSizer(4, em/2, em);
|
||||
grid->AddGrowableCol(3, 1);
|
||||
grid->AddGrowableRow(1, 1);
|
||||
|
@ -668,8 +673,13 @@ PageMaterials::PageMaterials(ConfigWizard *parent, Materials *materials, wxStrin
|
|||
grid->Add(list_profile, 1, wxEXPAND);
|
||||
|
||||
auto *btn_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto *sel_all = new wxButton(this, wxID_ANY, _L("All"));
|
||||
auto *sel_none = new wxButton(this, wxID_ANY, _L("None"));
|
||||
auto *sel_all = new Button(this, _L("All"));
|
||||
auto *sel_none = new Button(this, _L("None"));
|
||||
|
||||
wxGetApp().UpdateDarkUI(sel_all);
|
||||
wxGetApp().UpdateDarkUI(sel_none);
|
||||
|
||||
|
||||
btn_sizer->Add(sel_all, 0, wxRIGHT, em / 2);
|
||||
btn_sizer->Add(sel_none);
|
||||
|
||||
|
@ -678,6 +688,7 @@ PageMaterials::PageMaterials(ConfigWizard *parent, Materials *materials, wxStrin
|
|||
wxGetApp().UpdateDarkUI(list_vendor);
|
||||
wxGetApp().UpdateDarkUI(sel_all);
|
||||
wxGetApp().UpdateDarkUI(sel_none);
|
||||
wxGetApp().UpdateDarkUI(list_profile);
|
||||
|
||||
grid->Add(new wxBoxSizer(wxHORIZONTAL));
|
||||
grid->Add(new wxBoxSizer(wxHORIZONTAL));
|
||||
|
@ -756,16 +767,16 @@ void PageMaterials::reload_presets()
|
|||
|
||||
void PageMaterials::set_compatible_printers_html_window(const std::vector<std::string>& printer_names, bool all_printers)
|
||||
{
|
||||
const auto bgr_clr =
|
||||
#if defined(__APPLE__)
|
||||
html_window->GetParent()->GetBackgroundColour();
|
||||
#else
|
||||
#if defined(_WIN32)
|
||||
wxGetApp().get_window_default_clr();
|
||||
#else
|
||||
wxSystemSettings::GetColour(wxSYS_COLOUR_MENU);
|
||||
#endif
|
||||
#endif
|
||||
const auto bgr_clr = html_window->GetParent()->GetBackgroundColour();
|
||||
//#if defined(__APPLE__)
|
||||
// html_window->GetParent()->GetBackgroundColour();
|
||||
//#else
|
||||
//#if defined(_WIN32)
|
||||
// html_window->GetParent()->GetBackgroundColour();
|
||||
//#else
|
||||
// wxSystemSettings::GetColour(wxSYS_COLOUR_MENU);
|
||||
//#endif
|
||||
//#endif
|
||||
const auto bgr_clr_str = wxString::Format(wxT("#%02X%02X%02X"), bgr_clr.Red(), bgr_clr.Green(), bgr_clr.Blue());
|
||||
const auto text_clr = wxGetApp().get_label_clr_default();//wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||
const auto text_clr_str = wxString::Format(wxT("#%02X%02X%02X"), text_clr.Red(), text_clr.Green(), text_clr.Blue());
|
||||
|
@ -1049,7 +1060,7 @@ void PageMaterials::update_lists(int sel_type, int sel_vendor, int last_selected
|
|||
|
||||
sel_vendor_prev = sel_vendor;
|
||||
}
|
||||
wxGetApp().UpdateDarkUI(list_profile);
|
||||
//wxGetApp().UpdateDarkUI(list_profile);
|
||||
}
|
||||
|
||||
void PageMaterials::sort_list_data(StringList* list, bool add_All_item, bool material_type_ordering)
|
||||
|
@ -1219,6 +1230,7 @@ PageCustom::PageCustom(ConfigWizard *parent)
|
|||
append(cb_custom);
|
||||
append(label);
|
||||
append(tc_profile_name);
|
||||
wxGetApp().UpdateDarkUI(this);
|
||||
}
|
||||
|
||||
PageFirmware::PageFirmware(ConfigWizard *parent)
|
||||
|
@ -2640,7 +2652,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
|||
, p(new priv(this))
|
||||
{
|
||||
this->SetFont(wxGetApp().normal_font());
|
||||
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
p->load_vendors();
|
||||
//BBS: add bed exclude areas
|
||||
p->custom_config.reset(DynamicPrintConfig::new_from_defaults_keys({
|
||||
|
@ -2661,14 +2673,19 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
|||
p->hscroll_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
p->hscroll->SetSizer(p->hscroll_sizer);
|
||||
|
||||
wxGetApp().UpdateDarkUI(p->hscroll);
|
||||
|
||||
topsizer->Add(p->index, 0, wxEXPAND);
|
||||
topsizer->AddSpacer(INDEX_MARGIN);
|
||||
topsizer->Add(p->hscroll, 1, wxEXPAND);
|
||||
|
||||
p->btn_prev = new wxButton(this, wxID_ANY, _L("< &Back"));
|
||||
p->btn_next = new wxButton(this, wxID_ANY, _L("&Next >"));
|
||||
p->btn_finish = new wxButton(this, wxID_APPLY, _L("&Finish"));
|
||||
p->btn_cancel = new wxButton(this, wxID_CANCEL, _L("Cancel")); // Note: The label needs to be present, otherwise we get accelerator bugs on Mac
|
||||
p->btn_prev = new Button(this, _L("<Back"));
|
||||
p->btn_next = new Button(this, _L("Next>"));
|
||||
p->btn_finish = new Button(this,_L("Finish"));
|
||||
p->btn_finish->SetId(wxID_APPLY);
|
||||
p->btn_cancel = new Button(this, _L("Cancel")); // Note: The label needs to be present, otherwise we get accelerator bugs on Mac
|
||||
p->btn_cancel->SetId(wxID_CANCEL);
|
||||
|
||||
p->btnsizer->AddStretchSpacer();
|
||||
p->btnsizer->Add(p->btn_prev, 0, wxLEFT, BTN_SPACING);
|
||||
p->btnsizer->Add(p->btn_next, 0, wxLEFT, BTN_SPACING);
|
||||
|
@ -2747,6 +2764,8 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
|||
this->Bind(wxEVT_SHOW, [this, vsizer](const wxShowEvent& e) {
|
||||
;
|
||||
});
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
ConfigWizard::~ConfigWizard() {}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "BedShapeDialog.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
#include "Widgets/Button.hpp"
|
||||
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
@ -549,10 +550,10 @@ struct ConfigWizard::priv
|
|||
ConfigWizardPage *page_current = nullptr;
|
||||
ConfigWizardIndex *index = nullptr;
|
||||
//wxButton *btn_sel_all = nullptr;
|
||||
wxButton *btn_prev = nullptr;
|
||||
wxButton *btn_next = nullptr;
|
||||
wxButton *btn_finish = nullptr;
|
||||
wxButton *btn_cancel = nullptr;
|
||||
Button *btn_prev = nullptr;
|
||||
Button *btn_next = nullptr;
|
||||
Button *btn_finish = nullptr;
|
||||
Button *btn_cancel = nullptr;
|
||||
|
||||
//PagePrinters *page_fff = nullptr;
|
||||
//PagePrinters *page_msla = nullptr;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "ConnectPrinter.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include <slic3r/GUI/I18N.hpp>
|
||||
#include <slic3r/GUI/Widgets/Label.hpp>
|
||||
#include "libslic3r/AppConfig.hpp"
|
||||
|
@ -8,7 +9,7 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons
|
|||
: DPIDialog(parent, id, _L("ConnectPrinter(LAN)"), pos, size, style)
|
||||
{
|
||||
init_bitmap();
|
||||
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
this->SetSizeHints(wxDefaultSize, wxDefaultSize);
|
||||
|
||||
wxBoxSizer *main_sizer;
|
||||
|
@ -50,6 +51,7 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons
|
|||
m_button_confirm->SetFont(Label::Body_12);
|
||||
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(27, 136, 68), StateColor::Pressed),
|
||||
|
@ -101,6 +103,7 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons
|
|||
|
||||
m_textCtrl_code->Bind(wxEVT_TEXT, &ConnectPrinterDialog::on_input_enter, this);
|
||||
m_button_confirm->Bind(wxEVT_BUTTON, &ConnectPrinterDialog::on_button_confirm, this);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
ConnectPrinterDialog::~ConnectPrinterDialog() {}
|
||||
|
|
|
@ -114,6 +114,7 @@ DownloadProgressDialog::DownloadProgressDialog(wxString title)
|
|||
CentreOnParent();
|
||||
|
||||
Bind(wxEVT_CLOSE_WINDOW, &DownloadProgressDialog::on_close, this);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
wxString DownloadProgressDialog::format_text(wxStaticText* st, wxString str, int warp)
|
||||
|
|
|
@ -98,9 +98,13 @@
|
|||
#ifdef __WXMSW__
|
||||
#include <dbt.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef _MSW_DARK_MODE
|
||||
#include <wx/msw/dark_mode.h>
|
||||
#include "dark_mode.hpp"
|
||||
#endif // _MSW_DARK_MODE
|
||||
#endif // __WINDOWS__
|
||||
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#include <boost/dll/runtime_symbol_info.hpp>
|
||||
|
@ -2089,16 +2093,39 @@ bool GUI_App::on_init_inner()
|
|||
|
||||
// If load_language() fails, the application closes.
|
||||
load_language(wxString(), true);
|
||||
#ifdef SUPPORT_DARK_MODE
|
||||
#ifdef _MSW_DARK_MODE
|
||||
NppDarkMode::InitDarkMode(app_config->get("dark_color_mode") == "1", app_config->get("sys_menu_enabled") == "1");
|
||||
#endif
|
||||
bool init_dark_color_mode = app_config->get("dark_color_mode") == "1";
|
||||
bool init_sys_menu_enabled = app_config->get("sys_menu_enabled") == "1";
|
||||
#ifdef __WINDOWS__
|
||||
NppDarkMode::InitDarkMode(init_dark_color_mode, init_sys_menu_enabled);
|
||||
#endif // __WINDOWS__
|
||||
|
||||
#endif
|
||||
|
||||
// initialize label colors and fonts
|
||||
init_label_colours();
|
||||
init_fonts();
|
||||
|
||||
|
||||
#ifdef _MSW_DARK_MODE
|
||||
// app_config can be updated in check_older_app_config(), so check if dark_color_mode and sys_menu_enabled was changed
|
||||
if (bool new_dark_color_mode = app_config->get("dark_color_mode") == "1";
|
||||
init_dark_color_mode != new_dark_color_mode) {
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
NppDarkMode::SetDarkMode(new_dark_color_mode);
|
||||
#endif // __WINDOWS__
|
||||
|
||||
init_label_colours();
|
||||
//update_label_colours_from_appconfig();
|
||||
}
|
||||
if (bool new_sys_menu_enabled = app_config->get("sys_menu_enabled") == "1";
|
||||
init_sys_menu_enabled != new_sys_menu_enabled)
|
||||
#ifdef __WINDOWS__
|
||||
NppDarkMode::SetSystemMenuForApp(new_sys_menu_enabled);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (m_last_config_version) {
|
||||
int last_major = m_last_config_version->maj();
|
||||
int last_minor = m_last_config_version->min();
|
||||
|
@ -2639,7 +2666,17 @@ void GUI_App::init_label_colours()
|
|||
|
||||
void GUI_App::update_label_colours_from_appconfig()
|
||||
{
|
||||
;
|
||||
if (app_config->has("label_clr_sys")) {
|
||||
auto str = app_config->get("label_clr_sys");
|
||||
if (str != "")
|
||||
m_color_label_sys = wxColour(str);
|
||||
}
|
||||
|
||||
if (app_config->has("label_clr_modified")) {
|
||||
auto str = app_config->get("label_clr_modified");
|
||||
if (str != "")
|
||||
m_color_label_modified = wxColour(str);
|
||||
}
|
||||
}
|
||||
|
||||
void GUI_App::update_label_colours()
|
||||
|
@ -2655,81 +2692,79 @@ void GUI_App::UpdateDarkUI(wxWindow* window, bool highlited/* = false*/, bool ju
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if (wxButton* btn = dynamic_cast<wxButton*>(window)) {
|
||||
if (!(btn->GetWindowStyle() & wxNO_BORDER)) {
|
||||
btn->SetWindowStyle(btn->GetWindowStyle() | wxNO_BORDER);
|
||||
highlited = true;
|
||||
}
|
||||
// hovering for buttons
|
||||
{
|
||||
auto focus_button = [this, btn](const bool focus) {
|
||||
btn->SetForegroundColour(focus ? m_color_hovered_btn_label : m_color_label_default);
|
||||
btn->Refresh();
|
||||
btn->Update();
|
||||
};
|
||||
if (Button* btn = dynamic_cast<Button*>(window)) {
|
||||
if (btn->GetWindowStyleFlag() & wxBU_AUTODRAW)
|
||||
return;
|
||||
}
|
||||
|
||||
btn->Bind(wxEVT_ENTER_WINDOW, [focus_button](wxMouseEvent& event) { focus_button(true); event.Skip(); });
|
||||
btn->Bind(wxEVT_LEAVE_WINDOW, [focus_button](wxMouseEvent& event) { focus_button(false); event.Skip(); });
|
||||
if (m_is_dark_mode != dark_mode())
|
||||
m_is_dark_mode = dark_mode();
|
||||
|
||||
if (m_is_dark_mode) {
|
||||
auto original_col = window->GetBackgroundColour();
|
||||
auto bg_col = StateColor::darkModeColorFor(original_col);
|
||||
|
||||
if (bg_col != original_col) {
|
||||
window->SetBackgroundColour(bg_col);
|
||||
}
|
||||
|
||||
original_col = window->GetForegroundColour();
|
||||
auto fg_col = StateColor::darkModeColorFor(original_col);
|
||||
|
||||
if (fg_col != original_col) {
|
||||
window->SetForegroundColour(fg_col);
|
||||
}
|
||||
}
|
||||
else if (wxTextCtrl* text = dynamic_cast<wxTextCtrl*>(window)) {
|
||||
if (text->GetBorder() != wxBORDER_SIMPLE)
|
||||
text->SetWindowStyle(text->GetWindowStyle() | wxBORDER_SIMPLE);
|
||||
}
|
||||
else if (wxCheckListBox* list = dynamic_cast<wxCheckListBox*>(window)) {
|
||||
list->SetWindowStyle(list->GetWindowStyle() | wxBORDER_SIMPLE);
|
||||
list->SetBackgroundColour(highlited ? m_color_highlight_default : m_color_window_default);
|
||||
for (size_t i = 0; i < list->GetCount(); i++)
|
||||
if (wxOwnerDrawn* item = list->GetItem(i)) {
|
||||
item->SetBackgroundColour(highlited ? m_color_highlight_default : m_color_window_default);
|
||||
item->SetTextColour(m_color_label_default);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (dynamic_cast<wxListBox*>(window))
|
||||
window->SetWindowStyle(window->GetWindowStyle() | wxBORDER_SIMPLE);
|
||||
else {
|
||||
auto original_col = window->GetBackgroundColour();
|
||||
auto bg_col = StateColor::lightModeColorFor(original_col);
|
||||
|
||||
if (!just_font)
|
||||
window->SetBackgroundColour(highlited ? m_color_highlight_default : m_color_window_default);
|
||||
window->SetForegroundColour(m_color_label_default);
|
||||
#endif
|
||||
if (bg_col != original_col) {
|
||||
window->SetBackgroundColour(bg_col);
|
||||
}
|
||||
|
||||
original_col = window->GetForegroundColour();
|
||||
auto fg_col = StateColor::lightModeColorFor(original_col);
|
||||
|
||||
if (fg_col != original_col) {
|
||||
window->SetForegroundColour(fg_col);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// recursive function for scaling fonts for all controls in Window
|
||||
#ifdef _WIN32
|
||||
static void update_dark_children_ui(wxWindow* window, bool just_buttons_update = false)
|
||||
{
|
||||
bool is_btn = dynamic_cast<wxButton*>(window) != nullptr;
|
||||
if (!(just_buttons_update && !is_btn))
|
||||
wxGetApp().UpdateDarkUI(window, is_btn);
|
||||
/*bool is_btn = dynamic_cast<wxButton*>(window) != nullptr;
|
||||
is_btn = false;*/
|
||||
wxGetApp().UpdateDarkUI(window);
|
||||
|
||||
auto children = window->GetChildren();
|
||||
for (auto child : children) {
|
||||
update_dark_children_ui(child);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Note: Don't use this function for Dialog contains ScalableButtons
|
||||
void GUI_App::UpdateDlgDarkUI(wxDialog* dlg, bool just_buttons_update/* = false*/)
|
||||
void GUI_App::UpdateDarkUIWin(wxWindow* win)
|
||||
{
|
||||
//BBS disable DarkUI mode
|
||||
return;
|
||||
update_dark_children_ui(win);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
update_dark_children_ui(dlg, just_buttons_update);
|
||||
void GUI_App::UpdateDlgDarkUI(wxDialog* dlg)
|
||||
{
|
||||
#ifdef __WINDOWS__
|
||||
NppDarkMode::SetDarkExplorerTheme(dlg->GetHWND());
|
||||
NppDarkMode::SetDarkTitleBar(dlg->GetHWND());
|
||||
#endif
|
||||
update_dark_children_ui(dlg);
|
||||
}
|
||||
void GUI_App::UpdateDVCDarkUI(wxDataViewCtrl* dvc, bool highlited/* = false*/)
|
||||
{
|
||||
//BBS disable DarkUI mode
|
||||
return;
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef __WINDOWS__
|
||||
UpdateDarkUI(dvc, highlited ? dark_mode() : false);
|
||||
#ifdef _MSW_DARK_MODE
|
||||
dvc->RefreshHeaderDarkMode(&m_normal_font);
|
||||
//dvc->RefreshHeaderDarkMode(&m_normal_font);
|
||||
#endif //_MSW_DARK_MODE
|
||||
if (dvc->HasFlag(wxDV_ROW_LINES))
|
||||
dvc->SetAlternateRowColour(m_color_highlight_default);
|
||||
|
@ -2740,10 +2775,7 @@ void GUI_App::UpdateDVCDarkUI(wxDataViewCtrl* dvc, bool highlited/* = false*/)
|
|||
|
||||
void GUI_App::UpdateAllStaticTextDarkUI(wxWindow* parent)
|
||||
{
|
||||
//BBS disable DarkUI mode
|
||||
return;
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef __WINDOWS__
|
||||
wxGetApp().UpdateDarkUI(parent);
|
||||
|
||||
auto children = parent->GetChildren();
|
||||
|
@ -3027,8 +3059,7 @@ void fatal_error(wxWindow* parent)
|
|||
// exit 1; // #ys_FIXME
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef _MSW_DARK_MODE
|
||||
static void update_scrolls(wxWindow* window)
|
||||
{
|
||||
|
@ -3054,35 +3085,46 @@ void GUI_App::force_menu_update()
|
|||
NppDarkMode::SetSystemMenuForApp(app_config->get("sys_menu_enabled") == "1");
|
||||
}
|
||||
#endif //_MSW_DARK_MODE
|
||||
#endif //__WINDOWS__
|
||||
|
||||
void GUI_App::force_colors_update()
|
||||
{
|
||||
#ifdef _MSW_DARK_MODE
|
||||
#ifdef __WINDOWS__
|
||||
NppDarkMode::SetDarkMode(app_config->get("dark_color_mode") == "1");
|
||||
if (WXHWND wxHWND = wxToolTip::GetToolTipCtrl())
|
||||
NppDarkMode::SetDarkExplorerTheme((HWND)wxHWND);
|
||||
NppDarkMode::SetDarkTitleBar(mainframe->GetHWND());
|
||||
|
||||
|
||||
//NppDarkMode::SetDarkExplorerTheme((HWND)mainframe->m_settings_dialog.GetHWND());
|
||||
//NppDarkMode::SetDarkTitleBar(mainframe->m_settings_dialog.GetHWND());
|
||||
//mainframe->m_settings_dialog.Refresh();
|
||||
//mainframe->m_settings_dialog.Update();
|
||||
|
||||
#endif // __WINDOWS__
|
||||
#endif //_MSW_DARK_MODE
|
||||
m_force_colors_update = true;
|
||||
}
|
||||
#endif //_WIN32
|
||||
|
||||
// Called after the Preferences dialog is closed and the program settings are saved.
|
||||
// Update the UI based on the current preferences.
|
||||
void GUI_App::update_ui_from_settings()
|
||||
{
|
||||
update_label_colours();
|
||||
#ifdef _WIN32
|
||||
// Upadte UI colors before Update UI from settings
|
||||
if (m_force_colors_update) {
|
||||
m_force_colors_update = false;
|
||||
//UpdateDlgDarkUI(&mainframe->m_settings_dialog);
|
||||
//mainframe->m_settings_dialog.Refresh();
|
||||
//mainframe->m_settings_dialog.Update();
|
||||
#ifdef __WINDOWS__
|
||||
mainframe->force_color_changed();
|
||||
mainframe->diff_dialog.force_color_changed();
|
||||
#ifdef _MSW_DARK_MODE
|
||||
update_scrolls(mainframe);
|
||||
update_scrolls(&mainframe->m_settings_dialog);
|
||||
#endif //_MSW_DARK_MODE
|
||||
update_dark_children_ui(mainframe);
|
||||
}
|
||||
#endif
|
||||
mainframe->update_ui_from_settings();
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,11 @@
|
|||
#define TIMEOUT_CONNECT 15
|
||||
#define TIMEOUT_RESPONSE 15
|
||||
|
||||
#define BE_UNACTED_ON 0x00200001
|
||||
#ifndef _MSW_DARK_MODE
|
||||
#define _MSW_DARK_MODE 1
|
||||
#endif // _MSW_DARK_MODE
|
||||
|
||||
class wxMenuItem;
|
||||
class wxMenuBar;
|
||||
class wxTopLevelWindow;
|
||||
|
@ -220,14 +225,15 @@ private:
|
|||
bool m_opengl_initialized{ false };
|
||||
#endif
|
||||
|
||||
|
||||
//#ifdef _WIN32
|
||||
wxColour m_color_label_modified;
|
||||
wxColour m_color_label_sys;
|
||||
wxColour m_color_label_default;
|
||||
wxColour m_color_window_default;
|
||||
// BBS
|
||||
//#ifdef _WIN32
|
||||
wxColour m_color_highlight_label_default;
|
||||
wxColour m_color_hovered_btn_label;
|
||||
wxColour m_color_default_btn_label;
|
||||
wxColour m_color_highlight_default;
|
||||
wxColour m_color_selected_btn_bg;
|
||||
bool m_force_colors_update { false };
|
||||
|
@ -274,7 +280,7 @@ private:
|
|||
|
||||
boost::thread m_sync_update_thread;
|
||||
bool enable_sync = false;
|
||||
|
||||
bool m_is_dark_mode{ false };
|
||||
bool m_adding_script_handler { false };
|
||||
public:
|
||||
std::string get_local_models_path();
|
||||
|
@ -317,8 +323,9 @@ public:
|
|||
void update_label_colours();
|
||||
// update color mode for window
|
||||
void UpdateDarkUI(wxWindow *window, bool highlited = false, bool just_font = false);
|
||||
void UpdateDarkUIWin(wxWindow* win);
|
||||
// update color mode for whole dialog including all children
|
||||
void UpdateDlgDarkUI(wxDialog* dlg, bool just_buttons_update = false);
|
||||
void UpdateDlgDarkUI(wxDialog* dlg);
|
||||
// update color mode for DataViewControl
|
||||
void UpdateDVCDarkUI(wxDataViewCtrl* dvc, bool highlited = false);
|
||||
// update color mode for panel including all static texts controls
|
||||
|
|
|
@ -2674,7 +2674,7 @@ ObjectTablePanel::ObjectTablePanel( wxWindow* parent, wxWindowID id, const wxPoi
|
|||
{
|
||||
//m_bg_colour = wxColour(0xfa, 0xfa, 0xfa);
|
||||
m_float_validator.SetRange(0, 100);
|
||||
m_bg_colour = wxColour(0xff, 0xff, 0xff);
|
||||
m_bg_colour = wxColour("#FFFFFF");
|
||||
//m_hover_colour = wxColour(61, 70, 72);
|
||||
SetBackgroundColour(m_bg_colour);
|
||||
|
||||
|
@ -2854,8 +2854,8 @@ void ObjectTablePanel::load_data()
|
|||
m_object_grid->SetColLabelValue(ObjectGridTable::col_speed_perimeter, _L("Outer wall speed"));
|
||||
m_object_grid->SetColLabelValue(ObjectGridTable::col_speed_perimeter_reset, "");
|
||||
m_object_grid->SetLabelFont(Label::Head_13);
|
||||
m_object_grid->SetLabelTextColour(wxColour(0x30,0x3a,0x3c));
|
||||
m_object_grid->SetLabelBackgroundColour(wxColour(0xff, 0xff, 0xff));
|
||||
m_object_grid->SetLabelTextColour(StateColor::darkModeColorFor(wxColour("#303A3C")));
|
||||
m_object_grid->SetLabelBackgroundColour( wxColour("#FFFFFF"));
|
||||
#else
|
||||
m_object_grid->HideColLabels();
|
||||
#endif
|
||||
|
@ -2866,7 +2866,6 @@ void ObjectTablePanel::load_data()
|
|||
m_object_grid->EnableDragGridSize(false);
|
||||
m_object_grid->EnableDragRowSize(false);
|
||||
|
||||
|
||||
/*set the first row as label*/
|
||||
//format
|
||||
wxGridCellAttr *attr;
|
||||
|
@ -2894,7 +2893,7 @@ void ObjectTablePanel::load_data()
|
|||
|
||||
//m_object_grid->SetSelectionForeground(wxColour(0xDB,0xFD,0xE7));
|
||||
//m_object_grid->SetSelectionBackground(*wxWHITE);
|
||||
|
||||
m_object_grid->SetDefaultCellBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
for (int col = 0; col < cols; col++)
|
||||
{
|
||||
ObjectGridTable::ObjectGridCol* grid_col = m_object_grid_table->get_grid_col(col);
|
||||
|
@ -2907,7 +2906,8 @@ void ObjectTablePanel::load_data()
|
|||
m_object_grid->SetCellAlignment(row, col, grid_col->horizontal_align, wxALIGN_CENTRE );
|
||||
m_object_grid->SetCellOverflow(row, col, false);
|
||||
//m_object_grid->SetCellBackgroundColour (row, col, *wxLIGHT_GREY);
|
||||
m_object_grid->SetCellBackgroundColour (row, col, *wxWHITE);
|
||||
m_object_grid->SetCellBackgroundColour (row, col, StateColor::darkModeColorFor(*wxWHITE));
|
||||
m_object_grid->SetCellTextColour(row, col,StateColor::darkModeColorFor(wxColour(*wxBLACK)));
|
||||
//set the render and editor
|
||||
if (grid_col->b_icon) {
|
||||
m_object_grid->SetCellRenderer(row, col, new GridCellIconRenderer());
|
||||
|
@ -3306,6 +3306,7 @@ ObjectTableDialog::ObjectTableDialog(wxWindow* parent, Plater* platerObj, Model
|
|||
SetSizer(m_main_sizer);
|
||||
Fit();
|
||||
Layout();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
ObjectTableDialog::~ObjectTableDialog()
|
||||
|
|
|
@ -259,12 +259,12 @@ bool check_dark_mode() {
|
|||
void update_dark_ui(wxWindow* window)
|
||||
{
|
||||
#ifdef SUPPORT_DARK_MODE
|
||||
bool is_dark = wxGetApp().app_config->get("dark_color_mode") == "1";// ? true : check_dark_mode();// #ysDarkMSW - Allow it when we deside to support the sustem colors for application
|
||||
bool is_dark = wxGetApp().app_config->get("dark_color_mode") == "1";
|
||||
#else
|
||||
bool is_dark = false;
|
||||
#endif
|
||||
window->SetBackgroundColour(is_dark ? wxColour(43, 43, 43) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||
window->SetForegroundColour(is_dark ? wxColour(250, 250, 250) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
||||
//window->SetBackgroundColour(is_dark ? wxColour(43, 43, 43) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||
//window->SetForegroundColour(is_dark ? wxColour(250, 250, 250) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -85,37 +85,38 @@ KBShortcutsDialog::KBShortcutsDialog()
|
|||
event.SetInt(0);
|
||||
event.SetEventObject(this);
|
||||
wxPostEvent(this, event);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void KBShortcutsDialog::OnSelectTabel(wxCommandEvent &event)
|
||||
{
|
||||
auto id = event.GetInt();
|
||||
auto id = event.GetInt();
|
||||
SelectHash::iterator i = m_hash_selector.begin();
|
||||
while (i != m_hash_selector.end()) {
|
||||
Select *sel = i->second;
|
||||
if (id == sel->m_index) {
|
||||
sel->m_tab_button->SetBackgroundColour(wxColour(255, 255, 255));
|
||||
sel->m_tab_text->SetBackgroundColour(wxColour(255, 255, 255));
|
||||
sel->m_tab_button->SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF")));
|
||||
sel->m_tab_text->SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF")));
|
||||
sel->m_tab_text->SetFont(::Label::Head_13);
|
||||
sel->m_tab_button->Refresh();
|
||||
sel->m_tab_text->Refresh();
|
||||
|
||||
m_simplebook->SetSelection(id);
|
||||
} else {
|
||||
sel->m_tab_button->SetBackgroundColour(wxColour(248, 248, 248));
|
||||
sel->m_tab_text->SetBackgroundColour(wxColour(248, 248, 248));
|
||||
sel->m_tab_button->SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#F8F8F8")));
|
||||
sel->m_tab_text->SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#F8F8F8")));
|
||||
sel->m_tab_text->SetFont(::Label::Body_13);
|
||||
sel->m_tab_button->Refresh();
|
||||
sel->m_tab_text->Refresh();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
wxWindow *KBShortcutsDialog::create_button(int id, wxString text)
|
||||
{
|
||||
auto tab_button = new wxWindow(m_panel_selects, wxID_ANY, wxDefaultPosition, wxSize( FromDIP(150), FromDIP(28)), wxTAB_TRAVERSAL);
|
||||
tab_button->SetBackgroundColour(wxColour(248, 248, 248));
|
||||
|
||||
wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
|
@ -302,7 +303,6 @@ void KBShortcutsDialog::fill_shortcuts()
|
|||
wxPanel* KBShortcutsDialog::create_page(wxWindow* parent, const ShortcutsItem& shortcuts, const wxFont& font, const wxFont& bold_font)
|
||||
{
|
||||
wxPanel* main_page = new wxPanel(parent);
|
||||
wxGetApp().UpdateDarkUI(main_page);
|
||||
wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
if (!shortcuts.first.second.empty()) {
|
||||
|
@ -327,11 +327,13 @@ wxPanel* KBShortcutsDialog::create_page(wxWindow* parent, const ShortcutsItem& s
|
|||
for (int i = 0; i < items_count; ++i) {
|
||||
const auto &[shortcut, description] = shortcuts.second[i];
|
||||
auto key = new wxStaticText(scrollable_panel, wxID_ANY, _(shortcut));
|
||||
key->SetForegroundColour(wxColour(50, 58, 61));
|
||||
key->SetFont(bold_font);
|
||||
grid_sizer->Add(key, 0, wxALIGN_CENTRE_VERTICAL);
|
||||
|
||||
auto desc = new wxStaticText(scrollable_panel, wxID_ANY, _(description));
|
||||
desc->SetFont(font);
|
||||
desc->SetForegroundColour(wxColour(50, 58, 61));
|
||||
desc->Wrap(FromDIP(600));
|
||||
grid_sizer->Add(desc, 0, wxALIGN_CENTRE_VERTICAL);
|
||||
}
|
||||
|
|
|
@ -554,6 +554,11 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
|||
}
|
||||
evt.Skip();
|
||||
});
|
||||
|
||||
#ifdef _MSW_DARK_MODE
|
||||
wxGetApp().UpdateDarkUIWin(this);
|
||||
#endif // _MSW_DARK_MODE
|
||||
|
||||
}
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
@ -1635,26 +1640,23 @@ void MainFrame::update_side_button_style()
|
|||
m_slice_btn->SetCornerRadius(FromDIP(12));
|
||||
m_slice_btn->SetExtraSize(wxSize(FromDIP(38), FromDIP(10)));
|
||||
m_slice_btn->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
m_slice_btn->SetBottomColour(wxColour(0x3B4446));
|
||||
|
||||
m_slice_option_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Center);
|
||||
m_slice_option_btn->SetCornerRadius(FromDIP(12));
|
||||
m_slice_option_btn->SetExtraSize(wxSize(FromDIP(10), FromDIP(10)));
|
||||
m_slice_option_btn->SetIconOffset(FromDIP(2));
|
||||
m_slice_option_btn->SetMinSize(wxSize(FromDIP(24), FromDIP(24)));
|
||||
m_slice_option_btn->SetBottomColour(wxColour(0x3B4446));
|
||||
|
||||
m_print_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Left, FromDIP(15));
|
||||
m_print_btn->SetCornerRadius(FromDIP(12));
|
||||
m_print_btn->SetExtraSize(wxSize(FromDIP(38), FromDIP(10)));
|
||||
m_print_btn->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
m_print_btn->SetBottomColour(wxColour(0x3B4446));
|
||||
|
||||
m_print_option_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Center);
|
||||
m_print_option_btn->SetCornerRadius(FromDIP(12));
|
||||
m_print_option_btn->SetExtraSize(wxSize(FromDIP(10), FromDIP(10)));
|
||||
m_print_option_btn->SetIconOffset(FromDIP(2));
|
||||
m_print_option_btn->SetMinSize(wxSize(FromDIP(24), FromDIP(24)));
|
||||
m_print_option_btn->SetBottomColour(wxColour(0x3B4446));
|
||||
}
|
||||
|
||||
void MainFrame::update_slice_print_status(SlicePrintEventType event, bool can_slice, bool can_print)
|
||||
|
@ -1759,6 +1761,12 @@ void MainFrame::on_sys_color_changed()
|
|||
|
||||
// update label colors in respect to the system mode
|
||||
wxGetApp().init_label_colours();
|
||||
|
||||
#ifdef __APPLE__
|
||||
wxGetApp().force_colors_update();
|
||||
wxGetApp().update_ui_from_settings();
|
||||
#endif //__APPLE__
|
||||
|
||||
#ifdef __WXMSW__
|
||||
wxGetApp().UpdateDarkUI(m_tabpanel);
|
||||
// m_statusbar->update_dark_ui();
|
||||
|
@ -2756,12 +2764,12 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
|||
if (m_tabpanel->GetSelection() != (int)new_selection)
|
||||
m_tabpanel->SetSelection(new_selection);
|
||||
#ifdef _MSW_DARK_MODE
|
||||
if (wxGetApp().tabs_as_menu()) {
|
||||
/*if (wxGetApp().tabs_as_menu()) {
|
||||
if (Tab* cur_tab = dynamic_cast<Tab*>(m_tabpanel->GetPage(new_selection)))
|
||||
update_marker_for_tabs_menu((m_layout == ESettingsLayout::Old ? m_menubar : m_settings_dialog.menubar()), cur_tab->title(), m_layout == ESettingsLayout::Old);
|
||||
else if (tab == 0 && m_layout == ESettingsLayout::Old)
|
||||
m_plater->get_current_canvas3D()->render();
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
if (tab == MainFrame::tp3DEditor && m_layout == ESettingsLayout::Old)
|
||||
m_plater->canvas3D()->render();
|
||||
|
@ -3106,7 +3114,7 @@ std::string MainFrame::get_dir_name(const wxString &full_name) const
|
|||
// ----------------------------------------------------------------------------
|
||||
|
||||
SettingsDialog::SettingsDialog(MainFrame* mainframe)
|
||||
:DPIFrame(NULL, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _L("Settings"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, "settings_dialog"),
|
||||
:DPIDialog(NULL, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _L("Settings"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, "settings_dialog"),
|
||||
//: DPIDialog(mainframe, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _L("Settings"), wxDefaultPosition, wxDefaultSize,
|
||||
// wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX, "settings_dialog"),
|
||||
m_main_frame(mainframe)
|
||||
|
@ -3141,9 +3149,9 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe)
|
|||
#ifdef _MSW_DARK_MODE
|
||||
if (wxGetApp().tabs_as_menu()) {
|
||||
// menubar
|
||||
m_menubar = new wxMenuBar();
|
||||
add_tabs_as_menu(m_menubar, mainframe, this);
|
||||
this->SetMenuBar(m_menubar);
|
||||
//m_menubar = new wxMenuBar();
|
||||
//add_tabs_as_menu(m_menubar, mainframe, this);
|
||||
//this->SetMenuBar(m_menubar);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ struct PresetTab {
|
|||
// SettingsDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class SettingsDialog : public DPIFrame//DPIDialog
|
||||
class SettingsDialog : public DPIDialog//DPIDialog
|
||||
{
|
||||
//wxNotebook* m_tabpanel { nullptr };
|
||||
Notebook* m_tabpanel{ nullptr };
|
||||
|
|
|
@ -195,7 +195,7 @@ MonitorPanel::~MonitorPanel()
|
|||
sizer_side_tools->Add(m_connection_info, 0, wxEXPAND, 0);
|
||||
sizer_side_tools->Add(m_side_tools, 1, wxEXPAND, 0);
|
||||
m_tabpanel = new Tabbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, sizer_side_tools, wxNB_LEFT | wxTAB_TRAVERSAL | wxNB_NOPAGETHEME);
|
||||
m_tabpanel->SetBackgroundColour(*wxWHITE);
|
||||
m_tabpanel->SetBackgroundColour(wxColour("#FEFFFF"));
|
||||
m_tabpanel->Bind(wxEVT_BOOKCTRL_PAGE_CHANGED, [this](wxBookCtrlEvent& e) {
|
||||
;
|
||||
});
|
||||
|
|
|
@ -67,8 +67,8 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
|
|||
main_sizer->Add(btn_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND, BORDER);
|
||||
|
||||
apply_style(style);
|
||||
|
||||
SetSizerAndFit(main_sizer);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
MsgDialog::~MsgDialog()
|
||||
|
@ -164,7 +164,7 @@ Button* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, con
|
|||
);
|
||||
|
||||
StateColor btn_text_green(
|
||||
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
|
||||
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
|
||||
);
|
||||
|
||||
StateColor btn_bg_white(
|
||||
|
@ -239,6 +239,7 @@ void MsgDialog::finalize()
|
|||
static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxString msg, bool monospaced_font = false, bool is_marked_msg = false)
|
||||
{
|
||||
wxHtmlWindow* html = new wxHtmlWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
|
||||
html->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
|
||||
// count lines in the message
|
||||
int msg_lines = 0;
|
||||
|
@ -260,11 +261,7 @@ static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxStrin
|
|||
|
||||
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
wxFont monospace = wxGetApp().code_font();
|
||||
#if 1
|
||||
wxColour text_clr = wxGetApp().get_label_clr_default();
|
||||
#else
|
||||
wxColour text_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||
#endif
|
||||
wxColour bgr_clr = parent->GetBackgroundColour(); //wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||
auto text_clr_str = wxString::Format(wxT("#%02X%02X%02X"), text_clr.Red(), text_clr.Green(), text_clr.Blue());
|
||||
auto bgr_clr_str = wxString::Format(wxT("#%02X%02X%02X"), bgr_clr.Red(), bgr_clr.Green(), bgr_clr.Blue());
|
||||
|
@ -318,7 +315,7 @@ static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxStrin
|
|||
msg_escaped = std::string("<pre><code>") + msg_escaped + "</code></pre>";
|
||||
html->SetPage("<html><body bgcolor=\"" + bgr_clr_str + "\"><font color=\"" + text_clr_str + "\">" + wxString::FromUTF8(msg_escaped.data()) + "</font></body></html>");
|
||||
content_sizer->Add(html, 1, wxEXPAND);
|
||||
wxGetApp().UpdateDarkUI(html);
|
||||
wxGetApp().UpdateDarkUIWin(html);
|
||||
}
|
||||
|
||||
// ErrorDialog
|
||||
|
@ -362,6 +359,7 @@ MessageDialog::MessageDialog(wxWindow* parent,
|
|||
{
|
||||
add_msg_content(this, content_sizer, message);
|
||||
finalize();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ ButtonsListCtrl::ButtonsListCtrl(wxWindow *parent, wxBoxSizer* side_tools) :
|
|||
#ifdef __WINDOWS__
|
||||
SetDoubleBuffered(true);
|
||||
#endif //__WINDOWS__
|
||||
wxColour default_btn_bg("#3B4446"); // Gradient #414B4E
|
||||
wxColour default_btn_bg = wxColour("#3B4446"); // Gradient #414B4E
|
||||
SetBackgroundColour(default_btn_bg);
|
||||
|
||||
int em = em_unit(this);// Slic3r::GUI::wxGetApp().em_unit();
|
||||
|
@ -48,6 +48,9 @@ ButtonsListCtrl::ButtonsListCtrl(wxWindow *parent, wxBoxSizer* side_tools) :
|
|||
|
||||
// BBS: disable custom paint
|
||||
//this->Bind(wxEVT_PAINT, &ButtonsListCtrl::OnPaint, this);
|
||||
Bind(wxEVT_SYS_COLOUR_CHANGED, [this](auto& e){
|
||||
auto a = 10;
|
||||
});
|
||||
}
|
||||
|
||||
void ButtonsListCtrl::OnPaint(wxPaintEvent&)
|
||||
|
@ -139,8 +142,7 @@ void ButtonsListCtrl::SetSelection(int sel)
|
|||
std::pair{wxColour(59, 68, 70), (int) StateColor::Normal});
|
||||
m_pageButtons[m_selection]->SetBackgroundColor(bg_color);
|
||||
StateColor text_color = StateColor(
|
||||
std::pair{wxColour(255, 255, 255), (int) StateColor::Hovered},
|
||||
std::pair{wxColour(238,238, 238), (int) StateColor::Normal}
|
||||
std::pair{wxColour(254,254, 254), (int) StateColor::Normal}
|
||||
);
|
||||
m_pageButtons[m_selection]->SetSelected(false);
|
||||
m_pageButtons[m_selection]->SetTextColor(text_color);
|
||||
|
@ -153,8 +155,7 @@ void ButtonsListCtrl::SetSelection(int sel)
|
|||
m_pageButtons[m_selection]->SetBackgroundColor(bg_color);
|
||||
|
||||
StateColor text_color = StateColor(
|
||||
std::pair{wxColour(255, 255, 255), (int) StateColor::Hovered},
|
||||
std::pair{wxColour(255, 255, 255), (int) StateColor::Normal}
|
||||
std::pair{wxColour(254, 254, 254), (int) StateColor::Normal}
|
||||
);
|
||||
m_pageButtons[m_selection]->SetSelected(true);
|
||||
m_pageButtons[m_selection]->SetTextColor(text_color);
|
||||
|
@ -177,8 +178,7 @@ bool ButtonsListCtrl::InsertPage(size_t n, const wxString &text, bool bSelect /*
|
|||
|
||||
btn->SetBackgroundColor(bg_color);
|
||||
StateColor text_color = StateColor(
|
||||
std::pair{wxColour(255, 255, 255), (int) StateColor::Hovered},
|
||||
std::pair{wxColour(238,238, 238), (int) StateColor::Normal});
|
||||
std::pair{wxColour(254,254, 254), (int) StateColor::Normal});
|
||||
btn->SetTextColor(text_color);
|
||||
btn->SetInactiveIcon(inactive_bmp_name);
|
||||
btn->SetSelected(false);
|
||||
|
|
|
@ -55,6 +55,8 @@ ParamsDialog::ParamsDialog(wxWindow * parent)
|
|||
Hide();
|
||||
#endif
|
||||
});
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void ParamsDialog::Popup()
|
||||
|
|
|
@ -80,6 +80,8 @@ TipsDialog::TipsDialog(wxWindow *parent, const wxString &title, const wxString &
|
|||
Layout();
|
||||
Fit();
|
||||
Centre(wxBOTH);
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
wxBoxSizer *TipsDialog::create_item_checkbox(wxString title, wxWindow *parent, wxString tooltip, std::string param)
|
||||
|
|
|
@ -46,9 +46,6 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
|
|||
DPIDialog(parent, wxID_ANY, _L("Physical Printer"), wxDefaultPosition, wxSize(45 * wxGetApp().em_unit(), -1), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
{
|
||||
SetFont(wxGetApp().normal_font());
|
||||
#ifndef _WIN32
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||
#endif
|
||||
|
||||
// input the preset name
|
||||
Tab *tab = wxGetApp().get_tab(Preset::TYPE_PRINTER);
|
||||
|
@ -87,6 +84,7 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
|
|||
input_sizer->Add(m_input_area, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, BORDER_W);
|
||||
input_sizer->Add(m_valid_label, 0, wxEXPAND | wxLEFT | wxRIGHT, BORDER_W);
|
||||
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
||||
m_optgroup = new ConfigOptionsGroup(this, _L("Print Host upload"), m_config);
|
||||
|
@ -98,7 +96,7 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
|
|||
btnOK->Bind(wxEVT_BUTTON, &PhysicalPrinterDialog::OnOK, this);
|
||||
|
||||
wxGetApp().UpdateDarkUI(static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this)));
|
||||
|
||||
(static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this)))->Hide();
|
||||
|
||||
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
@ -110,6 +108,7 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
|
|||
SetSizer(topSizer);
|
||||
topSizer->SetSizeHints(this);
|
||||
this->CenterOnParent();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
PhysicalPrinterDialog::~PhysicalPrinterDialog()
|
||||
|
|
|
@ -536,6 +536,7 @@ Sidebar::Sidebar(Plater *parent)
|
|||
// Bed type selection
|
||||
wxBoxSizer* bed_type_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxStaticText* bed_type_title = new wxStaticText(p->m_panel_printer_content, wxID_ANY, _L("Bed type"));
|
||||
//bed_type_title->SetBackgroundColour();
|
||||
bed_type_title->Wrap(-1);
|
||||
bed_type_title->SetFont(Label::Body_14);
|
||||
m_bed_type_list = new ComboBox(p->m_panel_printer_content, wxID_ANY, wxString(""), wxDefaultPosition, {-1, FromDIP(24)}, 0, nullptr, wxCB_READONLY);
|
||||
|
@ -1433,7 +1434,7 @@ void Sidebar::collapse(bool collapse)
|
|||
#ifdef _MSW_DARK_MODE
|
||||
void Sidebar::show_mode_sizer(bool show)
|
||||
{
|
||||
p->mode_sizer->Show(show);
|
||||
//p->mode_sizer->Show(show);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -7755,7 +7756,7 @@ public:
|
|||
wxStaticText *m_fname_title;
|
||||
wxStaticText *m_fname_f;
|
||||
wxStaticText *m_fname_s;
|
||||
RoundedRectangle * m_panel_select;
|
||||
StaticBox * m_panel_select;
|
||||
Button * m_confirm;
|
||||
Button * m_cancel;
|
||||
|
||||
|
@ -7832,7 +7833,13 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
|
|||
|
||||
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, 5);
|
||||
|
||||
m_panel_select = new RoundedRectangle(this, wxColour(248, 248, 248), wxDefaultPosition, PROJECT_DROP_DIALOG_SELECT_PLANE_SIZE, 6);
|
||||
m_panel_select = new StaticBox(this, wxID_ANY, wxDefaultPosition, PROJECT_DROP_DIALOG_SELECT_PLANE_SIZE);
|
||||
StateColor box_colour(std::pair<wxColour, int>(wxColour("#F8F8F8"), StateColor::Normal));
|
||||
StateColor box_border_colour(std::pair<wxColour, int>(wxColour(*wxWHITE), StateColor::Normal));
|
||||
|
||||
m_panel_select->SetBackgroundColor(box_colour);
|
||||
m_panel_select->SetBorderColor(box_border_colour);
|
||||
m_panel_select->SetCornerRadius(5);
|
||||
|
||||
wxBoxSizer *m_sizer_select_h = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
|
@ -7875,7 +7882,7 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
|
|||
|
||||
m_confirm->SetBackgroundColor(btn_bg_green);
|
||||
m_confirm->SetBorderColor(wxColour(0, 174, 66));
|
||||
m_confirm->SetTextColor(wxColour(255, 255, 255));
|
||||
m_confirm->SetTextColor(wxColour("#FFFFFE"));
|
||||
m_confirm->SetSize(PROJECT_DROP_DIALOG_BUTTON_SIZE);
|
||||
m_confirm->SetMinSize(PROJECT_DROP_DIALOG_BUTTON_SIZE);
|
||||
m_confirm->SetCornerRadius(FromDIP(12));
|
||||
|
@ -7921,6 +7928,8 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
|
|||
|
||||
m_fname_f->SetLabel(fstring);
|
||||
m_fname_s->SetLabel(bstring);
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
wxBoxSizer *ProjectDropDialog ::create_item_radiobox(wxString title, wxWindow *parent, int select_id, int groupid)
|
||||
|
@ -10191,7 +10200,7 @@ void Plater::clone_selection()
|
|||
selection.clone(res);
|
||||
}
|
||||
|
||||
void Plater::search(bool plater_is_active, Preset::Type type, wxWindow *tag, wxTextCtrl *etag, wxWindow *stag)
|
||||
void Plater::search(bool plater_is_active, Preset::Type type, wxWindow *tag, TextInput *etag, wxWindow *stag)
|
||||
{
|
||||
if (plater_is_active) {
|
||||
if (is_preview_shown())
|
||||
|
|
|
@ -426,7 +426,7 @@ public:
|
|||
//BBS: add clone logic
|
||||
void clone_selection();
|
||||
void center_selection();
|
||||
void search(bool plater_is_active, Preset::Type type, wxWindow *tag, wxTextCtrl *etag, wxWindow *stag);
|
||||
void search(bool plater_is_active, Preset::Type type, wxWindow *tag, TextInput *etag, wxWindow *stag);
|
||||
void mirror(Axis axis);
|
||||
void split_object();
|
||||
void split_volume();
|
||||
|
|
|
@ -17,14 +17,18 @@
|
|||
#include <wx/listimpl.cpp>
|
||||
#include <map>
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef _MSW_DARK_MODE
|
||||
#include "dark_mode.hpp"
|
||||
#endif // _MSW_DARK_MODE
|
||||
#endif //__WINDOWS__
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
WX_DEFINE_LIST(RadioSelectorList);
|
||||
wxDEFINE_EVENT(EVT_PREFERENCES_SELECT_TAB, wxCommandEvent);
|
||||
|
||||
// @class: PreferencesDialog
|
||||
// @ret: items
|
||||
// @birth: created by onion
|
||||
|
||||
wxBoxSizer *PreferencesDialog::create_item_title(wxString title, wxWindow *parent, wxString tooltip)
|
||||
{
|
||||
wxBoxSizer *m_sizer_title = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
@ -371,9 +375,11 @@ wxBoxSizer *PreferencesDialog::create_item_backup_input(wxString title, wxWindow
|
|||
input_title->Wrap(-1);
|
||||
|
||||
auto input = new ::TextInput(parent, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, DESIGN_INPUT_SIZE, wxTE_PROCESS_ENTER);
|
||||
input->GetTextCtrl()->SetFont(::Label::Body_13);
|
||||
StateColor input_bg(std::pair<wxColour, int>(wxColour("#F0F0F1"), StateColor::Disabled));
|
||||
input->SetBackgroundColor(input_bg);
|
||||
input->GetTextCtrl()->SetValue(app_config->get(param));
|
||||
|
||||
|
||||
auto second_title = new wxStaticText(parent, wxID_ANY, _L("Second"), wxDefaultPosition, DESIGN_TITLE_SIZE, 0);
|
||||
second_title->SetForegroundColour(DESIGN_GRAY900_COLOR);
|
||||
second_title->SetFont(::Label::Body_13);
|
||||
|
@ -408,8 +414,10 @@ wxBoxSizer *PreferencesDialog::create_item_backup_input(wxString title, wxWindow
|
|||
|
||||
if (app_config->get("backup_switch") == "true") {
|
||||
input->Enable(true);
|
||||
input->Refresh();
|
||||
} else {
|
||||
input->Enable(false);
|
||||
input->Refresh();
|
||||
}
|
||||
|
||||
if (param == "backup_interval") { m_backup_interval_textinput = input; }
|
||||
|
@ -445,6 +453,59 @@ wxBoxSizer *PreferencesDialog::create_item_switch(wxString title, wxWindow *pare
|
|||
return m_sizer_switch;
|
||||
}
|
||||
|
||||
wxBoxSizer* PreferencesDialog::create_item_darkmode_checkbox(wxString title, wxWindow* parent, wxString tooltip, int padding_left, std::string param)
|
||||
{
|
||||
wxBoxSizer* m_sizer_checkbox = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_sizer_checkbox->Add(0, 0, 0, wxEXPAND | wxLEFT, 23);
|
||||
|
||||
auto checkbox = new ::CheckBox(parent);
|
||||
checkbox->SetValue((app_config->get(param) == "1") ? true : false);
|
||||
m_dark_mode_ckeckbox = checkbox;
|
||||
|
||||
m_sizer_checkbox->Add(checkbox, 0, wxALIGN_CENTER, 0);
|
||||
m_sizer_checkbox->Add(0, 0, 0, wxEXPAND | wxLEFT, 8);
|
||||
|
||||
auto checkbox_title = new wxStaticText(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, 0);
|
||||
checkbox_title->SetForegroundColour(DESIGN_GRAY900_COLOR);
|
||||
checkbox_title->SetFont(::Label::Body_13);
|
||||
|
||||
auto size = checkbox_title->GetTextExtent(title);
|
||||
checkbox_title->SetMinSize(wxSize(size.x + FromDIP(40), -1));
|
||||
checkbox_title->Wrap(-1);
|
||||
m_sizer_checkbox->Add(checkbox_title, 0, wxALIGN_CENTER | wxALL, 3);
|
||||
|
||||
|
||||
//// save config
|
||||
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, param](wxCommandEvent& e) {
|
||||
app_config->set(param, checkbox->GetValue() ? "1" : "0");
|
||||
app_config->save();
|
||||
|
||||
//dark mode
|
||||
#ifdef _MSW_DARK_MODE
|
||||
wxGetApp().force_colors_update();
|
||||
wxGetApp().update_ui_from_settings();
|
||||
set_dark_mode();
|
||||
#endif
|
||||
|
||||
e.Skip();
|
||||
});
|
||||
|
||||
checkbox->SetToolTip(tooltip);
|
||||
return m_sizer_checkbox;
|
||||
}
|
||||
|
||||
void PreferencesDialog::set_dark_mode()
|
||||
{
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef _MSW_DARK_MODE
|
||||
NppDarkMode::SetDarkExplorerTheme(this->GetHWND());
|
||||
NppDarkMode::SetDarkTitleBar(this->GetHWND());
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
wxBoxSizer *PreferencesDialog::create_item_checkbox(wxString title, wxWindow *parent, wxString tooltip, int padding_left, std::string param)
|
||||
{
|
||||
wxBoxSizer *m_sizer_checkbox = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
@ -609,6 +670,7 @@ PreferencesDialog::PreferencesDialog(wxWindow *parent, wxWindowID id, const wxSt
|
|||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
create();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void PreferencesDialog::create()
|
||||
|
@ -637,9 +699,6 @@ void PreferencesDialog::create()
|
|||
#if !BBL_RELEASE_TO_PUBLIC
|
||||
auto debug_page = create_debug_page();
|
||||
#endif
|
||||
/* create_gui_page();
|
||||
create_sync_page();
|
||||
create_shortcuts_page();*/
|
||||
|
||||
m_sizer_body->Add(0, 0, 0, wxTOP, FromDIP(28));
|
||||
m_sizer_body->Add(general_page, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(38));
|
||||
|
@ -769,6 +828,10 @@ wxWindow* PreferencesDialog::create_general_page()
|
|||
auto title_downloads = create_item_title(_L("Downloads"), page, _L("Downloads"));
|
||||
auto item_downloads = create_item_downloads(page,50,"download_path");
|
||||
|
||||
//dark mode
|
||||
auto title_darkmode = create_item_title(_L("Dark Mode"), page, _L("Dark Mode"));
|
||||
auto item_darkmode = create_item_darkmode_checkbox(_L("Enable Dark mode"), page,_L("Enable Dark mode"), 50, "dark_color_mode");
|
||||
|
||||
sizer_page->Add(title_general_settings, 0, wxEXPAND, 0);
|
||||
sizer_page->Add(item_language, 0, wxTOP, FromDIP(3));
|
||||
sizer_page->Add(item_region, 0, wxTOP, FromDIP(3));
|
||||
|
@ -785,11 +848,13 @@ wxWindow* PreferencesDialog::create_general_page()
|
|||
sizer_page->Add(title_backup, 0, wxTOP| wxEXPAND, FromDIP(20));
|
||||
sizer_page->Add(item_backup, 0, wxTOP,FromDIP(3));
|
||||
sizer_page->Add(item_backup_interval, 0, wxTOP,FromDIP(3));
|
||||
//sizer_page->Add(0, 0, 0, wxTOP, 26);
|
||||
|
||||
sizer_page->Add(title_downloads, 0, wxTOP| wxEXPAND, FromDIP(20));
|
||||
sizer_page->Add(item_downloads, 0, wxEXPAND, FromDIP(3));
|
||||
|
||||
sizer_page->Add(title_darkmode, 0, wxTOP | wxEXPAND, FromDIP(20));
|
||||
sizer_page->Add(item_darkmode, 0, wxEXPAND, FromDIP(3));
|
||||
|
||||
|
||||
page->SetSizer(sizer_page);
|
||||
page->Layout();
|
||||
|
@ -903,9 +968,19 @@ wxBoxSizer* PreferencesDialog::create_debug_page()
|
|||
on_select_radio("product_host");
|
||||
}
|
||||
|
||||
wxButton *debug_button = new wxButton(m_scrolledWindow, wxID_ANY, _L("debug save button"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
debug_button->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
|
||||
|
||||
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_white(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
|
||||
|
||||
Button* debug_button = new Button(m_scrolledWindow, _L("debug save button"));
|
||||
debug_button->SetBackgroundColor(btn_bg_white);
|
||||
debug_button->SetBorderColor(btn_bd_white);
|
||||
debug_button->SetFont(Label::Body_13);
|
||||
|
||||
|
||||
debug_button->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
|
||||
// success message box
|
||||
MessageDialog dialog(this, _L("save debug settings"), _L("DEBUG settings have saved successfully!"), wxNO_DEFAULT | wxYES_NO | wxICON_INFORMATION);
|
||||
switch (dialog.ShowModal()) {
|
||||
|
|
|
@ -90,6 +90,7 @@ public:
|
|||
// debug mode
|
||||
::CheckBox * m_developer_mode_ckeckbox = {nullptr};
|
||||
::CheckBox * m_dump_video_ckeckbox = {nullptr};
|
||||
::CheckBox * m_dark_mode_ckeckbox = {nullptr};
|
||||
::TextInput *m_backup_interval_textinput = {nullptr};
|
||||
|
||||
wxString m_developer_mode_def;
|
||||
|
@ -107,7 +108,9 @@ public:
|
|||
wxBoxSizer *create_item_language_combobox(wxString title, wxWindow *parent, wxString tooltip, int padding_left, std::string param, std::vector<const wxLanguageInfo *> vlist);
|
||||
wxBoxSizer *create_item_loglevel_combobox(wxString title, wxWindow *parent, wxString tooltip, std::vector<wxString> vlist);
|
||||
wxBoxSizer *create_item_checkbox(wxString title, wxWindow *parent, wxString tooltip, int padding_left, std::string param);
|
||||
wxWindow* create_item_downloads(wxWindow* parent, int padding_left, std::string param);
|
||||
wxBoxSizer *create_item_darkmode_checkbox(wxString title, wxWindow *parent, wxString tooltip, int padding_left, std::string param);
|
||||
void set_dark_mode();
|
||||
wxWindow* create_item_downloads(wxWindow* parent, int padding_left, std::string param);
|
||||
wxBoxSizer* create_item_backup_checkbox(wxString title, wxWindow* parent, wxString tooltip, int padding_left, std::string param);
|
||||
wxBoxSizer *create_item_backup_input(wxString title, wxWindow *parent, wxString tooltip, std::string param);
|
||||
wxBoxSizer *create_item_multiple_combobox(
|
||||
|
|
|
@ -315,6 +315,8 @@ PrintHostQueueDialog::PrintHostQueueDialog(wxWindow *parent)
|
|||
if (selected == wxNOT_FOUND) { return; }
|
||||
GUI::show_error(nullptr, job_list->GetTextValue(selected, COL_ERRORMSG));
|
||||
});
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void PrintHostQueueDialog::append_job(const PrintHostJob &job)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "PrintOptionsDialog.hpp"
|
||||
#include "I18N.hpp"
|
||||
|
||||
#include "GUI_App.hpp"
|
||||
#include "libslic3r/Utils.hpp"
|
||||
|
||||
#define DLG_SIZE (wxSize(FromDIP(360), FromDIP(160)))
|
||||
|
@ -60,6 +60,8 @@ PrintOptionsDialog::PrintOptionsDialog(wxWindow* parent)
|
|||
}
|
||||
evt.Skip();
|
||||
});
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
PrintOptionsDialog::~PrintOptionsDialog()
|
||||
|
|
|
@ -133,6 +133,7 @@ PublishDialog::PublishDialog(Plater *plater)
|
|||
});
|
||||
|
||||
Bind(wxEVT_CLOSE_WINDOW, &PublishDialog::on_close, this);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void PublishDialog::cancel()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "RecenterDialog.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include <slic3r/GUI/I18N.hpp>
|
||||
#include <wx/dcgraph.h>
|
||||
#include <wx/dcmemory.h>
|
||||
|
@ -67,6 +68,8 @@ RecenterDialog::RecenterDialog(wxWindow* parent, wxWindowID id, const wxString&
|
|||
this->Bind(wxEVT_PAINT, &RecenterDialog::OnPaint, this);
|
||||
m_button_confirm->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_confirm, this);
|
||||
m_button_close->Bind(wxEVT_BUTTON, &RecenterDialog::on_button_close, this);
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
RecenterDialog::~RecenterDialog() {}
|
||||
|
|
|
@ -73,6 +73,7 @@ ReleaseNoteDialog::ReleaseNoteDialog(Plater *plater /*= nullptr*/)
|
|||
m_sizer_main->Fit(this);
|
||||
|
||||
Centre(wxBOTH);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
ReleaseNoteDialog::~ReleaseNoteDialog() {}
|
||||
|
@ -221,6 +222,7 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
|
|||
m_sizer_main->Fit(this);
|
||||
|
||||
Centre(wxBOTH);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
UpdateVersionDialog::~UpdateVersionDialog() {}
|
||||
|
|
|
@ -74,18 +74,22 @@ SavePresetDialog::Item::Item(Preset::Type type, const std::string &suffix, wxBox
|
|||
// combo_sizer->Add(m_combo, 1, wxEXPAND, BORDER_W);
|
||||
|
||||
|
||||
m_input_area = new RoundedRectangle(m_parent, wxColor(172, 172, 172), wxDefaultPosition, wxSize(-1,-1), 3, 1);
|
||||
StateColor box_border_colour(std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Normal));
|
||||
m_input_area = new StaticBox(m_parent, wxID_ANY, wxDefaultPosition, SAVE_PRESET_DIALOG_INPUT_SIZE, wxBORDER_NONE);
|
||||
m_input_area->SetMinSize(SAVE_PRESET_DIALOG_INPUT_SIZE);
|
||||
m_input_area->SetBorderColor(box_border_colour);
|
||||
m_input_area->SetBackgroundColor(box_border_colour);
|
||||
m_input_area->SetCornerRadius(FromDIP(3));
|
||||
|
||||
wxBoxSizer *input_sizer_h = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *input_sizer_v = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
m_input_ctrl = new wxTextCtrl(m_input_area, -1, from_u8(preset_name), wxDefaultPosition, wxSize(SAVE_PRESET_DIALOG_INPUT_SIZE.x, -1), 0 | wxBORDER_NONE);
|
||||
m_input_ctrl->SetBackgroundColour(SAVE_PRESET_DIALOG_DEF_COLOUR);
|
||||
m_input_ctrl = new wxTextCtrl(m_input_area, -1, from_u8(preset_name), wxDefaultPosition, wxSize(SAVE_PRESET_DIALOG_INPUT_SIZE.x - 2, SAVE_PRESET_DIALOG_INPUT_SIZE.y - 2), 0 | wxBORDER_NONE);
|
||||
//m_input_ctrl->SetBackgroundColour(GetParent()->GetBackgroundColour());
|
||||
m_input_ctrl->Bind(wxEVT_TEXT, [this](wxCommandEvent &) { update(); });
|
||||
|
||||
|
||||
input_sizer_v->Add(m_input_ctrl, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 12);
|
||||
input_sizer_v->Add(m_input_ctrl, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 1);
|
||||
input_sizer_h->Add(input_sizer_v, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
m_input_area->SetSizer(input_sizer_h);
|
||||
|
@ -295,12 +299,14 @@ SavePresetDialog::SavePresetDialog(wxWindow *parent, Preset::Type type, std::str
|
|||
: DPIDialog(parent, wxID_ANY, _L("Save preset"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
|
||||
{
|
||||
build(std::vector<Preset::Type>{type}, suffix);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
SavePresetDialog::SavePresetDialog(wxWindow *parent, std::vector<Preset::Type> types, std::string suffix)
|
||||
: DPIDialog(parent, wxID_ANY, _L("Save preset"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
|
||||
{
|
||||
build(types, suffix);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
SavePresetDialog::~SavePresetDialog()
|
||||
|
@ -337,7 +343,7 @@ void SavePresetDialog::build(std::vector<Preset::Type> types, std::string suffix
|
|||
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
|
||||
m_confirm->SetBackgroundColor(btn_bg_green);
|
||||
m_confirm->SetBorderColor(wxColour(0, 174, 66));
|
||||
m_confirm->SetTextColor(wxColour(255, 255, 255));
|
||||
m_confirm->SetTextColor(wxColour("#FFFFFE"));
|
||||
m_confirm->SetMinSize(SAVE_PRESET_DIALOG_BUTTON_SIZE);
|
||||
m_confirm->SetCornerRadius(FromDIP(12));
|
||||
m_confirm->Bind(wxEVT_BUTTON, &SavePresetDialog::accept, this);
|
||||
|
@ -349,7 +355,6 @@ void SavePresetDialog::build(std::vector<Preset::Type> types, std::string suffix
|
|||
|
||||
m_cancel = new Button(this, _L("Cancel"));
|
||||
m_cancel->SetMinSize(SAVE_PRESET_DIALOG_BUTTON_SIZE);
|
||||
m_cancel->SetTextColor(wxColour(107, 107, 107));
|
||||
m_cancel->SetCornerRadius(FromDIP(12));
|
||||
m_cancel->Bind(wxEVT_BUTTON, &SavePresetDialog::on_select_cancel, this);
|
||||
btns->Add(m_cancel, 0, wxEXPAND, 0);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "Widgets/Button.hpp"
|
||||
#include "Widgets/RoundedRectangle.hpp"
|
||||
#include "Widgets/Label.hpp"
|
||||
#include "Widgets/TextInput.hpp"
|
||||
|
||||
class wxString;
|
||||
class wxStaticText;
|
||||
|
@ -17,7 +18,7 @@ class wxComboBox;
|
|||
class wxStaticBitmap;
|
||||
|
||||
#define SAVE_PRESET_DIALOG_DEF_COLOUR wxColour(255, 255, 255)
|
||||
#define SAVE_PRESET_DIALOG_INPUT_SIZE wxSize(FromDIP(360), FromDIP(32))
|
||||
#define SAVE_PRESET_DIALOG_INPUT_SIZE wxSize(FromDIP(360), FromDIP(24))
|
||||
#define SAVE_PRESET_DIALOG_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
|
||||
|
||||
namespace Slic3r {
|
||||
|
@ -55,7 +56,7 @@ class SavePresetDialog : public DPIDialog
|
|||
//BBS: add project embedded preset relate logic
|
||||
bool save_to_project() const { return m_save_to_project; }
|
||||
|
||||
RoundedRectangle* m_input_area {nullptr};
|
||||
StaticBox* m_input_area {nullptr};
|
||||
Preset::Type m_type;
|
||||
ValidationType m_valid_type;
|
||||
std::string m_preset_name;
|
||||
|
|
|
@ -361,7 +361,7 @@ Option OptionsSearcher::get_option(const std::string &opt_key, const wxString &l
|
|||
return create_option(opt_key, label, type, gc);
|
||||
}
|
||||
|
||||
void OptionsSearcher::show_dialog(Preset::Type type, wxWindow *parent, wxTextCtrl *input, wxWindow* ssearch_btn)
|
||||
void OptionsSearcher::show_dialog(Preset::Type type, wxWindow *parent, TextInput *input, wxWindow* ssearch_btn)
|
||||
{
|
||||
if (parent == nullptr || input == nullptr) return;
|
||||
auto search_dialog = new SearchDialog(this, type, parent, input, ssearch_btn);
|
||||
|
@ -397,7 +397,7 @@ SearchItem::SearchItem(wxWindow *parent, wxString text, int index, SearchDialog*
|
|||
m_text = text;
|
||||
m_index = index;
|
||||
|
||||
SetBackgroundColour(wxColour(255, 255, 255));
|
||||
SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF")));
|
||||
Bind(wxEVT_ENTER_WINDOW, &SearchItem::on_mouse_enter, this);
|
||||
Bind(wxEVT_LEAVE_WINDOW, &SearchItem::on_mouse_leave, this);
|
||||
Bind(wxEVT_LEFT_DOWN, &SearchItem::on_mouse_left_down, this);
|
||||
|
@ -414,7 +414,7 @@ wxSize SearchItem::DrawTextString(wxDC &dc, const wxString &text, const wxPoint
|
|||
}
|
||||
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
dc.SetTextForeground(wxColour(43, 52, 54));
|
||||
dc.SetTextForeground(StateColor::darkModeColorFor(wxColour("#323A3C")));
|
||||
dc.DrawText(text, pt);
|
||||
return dc.GetTextExtent(text);
|
||||
}
|
||||
|
@ -486,19 +486,19 @@ void SearchItem::OnPaint(wxPaintEvent &event)
|
|||
|
||||
void SearchItem::on_mouse_enter(wxMouseEvent &evt)
|
||||
{
|
||||
SetBackgroundColour(wxColour(238, 238, 238));
|
||||
SetBackgroundColour(StateColor::darkModeColorFor(wxColour(238, 238, 238)));
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SearchItem::on_mouse_leave(wxMouseEvent &evt)
|
||||
{
|
||||
SetBackgroundColour(wxColour(255, 255, 255));
|
||||
SetBackgroundColour(StateColor::darkModeColorFor(wxColour(255, 255, 255)));
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SearchItem::on_mouse_left_down(wxMouseEvent &evt)
|
||||
{
|
||||
SetBackgroundColour(wxColour(228, 228, 228));
|
||||
SetBackgroundColour(StateColor::darkModeColorFor(wxColour(228, 228, 228)));
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,7 @@ static const std::map<const char, int> icon_idxs = {
|
|||
{ImGui::PrintIconMarker, 0}, {ImGui::PrinterIconMarker, 1}, {ImGui::PrinterSlaIconMarker, 2}, {ImGui::FilamentIconMarker, 3}, {ImGui::MaterialIconMarker, 4},
|
||||
};
|
||||
|
||||
SearchDialog::SearchDialog(OptionsSearcher *searcher, Preset::Type type, wxWindow *parent, wxTextCtrl *input, wxWindow *search_btn)
|
||||
SearchDialog::SearchDialog(OptionsSearcher *searcher, Preset::Type type, wxWindow *parent, TextInput *input, wxWindow *search_btn)
|
||||
: wxPopupTransientWindow(parent, wxBORDER_NONE | wxPU_CONTAINS_CONTROLS), searcher(searcher)
|
||||
{
|
||||
m_event_tag = parent;
|
||||
|
@ -602,6 +602,7 @@ SearchDialog::SearchDialog(OptionsSearcher *searcher, Preset::Type type, wxWindo
|
|||
|
||||
// SetSizer(topSizer);
|
||||
// topSizer->SetSizeHints(this);
|
||||
GUI::wxGetApp().UpdateDarkUIWin(this);
|
||||
}
|
||||
|
||||
SearchDialog::~SearchDialog() {}
|
||||
|
@ -618,7 +619,7 @@ void SearchDialog::Popup(wxPoint position /*= wxDefaultPosition*/)
|
|||
|
||||
//const std::string &line = searcher->search_string();
|
||||
//search_line->SetValue(line.empty() ? default_string : from_u8(line));
|
||||
search_line->SetValue(wxString(""));
|
||||
search_line->GetTextCtrl()->SetValue(wxString(""));
|
||||
//const std::string &line = searcher->search_string();
|
||||
//searcher->search(into_u8(line), true);
|
||||
wxPopupTransientWindow::Popup();
|
||||
|
@ -666,8 +667,8 @@ void SearchDialog::ProcessSelection(wxDataViewItem selection)
|
|||
|
||||
void SearchDialog::OnInputText(wxCommandEvent &)
|
||||
{
|
||||
search_line->SetInsertionPointEnd();
|
||||
wxString input_string = search_line->GetValue();
|
||||
search_line->GetTextCtrl()->SetInsertionPointEnd();
|
||||
wxString input_string = search_line->GetTextCtrl()->GetValue();
|
||||
if (input_string == default_string) input_string.Clear();
|
||||
searcher->search(into_u8(input_string), true, search_type);
|
||||
update_list();
|
||||
|
@ -675,7 +676,7 @@ void SearchDialog::OnInputText(wxCommandEvent &)
|
|||
|
||||
void SearchDialog::OnLeftUpInTextCtrl(wxEvent &event)
|
||||
{
|
||||
if (search_line->GetValue() == default_string) search_line->SetValue("");
|
||||
if (search_line->GetTextCtrl()->GetValue() == default_string) search_line->GetTextCtrl()->SetValue("");
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
@ -725,13 +726,13 @@ void SearchDialog::update_list()
|
|||
m_scrolledWindow->Destroy();
|
||||
|
||||
m_scrolledWindow = new ScrolledWindow(m_client_panel, wxID_ANY, wxDefaultPosition, wxSize(POPUP_WIDTH * em - (em + em / 2), POPUP_HEIGHT * em - em), wxVSCROLL, 6, 6);
|
||||
m_scrolledWindow->SetMarginColor(m_bg_colour);
|
||||
m_scrolledWindow->SetScrollbarColor(m_thumb_color);
|
||||
m_scrolledWindow->SetBackgroundColour(m_bg_colour);
|
||||
m_scrolledWindow->SetMarginColor(StateColor::darkModeColorFor(m_bg_colour));
|
||||
m_scrolledWindow->SetScrollbarColor(StateColor::darkModeColorFor(m_thumb_color));
|
||||
m_scrolledWindow->SetBackgroundColour(StateColor::darkModeColorFor(m_bg_colour));
|
||||
|
||||
auto m_listsizer = new wxBoxSizer(wxVERTICAL);
|
||||
auto m_listPanel = new wxWindow(m_scrolledWindow->GetPanel(), -1);
|
||||
m_listPanel->SetBackgroundColour(m_bg_colour);
|
||||
m_listPanel->SetBackgroundColour(StateColor::darkModeColorFor(m_bg_colour));
|
||||
m_listPanel->SetSize(wxSize(m_scrolledWindow->GetSize().GetWidth(), -1));
|
||||
|
||||
const std::vector<FoundOption> &filters = searcher->found_options();
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "GUI_Utils.hpp"
|
||||
#include "libslic3r/Preset.hpp"
|
||||
#include "Widgets/ScrolledWindow.hpp"
|
||||
#include "Widgets/TextInput.hpp"
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
@ -143,7 +144,7 @@ public:
|
|||
}
|
||||
void sort_options_by_label() { sort_options(); }
|
||||
|
||||
void show_dialog(Preset::Type type, wxWindow *parent, wxTextCtrl *input, wxWindow *ssearch_btn);
|
||||
void show_dialog(Preset::Type type, wxWindow *parent, TextInput *input, wxWindow *ssearch_btn);
|
||||
void dlg_sys_color_changed();
|
||||
void dlg_msw_rescale();
|
||||
};
|
||||
|
@ -204,7 +205,7 @@ public:
|
|||
const int POPUP_WIDTH = 38;
|
||||
const int POPUP_HEIGHT = 40;
|
||||
|
||||
wxTextCtrl * search_line{nullptr};
|
||||
TextInput * search_line{nullptr};
|
||||
Preset::Type search_type = Preset::TYPE_INVALID;
|
||||
|
||||
wxDataViewCtrl * search_list{nullptr};
|
||||
|
@ -228,7 +229,7 @@ public:
|
|||
void update_list();
|
||||
|
||||
public:
|
||||
SearchDialog(OptionsSearcher *searcher, Preset::Type type, wxWindow *parent, wxTextCtrl *input, wxWindow *search_btn);
|
||||
SearchDialog(OptionsSearcher *searcher, Preset::Type type, wxWindow *parent, TextInput *input, wxWindow *search_btn);
|
||||
~SearchDialog();
|
||||
|
||||
void MSWDismissUnfocusedPopup();
|
||||
|
|
|
@ -158,7 +158,7 @@ MachineObjectPanel::MachineObjectPanel(wxWindow *parent, wxWindowID id, const wx
|
|||
wxPanel::Create(parent, id, pos, SELECT_MACHINE_ITEM_SIZE, style, name);
|
||||
Bind(wxEVT_PAINT, &MachineObjectPanel::OnPaint, this);
|
||||
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
|
||||
m_unbind_img = ScalableBitmap(this, "unbind", 18);
|
||||
m_edit_name_img = ScalableBitmap(this, "edit_button", 18);
|
||||
|
@ -251,7 +251,7 @@ void MachineObjectPanel::doRender(wxDC &dc)
|
|||
left += dwbitmap.GetBmpSize().x + 8;
|
||||
dc.SetFont(Label::Body_13);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
dc.SetTextForeground(SELECT_MACHINE_GREY900);
|
||||
dc.SetTextForeground(StateColor::darkModeColorFor(SELECT_MACHINE_GREY900));
|
||||
wxString dev_name = "";
|
||||
if (m_info) {
|
||||
dev_name = from_u8(m_info->dev_name);
|
||||
|
@ -280,7 +280,7 @@ void MachineObjectPanel::doRender(wxDC &dc)
|
|||
if (m_show_bind) {
|
||||
if (m_bind_state == ALLOW_UNBIND) {
|
||||
left = size.x - m_unbind_img.GetBmpSize().x - 6;
|
||||
dc.DrawBitmap(m_select_unbind_img.bmp(), left, (size.y - m_unbind_img.GetBmpSize().y) / 2);
|
||||
dc.DrawBitmap(m_unbind_img.bmp(), left, (size.y - m_unbind_img.GetBmpSize().y) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -650,7 +650,7 @@ void SelectMachinePopup::update_other_devices()
|
|||
m_placeholder_panel->Layout();
|
||||
placeholder_sizer->Fit(m_placeholder_panel);
|
||||
|
||||
m_placeholder_panel->SetBackgroundColour(*wxWHITE);
|
||||
m_placeholder_panel->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
m_sizer_other_devices->Add(m_placeholder_panel, 0, wxEXPAND, 0);
|
||||
|
||||
//m_sizer_other_devices->Layout();
|
||||
|
@ -1113,7 +1113,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_button_refresh = new Button(this, _L("Refresh"));
|
||||
m_button_refresh->SetBackgroundColor(btn_bg_enable);
|
||||
m_button_refresh->SetBorderColor(btn_bg_enable);
|
||||
m_button_refresh->SetTextColor(*wxWHITE);
|
||||
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));
|
||||
|
@ -1172,7 +1172,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_button_ensure = new Button(m_panel_prepare, _L("Send"));
|
||||
m_button_ensure->SetBackgroundColor(btn_bg_enable);
|
||||
m_button_ensure->SetBorderColor(btn_bg_enable);
|
||||
m_button_ensure->SetTextColor(*wxWHITE);
|
||||
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(FromDIP(12));
|
||||
|
@ -1263,6 +1263,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
init_timer();
|
||||
// CenterOnParent();
|
||||
Centre(wxBOTH);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
wxWindow *SelectMachineDialog::create_ams_checkbox(wxString title, wxWindow *parent, wxString tooltip)
|
||||
|
@ -1282,7 +1283,7 @@ wxWindow *SelectMachineDialog::create_ams_checkbox(wxString title, wxWindow *par
|
|||
|
||||
auto text = new wxStaticText(checkbox, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, 0);
|
||||
text->SetFont(::Label::Body_13);
|
||||
text->SetForegroundColour(wxColour(107, 107, 107));
|
||||
text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#323A3C")));
|
||||
text->Wrap(-1);
|
||||
sizer_checkbox->Add(text, 0, wxALIGN_CENTER, FromDIP(5));
|
||||
|
||||
|
@ -1337,7 +1338,7 @@ wxWindow *SelectMachineDialog::create_item_checkbox(wxString title, wxWindow *pa
|
|||
|
||||
auto text = new wxStaticText(checkbox, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
|
||||
text->SetFont(::Label::Body_13);
|
||||
text->SetForegroundColour(wxColour(107, 107, 107));
|
||||
text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#323A3C")));
|
||||
text->Wrap(-1);
|
||||
text->SetMinSize(wxSize(FromDIP(120), -1));
|
||||
text->SetMaxSize(wxSize(FromDIP(120), -1));
|
||||
|
@ -2954,6 +2955,7 @@ EditDevNameDialog::EditDevNameDialog(Plater *plater /*= nullptr*/)
|
|||
Layout();
|
||||
Fit();
|
||||
Centre(wxBOTH);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
EditDevNameDialog::~EditDevNameDialog() {}
|
||||
|
|
|
@ -158,8 +158,8 @@ protected:
|
|||
void on_mouse_left_up(wxMouseEvent &evt);
|
||||
};
|
||||
|
||||
#define SELECT_MACHINE_POPUP_SIZE wxSize(FromDIP(218), FromDIP(364))
|
||||
#define SELECT_MACHINE_LIST_SIZE wxSize(FromDIP(214), FromDIP(360))
|
||||
#define SELECT_MACHINE_POPUP_SIZE wxSize(FromDIP(214), FromDIP(364))
|
||||
#define SELECT_MACHINE_LIST_SIZE wxSize(FromDIP(210), FromDIP(360))
|
||||
#define SELECT_MACHINE_ITEM_SIZE wxSize(FromDIP(180), FromDIP(35))
|
||||
#define SELECT_MACHINE_GREY900 wxColour(38, 46, 48)
|
||||
#define SELECT_MACHINE_GREY600 wxColour(144,144,144)
|
||||
|
|
|
@ -221,7 +221,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
|
|||
m_button_refresh = new Button(this, _L("Refresh"));
|
||||
m_button_refresh->SetBackgroundColor(btn_bg_enable);
|
||||
m_button_refresh->SetBorderColor(btn_bg_enable);
|
||||
m_button_refresh->SetTextColor(*wxWHITE);
|
||||
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));
|
||||
|
@ -251,7 +251,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
|
|||
m_button_ensure = new Button(m_panel_prepare, _L("Send"));
|
||||
m_button_ensure->SetBackgroundColor(btn_bg_enable);
|
||||
m_button_ensure->SetBorderColor(btn_bg_enable);
|
||||
m_button_ensure->SetTextColor(*wxWHITE);
|
||||
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(FromDIP(12));
|
||||
|
@ -398,6 +398,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
|
|||
init_timer();
|
||||
// CenterOnParent();
|
||||
Centre(wxBOTH);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void SendToPrinterDialog::prepare_mode()
|
||||
|
|
|
@ -39,7 +39,7 @@ static const wxColour BUTTON_PRESS_COL = wxColour(172, 172, 172);
|
|||
static const wxColour BUTTON_HOVER_COL = wxColour(0, 174, 66);
|
||||
|
||||
static const wxColour DISCONNECT_TEXT_COL = wxColour(172, 172, 172);
|
||||
static const wxColour NORMAL_TEXT_COL = wxColour(50, 58, 61);
|
||||
static const wxColour NORMAL_TEXT_COL = wxColour(48,58,60);
|
||||
static const wxColour NORMAL_FAN_TEXT_COL = wxColour(107, 107, 107);
|
||||
static const wxColour WARNING_INFO_BG_COL = wxColour(255, 111, 0);
|
||||
static const wxColour STAGE_TEXT_COL = wxColour(0, 174, 66);
|
||||
|
@ -585,7 +585,7 @@ wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent)
|
|||
m_options_btn = new Button(m_panel_control_title, _L("Print Options"));
|
||||
m_options_btn->SetBackgroundColor(btn_bg_green);
|
||||
m_options_btn->SetBorderColor(btn_bd_green);
|
||||
m_options_btn->SetTextColor(*wxWHITE);
|
||||
m_options_btn->SetTextColor(wxColour("#FFFFFE"));
|
||||
m_options_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
|
||||
m_options_btn->SetMinSize(wxSize(-1, FromDIP(26)));
|
||||
|
||||
|
@ -593,7 +593,7 @@ wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent)
|
|||
m_calibration_btn = new Button(m_panel_control_title, _L("Calibration"));
|
||||
m_calibration_btn->SetBackgroundColor(btn_bg_green);
|
||||
m_calibration_btn->SetBorderColor(btn_bd_green);
|
||||
m_calibration_btn->SetTextColor(*wxWHITE);
|
||||
m_calibration_btn->SetTextColor(wxColour("#FFFFFE"));
|
||||
m_calibration_btn->SetSize(wxSize(FromDIP(128), FromDIP(26)));
|
||||
m_calibration_btn->SetMinSize(wxSize(-1, FromDIP(26)));
|
||||
|
||||
|
@ -623,7 +623,14 @@ wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent)
|
|||
wxBoxSizer *StatusBasePanel::create_temp_axis_group(wxWindow *parent)
|
||||
{
|
||||
auto sizer = new wxBoxSizer(wxVERTICAL);
|
||||
auto box = new RoundedRectangle(parent, wxColour(0xEE, 0xEE, 0xEE), wxDefaultPosition, wxSize(FromDIP(510), -1), 5, 1);
|
||||
auto box = new StaticBox(parent);
|
||||
|
||||
StateColor box_colour(std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
|
||||
StateColor box_border_colour(std::pair<wxColour, int>(STATUS_PANEL_BG, StateColor::Normal));
|
||||
|
||||
box->SetBackgroundColor(box_colour);
|
||||
box->SetBorderColor(box_border_colour);
|
||||
box->SetCornerRadius(5);
|
||||
|
||||
box->SetMinSize(wxSize(FromDIP(530), -1));
|
||||
box->SetMaxSize(wxSize(FromDIP(530), -1));
|
||||
|
@ -665,9 +672,13 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
|
|||
m_tempCtrl_nozzle->SetMinTemp(nozzle_temp_range[0]);
|
||||
m_tempCtrl_nozzle->SetMaxTemp(nozzle_temp_range[1]);
|
||||
m_tempCtrl_nozzle->SetBorderWidth(FromDIP(2));
|
||||
m_tempCtrl_nozzle->SetTextColor(StateColor(std::make_pair(DISCONNECT_TEXT_COL, (int) StateColor::Disabled), std::make_pair(NORMAL_TEXT_COL, (int) StateColor::Normal)));
|
||||
m_tempCtrl_nozzle->SetBorderColor(StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(BUTTON_HOVER_COL, (int) StateColor::Focused),
|
||||
std::make_pair(BUTTON_HOVER_COL, (int) StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)));
|
||||
|
||||
StateColor tempinput_text_colour(std::make_pair(DISCONNECT_TEXT_COL, (int) StateColor::Disabled), std::make_pair(NORMAL_TEXT_COL, (int) StateColor::Normal));
|
||||
StateColor tempinput_border_colour(std::make_pair(*wxWHITE, (int)StateColor::Disabled), std::make_pair(BUTTON_HOVER_COL, (int)StateColor::Focused),
|
||||
std::make_pair(BUTTON_HOVER_COL, (int)StateColor::Hovered), std::make_pair(*wxWHITE, (int)StateColor::Normal));
|
||||
|
||||
m_tempCtrl_nozzle->SetTextColor(tempinput_text_colour);
|
||||
m_tempCtrl_nozzle->SetBorderColor(tempinput_border_colour);
|
||||
|
||||
sizer->Add(m_tempCtrl_nozzle, 0, wxEXPAND | wxALL, 1);
|
||||
|
||||
|
@ -683,9 +694,8 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
|
|||
m_tempCtrl_bed->SetMaxTemp(bed_temp_range[1]);
|
||||
m_tempCtrl_bed->SetMinSize(TEMP_CTRL_MIN_SIZE);
|
||||
m_tempCtrl_bed->SetBorderWidth(FromDIP(2));
|
||||
m_tempCtrl_bed->SetTextColor(StateColor(std::make_pair(DISCONNECT_TEXT_COL, (int) StateColor::Disabled), std::make_pair(NORMAL_TEXT_COL, (int) StateColor::Normal)));
|
||||
m_tempCtrl_bed->SetBorderColor(StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(BUTTON_HOVER_COL, (int) StateColor::Focused),
|
||||
std::make_pair(BUTTON_HOVER_COL, (int) StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)));
|
||||
m_tempCtrl_bed->SetTextColor(tempinput_text_colour);
|
||||
m_tempCtrl_bed->SetBorderColor(tempinput_border_colour);
|
||||
sizer->Add(m_tempCtrl_bed, 0, wxEXPAND | wxALL, 1);
|
||||
|
||||
auto line = new StaticLine(parent);
|
||||
|
@ -698,9 +708,9 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
|
|||
m_tempCtrl_frame->SetReadOnly(true);
|
||||
m_tempCtrl_frame->SetMinSize(TEMP_CTRL_MIN_SIZE);
|
||||
m_tempCtrl_frame->SetBorderWidth(FromDIP(2));
|
||||
m_tempCtrl_frame->SetTextColor(StateColor(std::make_pair(DISCONNECT_TEXT_COL, (int) StateColor::Disabled), std::make_pair(NORMAL_TEXT_COL, (int) StateColor::Normal)));
|
||||
m_tempCtrl_frame->SetBorderColor(StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(BUTTON_HOVER_COL, (int) StateColor::Focused),
|
||||
std::make_pair(BUTTON_HOVER_COL, (int) StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)));
|
||||
m_tempCtrl_frame->SetTextColor(tempinput_text_colour);
|
||||
m_tempCtrl_frame->SetBorderColor(tempinput_border_colour);
|
||||
|
||||
sizer->Add(m_tempCtrl_frame, 0, wxEXPAND | wxALL, 1);
|
||||
line = new StaticLine(parent);
|
||||
line->SetLineColour(STATIC_BOX_LINE_COL);
|
||||
|
@ -977,7 +987,16 @@ wxBoxSizer *StatusBasePanel::create_ams_group(wxWindow *parent)
|
|||
{
|
||||
auto sizer = new wxBoxSizer(wxVERTICAL);
|
||||
auto sizer_box = new wxBoxSizer(wxVERTICAL);
|
||||
m_ams_control_box = new RoundedRectangle(parent, wxColour(0xEE, 0xEE, 0xEE), wxDefaultPosition, wxDefaultSize, 5, 1);
|
||||
|
||||
m_ams_control_box = new StaticBox(parent);
|
||||
|
||||
StateColor box_colour(std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
|
||||
StateColor box_border_colour(std::pair<wxColour, int>(STATUS_PANEL_BG, StateColor::Normal));
|
||||
|
||||
m_ams_control_box->SetBackgroundColor(box_colour);
|
||||
m_ams_control_box->SetBorderColor(box_border_colour);
|
||||
m_ams_control_box->SetCornerRadius(5);
|
||||
|
||||
m_ams_control_box->SetMinSize(wxSize(FromDIP(530), -1));
|
||||
m_ams_control_box->SetBackgroundColour(*wxWHITE);
|
||||
#if !BBL_RELEASE_TO_PUBLIC
|
||||
|
@ -2393,7 +2412,7 @@ void StatusPanel::on_switch_speed(wxCommandEvent &event)
|
|||
#else
|
||||
wxPopupTransientWindow *popUp = new wxPopupTransientWindow(m_switch_speed);
|
||||
#endif
|
||||
popUp->SetBackgroundColour(0xeeeeee);
|
||||
popUp->SetBackgroundColour(StateColor::darkModeColorFor(0xeeeee));
|
||||
StepCtrl *step = new StepCtrl(popUp, wxID_ANY);
|
||||
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(step, 1, wxEXPAND, 0);
|
||||
|
|
|
@ -171,7 +171,7 @@ protected:
|
|||
wxStaticText * m_ams_debug;
|
||||
bool m_show_ams_group{false};
|
||||
AMSControl* m_ams_control;
|
||||
RoundedRectangle* m_ams_control_box;
|
||||
StaticBox* m_ams_control_box;
|
||||
wxStaticBitmap *m_ams_extruder_img;
|
||||
wxStaticBitmap* m_bitmap_extruder_img;
|
||||
wxPanel * m_panel_separator_right;
|
||||
|
|
|
@ -258,16 +258,24 @@ void Tab::create_preset_tab()
|
|||
m_btn_search->SetToolTip(_L("Search in preset"));
|
||||
|
||||
//search input
|
||||
m_search_item = new RoundedRectangle(m_top_panel, wxColour(238, 238, 238), wxDefaultPosition, wxSize(m_top_panel->GetSize().GetWidth(), 3 * wxGetApp().em_unit()), 8);
|
||||
auto search_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_search_input = new wxTextCtrl(m_search_item, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 | wxBORDER_NONE);
|
||||
m_search_item = new StaticBox(m_top_panel);
|
||||
StateColor box_colour(std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
|
||||
StateColor box_border_colour(std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Normal));
|
||||
|
||||
m_search_item->SetBackgroundColor(box_colour);
|
||||
m_search_item->SetBorderColor(box_border_colour);
|
||||
m_search_item->SetCornerRadius(5);
|
||||
|
||||
|
||||
//StateColor::darkModeColorFor(wxColour(238, 238, 238)), wxDefaultPosition, wxSize(m_top_panel->GetSize().GetWidth(), 3 * wxGetApp().em_unit()), 8);
|
||||
auto search_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_search_input = new TextInput(m_search_item, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 | wxBORDER_NONE);
|
||||
m_search_input->SetBackgroundColour(wxColour(238, 238, 238));
|
||||
m_search_input->SetForegroundColour(wxColour(43, 52, 54));
|
||||
m_search_input->SetFont(wxGetApp().bold_font());
|
||||
|
||||
search_sizer->Add(new wxWindow(m_search_item, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND | wxLEFT, 16);
|
||||
search_sizer->Add(m_search_input, 1, wxEXPAND | wxALL, wxGetApp().em_unit() / 2);
|
||||
search_sizer->Add(new wxWindow(m_search_item, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(6));
|
||||
search_sizer->Add(m_search_input, 1, wxEXPAND | wxALL, FromDIP(2));
|
||||
//bbl for linux
|
||||
//search_sizer->Add(new wxWindow(m_search_input, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND | wxLEFT, 16);
|
||||
|
||||
|
@ -655,14 +663,14 @@ void Tab::OnActivate()
|
|||
// Because of DarkMode we use our own Notebook (inherited from wxSiplebook) instead of wxNotebook
|
||||
// And it looks like first Layout of the page doesn't update a size of the m_presets_choice
|
||||
// So we have to set correct size explicitely
|
||||
if (wxSize ok_sz = wxSize(35 * m_em_unit, m_presets_choice->GetBestSize().y);
|
||||
/* if (wxSize ok_sz = wxSize(35 * m_em_unit, m_presets_choice->GetBestSize().y);
|
||||
ok_sz != m_presets_choice->GetSize()) {
|
||||
m_presets_choice->SetMinSize(ok_sz);
|
||||
m_presets_choice->SetSize(ok_sz);
|
||||
GetSizer()->GetItem(size_t(0))->GetSizer()->Layout();
|
||||
if (wxGetApp().tabs_as_menu())
|
||||
m_presets_choice->update();
|
||||
}
|
||||
}*/
|
||||
#endif // _MSW_DARK_MODE
|
||||
Refresh();
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "Notebook.hpp"
|
||||
#include "ParamsPanel.hpp"
|
||||
#include "Widgets/RoundedRectangle.hpp"
|
||||
#include "Widgets/TextInput.hpp"
|
||||
|
||||
class TabCtrl;
|
||||
|
||||
|
@ -182,8 +183,8 @@ protected:
|
|||
ScalableButton* m_undo_to_sys_btn;
|
||||
//ScalableButton* m_question_btn;
|
||||
ScalableButton* m_btn_search;
|
||||
RoundedRectangle * m_search_item;
|
||||
wxTextCtrl * m_search_input;
|
||||
StaticBox * m_search_item;
|
||||
TextInput * m_search_input;
|
||||
|
||||
// Cached bitmaps.
|
||||
// A "flag" icon to be displayned next to the preset name in the Tab's combo box.
|
||||
|
|
|
@ -15,7 +15,7 @@ END_EVENT_TABLE()
|
|||
|
||||
static wxColour BORDER_HOVER_COL = wxColour(0, 174, 66);
|
||||
|
||||
const static wxColour TAB_BUTTON_BG = wxColour(255, 255, 255, 255);
|
||||
const static wxColour TAB_BUTTON_BG = wxColour("#FEFFFF");
|
||||
const static wxColour TAB_BUTTON_SEL = wxColour(219, 253, 213, 255);
|
||||
|
||||
TabButton::TabButton()
|
||||
|
@ -24,13 +24,13 @@ TabButton::TabButton()
|
|||
{
|
||||
background_color = StateColor(
|
||||
std::make_pair(TAB_BUTTON_SEL, (int) StateColor::Checked),
|
||||
std::make_pair(*wxWHITE, (int) StateColor::Hovered),
|
||||
std::make_pair(*wxWHITE, (int) StateColor::Normal));
|
||||
std::make_pair(wxColour("#FEFFFF"), (int) StateColor::Hovered),
|
||||
std::make_pair(wxColour("#FEFFFF"), (int) StateColor::Normal));
|
||||
|
||||
border_color = StateColor(
|
||||
std::make_pair(*wxWHITE, (int) StateColor::Checked),
|
||||
std::make_pair(wxColour("#FEFFFF"), (int) StateColor::Checked),
|
||||
std::make_pair(BORDER_HOVER_COL, (int) StateColor::Hovered),
|
||||
std::make_pair(*wxWHITE, (int) StateColor::Normal));
|
||||
std::make_pair(wxColour("#FEFFFF"), (int)StateColor::Normal));
|
||||
}
|
||||
|
||||
TabButton::TabButton(wxWindow *parent, wxString text, ScalableBitmap &bmp, long style, int iconSize)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
wxDEFINE_EVENT(wxCUSTOMEVT_TABBOOK_SEL_CHANGED, wxCommandEvent);
|
||||
|
||||
const static wxColour TAB_BUTTON_BG = wxColour(255, 255, 255, 255);
|
||||
const static wxColour TAB_BUTTON_BG = wxColour("#FEFFFF");
|
||||
const static wxColour TAB_BUTTON_SEL = wxColour(219, 253, 213, 255);
|
||||
|
||||
static const wxFont& TAB_BUTTON_FONT = Label::Body_14;
|
||||
|
|
|
@ -798,6 +798,7 @@ UnsavedChangesDialog::UnsavedChangesDialog(const wxString &caption, const wxStri
|
|||
{
|
||||
build(Preset::TYPE_INVALID, nullptr, "", header);
|
||||
this->CenterOnScreen();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
UnsavedChangesDialog::UnsavedChangesDialog(Preset::Type type, PresetCollection *dependent_presets, const std::string &new_selected_preset, bool no_transfer)
|
||||
|
@ -812,17 +813,17 @@ UnsavedChangesDialog::UnsavedChangesDialog(Preset::Type type, PresetCollection *
|
|||
m_buttons &= ~ActionButtons::TRANSFER;
|
||||
build(type, dependent_presets, new_selected_preset);
|
||||
this->CenterOnScreen();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
|
||||
void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_presets, const std::string &new_selected_preset, const wxString &header)
|
||||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
// icon
|
||||
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
|
||||
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
|
||||
|
||||
|
||||
|
||||
wxBoxSizer *m_sizer_main = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
m_top_line = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
|
||||
|
@ -947,7 +948,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_
|
|||
if (focus) {
|
||||
(*btn)->SetBackgroundColor(btn_bg_green);
|
||||
(*btn)->SetBorderColor(wxColour(0, 174, 66));
|
||||
(*btn)->SetTextColor(wxColour(255, 255, 255));
|
||||
(*btn)->SetTextColor(wxColour("#FFFFFE"));
|
||||
} else {
|
||||
(*btn)->SetTextColor(wxColour(107, 107, 107));
|
||||
}
|
||||
|
@ -1767,7 +1768,7 @@ DiffPresetDialog::DiffPresetDialog(MainFrame* mainframe)
|
|||
|
||||
int border = 10;
|
||||
int em = em_unit();
|
||||
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
assert(wxGetApp().preset_bundle);
|
||||
|
||||
m_preset_bundle_left = std::make_unique<PresetBundle>(*wxGetApp().preset_bundle);
|
||||
|
@ -1853,6 +1854,7 @@ DiffPresetDialog::DiffPresetDialog(MainFrame* mainframe)
|
|||
this->SetMinSize(wxSize(80 * em, 30 * em));
|
||||
this->SetSizer(topSizer);
|
||||
topSizer->SetSizeHints(this);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void DiffPresetDialog::update_controls_visibility(Preset::Type type /* = Preset::TYPE_INVALID*/)
|
||||
|
@ -1893,6 +1895,7 @@ void DiffPresetDialog::show(Preset::Type type /* = Preset::TYPE_INVALID*/)
|
|||
Fit();
|
||||
|
||||
update_tree();
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
|
||||
// if this dialog is shown it have to be Hide and show again to be placed on the very Top of windows
|
||||
if (IsShown())
|
||||
|
|
|
@ -237,6 +237,7 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector<Update> &updates, bool force_
|
|||
m_sizer_main->Fit(this);
|
||||
|
||||
Centre(wxBOTH);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void MsgUpdateConfig::on_dpi_changed(const wxRect &suggested_rect) {}
|
||||
|
|
|
@ -150,7 +150,7 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
|
|||
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->SetTextColor(wxColour("#FFFFFE"));
|
||||
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));
|
||||
|
@ -212,6 +212,7 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin
|
|||
|
||||
m_staticText_release_note->Bind(wxEVT_LEFT_DOWN, &MachineInfoPanel::on_show_release_note, this);
|
||||
m_button_upgrade_firmware->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MachineInfoPanel::on_upgrade_firmware), NULL, this);
|
||||
wxGetApp().UpdateDarkUIWin(this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -231,6 +232,7 @@ wxPanel *MachineInfoPanel::create_caption_panel(wxWindow *parent)
|
|||
m_caption_sizer->Add(m_upgrade_status_img, 0, wxALIGN_CENTER_VERTICAL | wxALL, FromDIP(5));
|
||||
|
||||
m_caption_text = new wxStaticText(caption_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize);
|
||||
m_caption_text->SetForegroundColour("#262E30");
|
||||
m_caption_text->Wrap(-1);
|
||||
m_caption_sizer->Add(m_caption_text, 1, wxALIGN_CENTER_VERTICAL | wxALL, FromDIP(5));
|
||||
|
||||
|
@ -868,14 +870,17 @@ bool UpgradePanel::Show(bool show)
|
|||
ams_sizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
|
||||
|
||||
m_staticText_ams = new wxStaticText(this, wxID_ANY, "-", wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_staticText_ams->SetForegroundColour("#262E30");
|
||||
m_staticText_ams->SetFont(Label::Head_14);
|
||||
m_staticText_ams->Wrap(-1);
|
||||
|
||||
auto m_staticText_ams_sn = new wxStaticText(this, wxID_ANY, _L("Serial:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_staticText_ams_sn->SetForegroundColour("#262E30");
|
||||
m_staticText_ams_sn->Wrap(-1);
|
||||
m_staticText_ams_sn->SetFont(Label::Head_14);
|
||||
|
||||
m_staticText_ams_sn_val = new wxStaticText(this, wxID_ANY, "-", wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_staticText_ams_sn_val->SetForegroundColour("#262E30");
|
||||
m_staticText_ams_sn_val->Wrap(-1);
|
||||
|
||||
wxBoxSizer *m_ams_ver_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
@ -890,9 +895,11 @@ bool UpgradePanel::Show(bool show)
|
|||
auto m_staticText_ams_ver = new wxStaticText(this, wxID_ANY, _L("Version:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_staticText_ams_ver->Wrap(-1);
|
||||
m_staticText_ams_ver->SetFont(Label::Head_14);
|
||||
m_staticText_ams_ver->SetForegroundColour("#262E30");
|
||||
m_ams_ver_sizer->Add(m_staticText_ams_ver, 0, wxALL, FromDIP(5));
|
||||
|
||||
m_staticText_ams_ver_val = new wxStaticText(this, wxID_ANY, "-", wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_staticText_ams_ver_val->SetForegroundColour("#262E30");
|
||||
m_staticText_ams_ver_val->Wrap(-1);
|
||||
|
||||
ams_sizer->Add(m_staticText_ams, 0, wxALIGN_RIGHT | wxALL, FromDIP(5));
|
||||
|
|
|
@ -109,6 +109,7 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
|
|||
SetStartPage(BBL_REGION);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", finished");
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
GuideFrame::~GuideFrame()
|
||||
|
|
|
@ -226,7 +226,7 @@ void AMSrefresh::paintEvent(wxPaintEvent &evt)
|
|||
wxSize size = GetSize();
|
||||
wxPaintDC dc(this);
|
||||
|
||||
auto colour = AMS_CONTROL_GRAY700;
|
||||
auto colour = StateColor::darkModeColorFor(AMS_CONTROL_GRAY700);
|
||||
if (!wxWindow::IsEnabled()) { colour = AMS_CONTROL_GRAY500; }
|
||||
|
||||
auto pot = wxPoint((size.x - m_bitmap_selected.GetBmpSize().x) / 2, (size.y - m_bitmap_selected.GetBmpSize().y) / 2);
|
||||
|
@ -347,7 +347,7 @@ void AMSextruderImage::doRender(wxDC &dc)
|
|||
auto size = GetSize();
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(m_colour);
|
||||
dc.DrawRectangle(0, 0, size.x, size.y - FromDIP(5));
|
||||
dc.DrawRectangle(0, FromDIP(18), size.x, size.y - FromDIP(18) - FromDIP(5));
|
||||
dc.DrawBitmap(m_ams_extruder.bmp(), wxPoint((size.x - m_ams_extruder.GetBmpSize().x) / 2, (size.y - m_ams_extruder.GetBmpSize().y) / 2));
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,6 @@ AMSextruderImage::AMSextruderImage(wxWindow *parent, wxWindowID id, const wxPoin
|
|||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_ams_extruder = ScalableBitmap(this, "monitor_ams_extruder",55);
|
||||
|
||||
SetSize(AMS_EXTRUDER_BITMAP_SIZE);
|
||||
SetMinSize(AMS_EXTRUDER_BITMAP_SIZE);
|
||||
SetMaxSize(AMS_EXTRUDER_BITMAP_SIZE);
|
||||
|
@ -393,7 +392,7 @@ void AMSextruder::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
|
|||
wxBoxSizer *m_sizer_body = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
m_bitmap_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, AMS_EXTRUDER_BITMAP_SIZE, wxTAB_TRAVERSAL);
|
||||
m_bitmap_panel->SetBackgroundColour(wxColour(AMS_EXTRUDER_DEF_COLOUR));
|
||||
m_bitmap_panel->SetBackgroundColour(AMS_EXTRUDER_DEF_COLOUR);
|
||||
m_bitmap_panel->SetDoubleBuffered(true);
|
||||
m_bitmap_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
|
@ -1080,8 +1079,8 @@ void AMSItem::render(wxDC &dc)
|
|||
void AMSItem::doRender(wxDC &dc)
|
||||
{
|
||||
wxSize size = GetSize();
|
||||
dc.SetPen(wxPen(m_background_colour));
|
||||
dc.SetBrush(wxBrush(m_background_colour));
|
||||
dc.SetPen(wxPen(StateColor::darkModeColorFor(m_background_colour)));
|
||||
dc.SetBrush(wxBrush(StateColor::darkModeColorFor(m_background_colour)));
|
||||
dc.DrawRoundedRectangle(0, 0, size.x, size.y, 3);
|
||||
|
||||
auto left = m_padding;
|
||||
|
@ -1219,6 +1218,7 @@ void AmsCans::Update(AMSinfo info)
|
|||
void AmsCans::AddCan(Caninfo caninfo, int canindex, int maxcan)
|
||||
{
|
||||
auto amscan = new wxWindow(this, wxID_ANY);
|
||||
amscan->SetBackgroundColour(AMS_CONTROL_DEF_BLOCK_BK_COLOUR);
|
||||
wxBoxSizer *m_sizer_ams = new wxBoxSizer(wxVERTICAL);
|
||||
m_sizer_ams->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(14));
|
||||
auto m_panel_refresh = new AMSrefresh(amscan, wxID_ANY, m_can_count + 1, caninfo);
|
||||
|
@ -1445,7 +1445,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
m_panel_can = new StaticBox(m_amswin, wxID_ANY, wxDefaultPosition, AMS_CANS_SIZE, wxBORDER_NONE);
|
||||
m_panel_can->SetMinSize(AMS_CANS_SIZE);
|
||||
m_panel_can->SetCornerRadius(FromDIP(10));
|
||||
m_panel_can->SetBackgroundColor(AMS_CONTROL_DEF_BLOCK_BK_COLOUR);
|
||||
m_panel_can->SetBackgroundColor(StateColor(std::pair<wxColour, int>(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, StateColor::Normal)));
|
||||
|
||||
m_sizer_cans = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
|
@ -1515,7 +1515,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
m_button_extruder_feed = new Button(m_amswin, _L("Load Filament"));
|
||||
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->SetTextColor(wxColour("#FFFFFE"));
|
||||
m_button_extruder_feed->SetFont(Label::Body_13);
|
||||
|
||||
m_button_extruder_back = new Button(m_amswin, _L("Unload Filament"));
|
||||
|
@ -1575,12 +1575,14 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
m_button_guide = new Button(m_amswin, _L("Guide"));
|
||||
m_button_guide->SetFont(Label::Body_13);
|
||||
m_button_guide->SetCornerRadius(FromDIP(12));
|
||||
m_button_guide->SetBorderColor(btn_bd_white);
|
||||
m_button_guide->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
m_button_guide->SetBackgroundColor(btn_bg_white);
|
||||
|
||||
m_button_retry = new Button(m_amswin, _L("Retry"));
|
||||
m_button_retry->SetFont(Label::Body_13);
|
||||
m_button_retry->SetCornerRadius(FromDIP(12));
|
||||
m_button_retry->SetBorderColor(btn_bd_white);
|
||||
m_button_retry->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
m_button_retry->SetBackgroundColor(btn_bg_white);
|
||||
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include <wx/dcgraph.h>
|
||||
|
||||
StateColor blank_bg(StateColor(std::make_pair(wxColour("#FFFFFF"), (int)StateColor::Normal)));
|
||||
static const wxColour BUTTON_BG_COL = wxColour("#EEEEEE");
|
||||
static const wxColour BUTTON_IN_BG_COL = wxColour("#CECECE");
|
||||
|
||||
static const wxColour bd = wxColour(0, 174, 66);
|
||||
static const wxColour BUTTON_BG_COL = wxColour(238, 238, 238);
|
||||
static const wxColour BUTTON_IN_BG_COL = wxColour(206, 206, 206);
|
||||
static const wxColour blank_bg = wxColour(0xFFFFFF);
|
||||
static const wxColour text_num_color = wxColour(0x898989);
|
||||
static const wxColour BUTTON_PRESS_COL = wxColour(172, 172, 172);
|
||||
static const double sqrt2 = std::sqrt(2);
|
||||
|
@ -155,16 +156,16 @@ void AxisCtrlButton::render(wxDC& dc)
|
|||
wxGraphicsPath outer_path = gc->CreatePath();
|
||||
outer_path.AddCircle(0, 0, r_outer);
|
||||
outer_path.AddCircle(0, 0, r_inner);
|
||||
gc->SetPen(BUTTON_BG_COL);
|
||||
gc->SetBrush(BUTTON_BG_COL);
|
||||
gc->SetPen(StateColor::darkModeColorFor(BUTTON_BG_COL));
|
||||
gc->SetBrush(StateColor::darkModeColorFor(BUTTON_BG_COL));
|
||||
gc->DrawPath(outer_path);
|
||||
|
||||
//draw the inner ring
|
||||
wxGraphicsPath inner_path = gc->CreatePath();
|
||||
inner_path.AddCircle(0, 0, r_inner);
|
||||
inner_path.AddCircle(0, 0, r_blank);
|
||||
gc->SetPen(BUTTON_IN_BG_COL);
|
||||
gc->SetBrush(BUTTON_IN_BG_COL);
|
||||
gc->SetPen(StateColor::darkModeColorFor(BUTTON_IN_BG_COL));
|
||||
gc->SetBrush(StateColor::darkModeColorFor(BUTTON_IN_BG_COL));
|
||||
gc->DrawPath(inner_path);
|
||||
|
||||
//draw an arc in corresponding position
|
||||
|
@ -187,8 +188,8 @@ void AxisCtrlButton::render(wxDC& dc)
|
|||
}
|
||||
|
||||
//draw rectangle gap
|
||||
gc->SetPen(blank_bg);
|
||||
gc->SetBrush(blank_bg);
|
||||
gc->SetPen(blank_bg.colorForStates(StateColor::Normal));
|
||||
gc->SetBrush(blank_bg.colorForStates(StateColor::Normal));
|
||||
gc->PushState();
|
||||
gc->Rotate(-PI / 4);
|
||||
gc->DrawRectangle(-sqrt2 * size.x / 2, -sqrt2 * gap / 2, sqrt2 * size.x, sqrt2 * gap);
|
||||
|
@ -205,8 +206,8 @@ void AxisCtrlButton::render(wxDC& dc)
|
|||
gc->SetPen(wxPen(border_color.colorForStates(states), 2));
|
||||
gc->SetBrush(wxBrush(background_color.colorForStates(states)));
|
||||
} else {
|
||||
gc->SetPen(BUTTON_BG_COL);
|
||||
gc->SetBrush(BUTTON_BG_COL);
|
||||
gc->SetPen(StateColor::darkModeColorFor(BUTTON_BG_COL));
|
||||
gc->SetBrush(StateColor::darkModeColorFor(BUTTON_BG_COL));
|
||||
}
|
||||
gc->DrawPath(home_path);
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ ProgressDialog::ProgressDialog(const wxString &title, const wxString &message, i
|
|||
Create(title, message, maximum, parent, style);
|
||||
Bind(wxEVT_PAINT, &ProgressDialog::OnPaint, this);
|
||||
Bind(wxEVT_CLOSE_WINDOW, &ProgressDialog::OnClose, this);
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void ProgressDialog::OnPaint(wxPaintEvent &evt) {}
|
||||
|
|
|
@ -33,15 +33,17 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly
|
|||
border_color.append(0x00AE42, StateColor::Normal);
|
||||
|
||||
text_color.append(0xACACAC, StateColor::Disabled);
|
||||
text_color.append(0xFFFFFF, StateColor::Pressed);
|
||||
text_color.append(0xFFFFFF, StateColor::Hovered);
|
||||
text_color.append(0xFFFFFF, StateColor::Normal);
|
||||
text_color.append(0xFEFEFE, StateColor::Pressed);
|
||||
text_color.append(0xFEFEFE, StateColor::Hovered);
|
||||
text_color.append(0xFEFEFE, StateColor::Normal);
|
||||
|
||||
background_color.append(0x6B6B6B, StateColor::Disabled);
|
||||
background_color.append(wxColour(23, 129, 63), StateColor::Pressed);
|
||||
background_color.append(wxColour(48, 221, 112), StateColor::Hovered);
|
||||
background_color.append(0x00AE42, StateColor::Normal);
|
||||
|
||||
SetBottomColour(wxColour("#3B4446"));
|
||||
|
||||
state_handler.attach({ &border_color, &text_color, &background_color });
|
||||
state_handler.update_binds();
|
||||
|
||||
|
@ -194,7 +196,7 @@ void SideButton::dorender(wxDC& dc, wxDC& text_dc)
|
|||
|
||||
// draw background
|
||||
dc.SetPen(wxNullPen);
|
||||
dc.SetBrush(bottom_color);
|
||||
dc.SetBrush(StateColor::darkModeColorFor(bottom_color));
|
||||
dc.DrawRectangle(0, 0, size.x, size.y);
|
||||
|
||||
int states = state_handler.states();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <wx/dcmemory.h>
|
||||
#include <wx/dcgraph.h>
|
||||
#include "Label.hpp"
|
||||
#include "StateColor.hpp"
|
||||
#include "../wxExtensions.hpp"
|
||||
#include "../I18N.hpp"
|
||||
#include "../GUI.hpp"
|
||||
|
@ -12,7 +13,7 @@ namespace Slic3r { namespace GUI {
|
|||
wxPanel::Create(parent, id, pos, wxSize(0, FromDIP(50)));
|
||||
Bind(wxEVT_PAINT, &SideTools::OnPaint, this);
|
||||
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
SetBackgroundColour(wxColour("#FEFFFF"));
|
||||
|
||||
m_printing_img = ScalableBitmap(this, "printer", 16);
|
||||
m_arrow_img = ScalableBitmap(this, "monitor_arrow", 14);
|
||||
|
@ -155,7 +156,7 @@ void SideTools::doRender(wxDC &dc)
|
|||
left += (m_arrow_img.GetBmpSize().x + FromDIP(6));
|
||||
dc.SetFont(::Label::Body_14);
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
dc.SetTextForeground(SIDE_TOOLS_GREY900);
|
||||
dc.SetTextForeground(StateColor::darkModeColorFor(SIDE_TOOLS_GREY900));
|
||||
|
||||
auto sizet = dc.GetTextExtent(m_dev_name);
|
||||
auto text_end = size.x - m_wifi_none_img.GetBmpSize().x - 20;
|
||||
|
|
|
@ -33,7 +33,11 @@ static std::map<wxColour, wxColour> gDarkColors{
|
|||
{"#A6A9AA", "#2D2D29"},
|
||||
{"#363636", "#B2B3B5"},
|
||||
{"#F0F0F1", "#404040"},
|
||||
{"#9E9E9E", "#53545A"},
|
||||
{"#D7E8DE", "#1F2B27"},
|
||||
//{"#F0F0F0", "#3E3E44"},
|
||||
};
|
||||
|
||||
std::map<wxColour, wxColour> const & StateColor::GetDarkMap()
|
||||
{
|
||||
return gDarkColors;
|
||||
|
@ -64,7 +68,7 @@ wxColour StateColor::lightModeColorFor(wxColour const &color)
|
|||
auto iter = gLightColors.find(color);
|
||||
wxFAIL(iter != gLightColors.end());
|
||||
if (iter != gLightColors.end()) return iter->second;
|
||||
return *wxRED;
|
||||
return color;
|
||||
}
|
||||
|
||||
wxColour StateColor::darkModeColorFor(wxColour const &color) { return darkModeColorFor2(color); }
|
||||
|
|
|
@ -19,7 +19,7 @@ END_EVENT_TABLE()
|
|||
|
||||
|
||||
TempInput::TempInput()
|
||||
: label_color(std::make_pair(wxColour(0xAC,0xAC,0xAC), (int) StateColor::Disabled),std::make_pair(0x323A3D, (int) StateColor::Normal))
|
||||
: label_color(std::make_pair(wxColour(0xAC,0xAC,0xAC), (int) StateColor::Disabled),std::make_pair(0x323A3C, (int) StateColor::Normal))
|
||||
, text_color(std::make_pair(wxColour(0xAC,0xAC,0xAC), (int) StateColor::Disabled), std::make_pair(0x6B6B6B, (int) StateColor::Normal))
|
||||
{
|
||||
hover = false;
|
||||
|
@ -46,6 +46,7 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString
|
|||
state_handler.attach({&label_color, &text_color});
|
||||
state_handler.update_binds();
|
||||
text_ctrl = new wxTextCtrl(this, wxID_ANY, text, {5, 5}, wxDefaultSize, wxTE_PROCESS_ENTER | wxBORDER_NONE, wxTextValidator(wxFILTER_NUMERIC), wxTextCtrlNameStr);
|
||||
text_ctrl->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
text_ctrl->SetMaxLength(3);
|
||||
state_handler.attach_child(text_ctrl);
|
||||
text_ctrl->Bind(wxEVT_SET_FOCUS, [this](auto &e) {
|
||||
|
@ -417,6 +418,8 @@ void TempInput::render(wxDC &dc)
|
|||
} else {
|
||||
pt.y = (size.y - labelSize.y) / 2;
|
||||
}
|
||||
|
||||
dc.SetTextForeground(StateColor::darkModeColorFor("#323A3C"));
|
||||
dc.DrawText(text, pt);
|
||||
|
||||
// separator
|
||||
|
|
|
@ -184,6 +184,8 @@ WipingDialog::WipingDialog(wxWindow* parent, const std::vector<float>& matrix, c
|
|||
else
|
||||
e.Skip();
|
||||
});
|
||||
|
||||
wxGetApp().UpdateDlgDarkUI(this);
|
||||
}
|
||||
|
||||
void WipingPanel::create_panels(wxWindow* parent, const int num) {
|
||||
|
|
|
@ -0,0 +1,821 @@
|
|||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/settings.h"
|
||||
#include "wx/font.h"
|
||||
|
||||
#include "wx/msw/colour.h"
|
||||
#include "dark_mode.hpp"
|
||||
#include "dark_mode/dark_mode.hpp"
|
||||
#include "dark_mode/UAHMenuBar.hpp"
|
||||
|
||||
#include <Shlwapi.h>
|
||||
#include "windowsx.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include <cmath>
|
||||
#define WINAPI_LAMBDA WINAPI
|
||||
#else
|
||||
#define WINAPI_LAMBDA
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma comment(lib, "uxtheme.lib")
|
||||
#endif
|
||||
|
||||
namespace NppDarkMode
|
||||
{
|
||||
bool IsEnabled()
|
||||
{
|
||||
return g_darkModeEnabled;
|
||||
}
|
||||
|
||||
bool IsSupported()
|
||||
{
|
||||
return g_darkModeSupported;
|
||||
}
|
||||
|
||||
bool IsSystemMenuEnabled()
|
||||
{
|
||||
return g_SystemMenuEnabled;
|
||||
}
|
||||
|
||||
COLORREF InvertLightness(COLORREF c)
|
||||
{
|
||||
WORD h = 0;
|
||||
WORD s = 0;
|
||||
WORD l = 0;
|
||||
ColorRGBToHLS(c, &h, &l, &s);
|
||||
|
||||
l = 240 - l;
|
||||
|
||||
COLORREF invert_c = ColorHLSToRGB(h, l, s);
|
||||
|
||||
return invert_c;
|
||||
}
|
||||
|
||||
COLORREF InvertLightnessSofter(COLORREF c)
|
||||
{
|
||||
WORD h = 0;
|
||||
WORD s = 0;
|
||||
WORD l = 0;
|
||||
ColorRGBToHLS(c, &h, &l, &s);
|
||||
|
||||
l = std::min(240 - l, 211);
|
||||
|
||||
COLORREF invert_c = ColorHLSToRGB(h, l, s);
|
||||
|
||||
return invert_c;
|
||||
}
|
||||
|
||||
COLORREF GetBackgroundColor()
|
||||
{
|
||||
return IsEnabled() ? RGB(0x2B, 0x2B, 0x2B) : wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR).GetRGB();
|
||||
}
|
||||
|
||||
COLORREF GetSofterBackgroundColor()
|
||||
{
|
||||
return IsEnabled() ? RGB(0x40, 0x40, 0x40) : RGB(0xD9, 0xD9, 0xD9); //RGB(0x78, 0x78, 0x78);
|
||||
}
|
||||
|
||||
COLORREF GetTextColor()
|
||||
{
|
||||
return IsEnabled() ? RGB(0xF0, 0xF0, 0xF0) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT).GetRGB();
|
||||
}
|
||||
|
||||
COLORREF GetHotTextColor()
|
||||
{
|
||||
return IsEnabled() ? RGB(0xFF, 0xFF, 0xFF) : wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVEBORDER).GetRGB();
|
||||
}
|
||||
|
||||
COLORREF GetSofterTextColor()
|
||||
{
|
||||
return IsEnabled() ? RGB(0xF0, 0xF0, 0xF0) : RGB(0x64, 0x64, 0x64);
|
||||
}
|
||||
|
||||
COLORREF GetDarkerTextColor()
|
||||
{
|
||||
return RGB(0xC0, 0xC0, 0xC0);
|
||||
}
|
||||
|
||||
COLORREF GetEdgeColor()
|
||||
{
|
||||
return RGB(0x80, 0x80, 0x80);
|
||||
}
|
||||
|
||||
HBRUSH GetBackgroundBrush()
|
||||
{
|
||||
static HBRUSH g_hbrBackground = ::CreateSolidBrush(GetBackgroundColor());
|
||||
return g_hbrBackground;
|
||||
}
|
||||
|
||||
HPEN GetDarkerTextPen()
|
||||
{
|
||||
static HPEN g_hpDarkerText = ::CreatePen(PS_SOLID, 1, GetDarkerTextColor());
|
||||
return g_hpDarkerText;
|
||||
}
|
||||
|
||||
HPEN GetEdgePen()
|
||||
{
|
||||
static HPEN g_hpEdgePen = ::CreatePen(PS_SOLID, 1, GetEdgeColor());
|
||||
return g_hpEdgePen;
|
||||
}
|
||||
|
||||
HBRUSH GetSofterBackgroundBrush()
|
||||
{
|
||||
static HBRUSH g_hbrSofterBackground = ::CreateSolidBrush(GetSofterBackgroundColor());
|
||||
return g_hbrSofterBackground;
|
||||
}
|
||||
|
||||
// handle events
|
||||
|
||||
bool OnSettingChange(HWND hwnd, LPARAM lParam) // true if dark mode toggled
|
||||
{
|
||||
bool toggled = false;
|
||||
if (IsColorSchemeChangeMessage(lParam))
|
||||
{
|
||||
bool darkModeWasEnabled = g_darkModeEnabled;
|
||||
g_darkModeEnabled = _ShouldAppsUseDarkMode() && !IsHighContrast();
|
||||
|
||||
NppDarkMode::RefreshTitleBarThemeColor(hwnd);
|
||||
|
||||
if (!!darkModeWasEnabled != !!g_darkModeEnabled) {
|
||||
toggled = true;
|
||||
RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN);
|
||||
}
|
||||
}
|
||||
|
||||
return toggled;
|
||||
}
|
||||
|
||||
// processes messages related to UAH / custom menubar drawing.
|
||||
// return true if handled, false to continue with normal processing in your wndproc
|
||||
bool UAHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr)
|
||||
{
|
||||
if (!IsEnabled())
|
||||
return false;
|
||||
|
||||
static HTHEME g_menuTheme = nullptr;
|
||||
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
switch (message)
|
||||
{
|
||||
case WM_UAHDRAWMENU:
|
||||
{
|
||||
UAHMENU* pUDM = (UAHMENU*)lParam;
|
||||
RECT rc = { 0 };
|
||||
|
||||
// get the menubar rect
|
||||
{
|
||||
MENUBARINFO mbi = { sizeof(mbi) };
|
||||
GetMenuBarInfo(hWnd, OBJID_MENU, 0, &mbi);
|
||||
|
||||
RECT rcWindow;
|
||||
GetWindowRect(hWnd, &rcWindow);
|
||||
|
||||
// the rcBar is offset by the window rect
|
||||
rc = mbi.rcBar;
|
||||
OffsetRect(&rc, -rcWindow.left, -rcWindow.top);
|
||||
|
||||
rc.top -= 1;
|
||||
}
|
||||
|
||||
FillRect(pUDM->hdc, &rc, GetBackgroundBrush());
|
||||
|
||||
*lr = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
case WM_UAHDRAWMENUITEM:
|
||||
{
|
||||
UAHDRAWMENUITEM* pUDMI = (UAHDRAWMENUITEM*)lParam;
|
||||
|
||||
// get the menu item string
|
||||
wchar_t menuString[256] = { 0 };
|
||||
MENUITEMINFO mii = { sizeof(mii), MIIM_STRING };
|
||||
{
|
||||
mii.dwTypeData = menuString;
|
||||
mii.cch = (sizeof(menuString) / 2) - 1;
|
||||
|
||||
GetMenuItemInfo(pUDMI->um.hmenu, pUDMI->umi.iPosition, TRUE, &mii);
|
||||
}
|
||||
|
||||
// get the item state for drawing
|
||||
|
||||
DWORD dwFlags = DT_CENTER | DT_SINGLELINE | DT_VCENTER;
|
||||
|
||||
int iTextStateID = MPI_NORMAL;
|
||||
int iBackgroundStateID = MPI_NORMAL;
|
||||
{
|
||||
if ((pUDMI->dis.itemState & ODS_INACTIVE) | (pUDMI->dis.itemState & ODS_DEFAULT)) {
|
||||
// normal display
|
||||
iTextStateID = MPI_NORMAL;
|
||||
iBackgroundStateID = MPI_NORMAL;
|
||||
}
|
||||
if (pUDMI->dis.itemState & ODS_HOTLIGHT) {
|
||||
// hot tracking
|
||||
iTextStateID = MPI_HOT;
|
||||
iBackgroundStateID = MPI_HOT;
|
||||
}
|
||||
if (pUDMI->dis.itemState & ODS_SELECTED) {
|
||||
// clicked -- MENU_POPUPITEM has no state for this, though MENU_BARITEM does
|
||||
iTextStateID = MPI_HOT;
|
||||
iBackgroundStateID = MPI_HOT;
|
||||
}
|
||||
if ((pUDMI->dis.itemState & ODS_GRAYED) || (pUDMI->dis.itemState & ODS_DISABLED)) {
|
||||
// disabled / grey text
|
||||
iTextStateID = MPI_DISABLED;
|
||||
iBackgroundStateID = MPI_DISABLED;
|
||||
}
|
||||
if (pUDMI->dis.itemState & ODS_NOACCEL) {
|
||||
dwFlags |= DT_HIDEPREFIX;
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_menuTheme) {
|
||||
g_menuTheme = OpenThemeData(hWnd, L"Menu");
|
||||
}
|
||||
|
||||
if (iBackgroundStateID == MPI_NORMAL || iBackgroundStateID == MPI_DISABLED) {
|
||||
FillRect(pUDMI->um.hdc, &pUDMI->dis.rcItem, NppDarkMode::GetBackgroundBrush());
|
||||
}
|
||||
else if (iBackgroundStateID == MPI_HOT) {
|
||||
FillRect(pUDMI->um.hdc, &pUDMI->dis.rcItem, NppDarkMode::GetSofterBackgroundBrush());
|
||||
}
|
||||
else {
|
||||
DrawThemeBackground(g_menuTheme, pUDMI->um.hdc, MENU_POPUPITEM, iBackgroundStateID, &pUDMI->dis.rcItem, nullptr);
|
||||
}
|
||||
DTTOPTS dttopts = { sizeof(dttopts) };
|
||||
if (iTextStateID == MPI_NORMAL || iTextStateID == MPI_HOT) {
|
||||
dttopts.dwFlags |= DTT_TEXTCOLOR;
|
||||
dttopts.crText = NppDarkMode::GetTextColor();
|
||||
}
|
||||
DrawThemeTextEx(g_menuTheme, pUDMI->um.hdc, MENU_POPUPITEM, iTextStateID, menuString, mii.cch, dwFlags, &pUDMI->dis.rcItem, &dttopts);
|
||||
|
||||
*lr = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
case WM_THEMECHANGED:
|
||||
{
|
||||
if (g_menuTheme) {
|
||||
CloseThemeData(g_menuTheme);
|
||||
g_menuTheme = nullptr;
|
||||
}
|
||||
// continue processing in main wndproc
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawUAHMenuNCBottomLine(HWND hWnd)
|
||||
{
|
||||
MENUBARINFO mbi = { sizeof(mbi) };
|
||||
if (!GetMenuBarInfo(hWnd, OBJID_MENU, 0, &mbi))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RECT rcClient = { 0 };
|
||||
GetClientRect(hWnd, &rcClient);
|
||||
MapWindowPoints(hWnd, nullptr, (POINT*)&rcClient, 2);
|
||||
|
||||
RECT rcWindow = { 0 };
|
||||
GetWindowRect(hWnd, &rcWindow);
|
||||
|
||||
OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top);
|
||||
|
||||
// the rcBar is offset by the window rect
|
||||
RECT rcAnnoyingLine = rcClient;
|
||||
rcAnnoyingLine.bottom = rcAnnoyingLine.top;
|
||||
rcAnnoyingLine.top--;
|
||||
|
||||
HDC hdc = GetWindowDC(hWnd);
|
||||
FillRect(hdc, &rcAnnoyingLine, GetBackgroundBrush());
|
||||
ReleaseDC(hWnd, hdc);
|
||||
}
|
||||
|
||||
// from DarkMode.h
|
||||
|
||||
void InitDarkMode(bool set_dark_mode, bool set_sys_menu)
|
||||
{
|
||||
::InitDarkMode();
|
||||
g_SystemMenuEnabled = set_sys_menu;
|
||||
SetDarkMode(set_dark_mode);
|
||||
}
|
||||
|
||||
void SetDarkMode(bool dark_mode)
|
||||
{
|
||||
g_darkModeEnabled = dark_mode;
|
||||
|
||||
if (!IsSupported())
|
||||
return;
|
||||
|
||||
AllowDarkModeForApp(dark_mode);
|
||||
if (g_SystemMenuEnabled && _FlushMenuThemes)
|
||||
_FlushMenuThemes();
|
||||
FixDarkScrollBar();
|
||||
}
|
||||
|
||||
void SetSystemMenuForApp(bool set_sys_menu)
|
||||
{
|
||||
if (IsSupported())
|
||||
g_SystemMenuEnabled = set_sys_menu;
|
||||
}
|
||||
|
||||
void AllowDarkModeForApp(bool allow)
|
||||
{
|
||||
if (IsSupported())
|
||||
::AllowDarkModeForApp(allow);
|
||||
}
|
||||
|
||||
bool AllowDarkModeForWindow(HWND hWnd, bool allow)
|
||||
{
|
||||
if (IsSupported())
|
||||
return ::AllowDarkModeForWindow(hWnd, allow);
|
||||
return false;
|
||||
}
|
||||
|
||||
void RefreshTitleBarThemeColor(HWND hWnd)
|
||||
{
|
||||
if (IsSupported())
|
||||
::RefreshTitleBarThemeColor(hWnd);
|
||||
}
|
||||
|
||||
void EnableDarkScrollBarForWindowAndChildren(HWND hwnd)
|
||||
{
|
||||
if (IsSupported())
|
||||
::EnableDarkScrollBarForWindowAndChildren(hwnd);
|
||||
}
|
||||
|
||||
void SetDarkTitleBar(HWND hwnd)
|
||||
{
|
||||
if (!IsSupported())
|
||||
return;
|
||||
|
||||
::AllowDarkModeForWindow(hwnd, IsEnabled());
|
||||
::RefreshTitleBarThemeColor(hwnd);
|
||||
SetDarkExplorerTheme(hwnd);
|
||||
}
|
||||
|
||||
void SetDarkExplorerTheme(HWND hwnd)
|
||||
{
|
||||
if (IsSupported())
|
||||
SetWindowTheme(hwnd, IsEnabled() ? L"DarkMode_Explorer" : nullptr, nullptr);
|
||||
}
|
||||
|
||||
void SetDarkListView(HWND hwnd)
|
||||
{
|
||||
if (!IsSupported())
|
||||
return;
|
||||
bool useDark = IsEnabled();
|
||||
|
||||
if (HWND hHeader = ListView_GetHeader(hwnd)) {
|
||||
_AllowDarkModeForWindow(hHeader, useDark);
|
||||
SetWindowTheme(hHeader, useDark ? L"ItemsView" : nullptr, nullptr);
|
||||
}
|
||||
|
||||
_AllowDarkModeForWindow(hwnd, useDark);
|
||||
SetWindowTheme(hwnd, L"Explorer", nullptr);
|
||||
}
|
||||
|
||||
void SetDarkListViewHeader(HWND hHeader)
|
||||
{
|
||||
if (!IsSupported())
|
||||
return;
|
||||
bool useDark = IsEnabled();
|
||||
|
||||
_AllowDarkModeForWindow(hHeader, useDark);
|
||||
SetWindowTheme(hHeader, useDark ? L"ItemsView" : nullptr, nullptr);
|
||||
}
|
||||
|
||||
int scaled(HWND hwnd, int val)
|
||||
{
|
||||
float scale = 1.0;
|
||||
// Both GetDpiForWindow and GetDpiForSystem shall be supported since Windows 10, version 1607
|
||||
if (_GetDpiForWindow && _GetDpiForSystem)
|
||||
scale = float(_GetDpiForWindow(hwnd)) / _GetDpiForSystem();
|
||||
return std::round(scale * val);
|
||||
}
|
||||
|
||||
struct ButtonData
|
||||
{
|
||||
HTHEME hTheme = nullptr;
|
||||
int iStateID = 0;
|
||||
POINT mouse_pos{ -1,-1 };
|
||||
|
||||
~ButtonData()
|
||||
{
|
||||
closeTheme();
|
||||
}
|
||||
|
||||
bool ensureTheme(HWND hwnd)
|
||||
{
|
||||
if (!hTheme)
|
||||
{
|
||||
hTheme = OpenThemeData(hwnd, L"Button");
|
||||
}
|
||||
return hTheme != nullptr;
|
||||
}
|
||||
|
||||
void closeTheme()
|
||||
{
|
||||
if (hTheme)
|
||||
{
|
||||
CloseThemeData(hTheme);
|
||||
hTheme = nullptr;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void renderButton(HWND hwnd, HDC hdc, HTHEME hTheme, int iPartID, int iStateID)
|
||||
{
|
||||
RECT rcClient = { 0 };
|
||||
DWORD nStyle = GetWindowLong(hwnd, GWL_STYLE);
|
||||
/* WCHAR szText[256] = { 0 };
|
||||
DWORD nState = static_cast<DWORD>(SendMessage(hwnd, BM_GETSTATE, 0, 0));
|
||||
DWORD uiState = static_cast<DWORD>(SendMessage(hwnd, WM_QUERYUISTATE, 0, 0));
|
||||
|
||||
HFONT hFont = nullptr;
|
||||
HFONT hOldFont = nullptr;
|
||||
HFONT hCreatedFont = nullptr;
|
||||
LOGFONT lf = { 0 };
|
||||
if (SUCCEEDED(GetThemeFont(hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf)))
|
||||
{
|
||||
hCreatedFont = CreateFontIndirect(&lf);
|
||||
hFont = hCreatedFont;
|
||||
}
|
||||
|
||||
if (!hFont) {
|
||||
hFont = reinterpret_cast<HFONT>(SendMessage(hwnd, WM_GETFONT, 0, 0));
|
||||
}
|
||||
|
||||
hOldFont = static_cast<HFONT>(SelectObject(hdc, hFont));
|
||||
|
||||
DWORD dtFlags = DT_LEFT; // DT_LEFT is 0
|
||||
dtFlags |= (nStyle & BS_MULTILINE) ? DT_WORDBREAK : DT_SINGLELINE;
|
||||
dtFlags |= ((nStyle & BS_CENTER) == BS_CENTER) ? DT_CENTER : (nStyle & BS_RIGHT) ? DT_RIGHT : 0;
|
||||
dtFlags |= ((nStyle & BS_VCENTER) == BS_VCENTER) ? DT_VCENTER : (nStyle & BS_BOTTOM) ? DT_BOTTOM : 0;
|
||||
dtFlags |= (uiState & UISF_HIDEACCEL) ? DT_HIDEPREFIX : 0;
|
||||
|
||||
if (!(nStyle & BS_MULTILINE) && !(nStyle & BS_BOTTOM) && !(nStyle & BS_TOP))
|
||||
{
|
||||
dtFlags |= DT_VCENTER;
|
||||
}
|
||||
|
||||
GetClientRect(hwnd, &rcClient);
|
||||
GetWindowText(hwnd, szText, _countof(szText));
|
||||
|
||||
SIZE szBox = { 13, 13 };
|
||||
GetThemePartSize(hTheme, hdc, iPartID, iStateID, NULL, TS_DRAW, &szBox);
|
||||
|
||||
RECT rcText = rcClient;
|
||||
GetThemeBackgroundContentRect(hTheme, hdc, iPartID, iStateID, &rcClient, &rcText);
|
||||
|
||||
RECT rcBackground = rcClient;
|
||||
if (dtFlags & DT_SINGLELINE)
|
||||
{
|
||||
rcBackground.top += (rcText.bottom - rcText.top - szBox.cy) / 2;
|
||||
}
|
||||
rcBackground.bottom = rcBackground.top + szBox.cy;
|
||||
rcBackground.right = rcBackground.left + szBox.cx;
|
||||
rcText.left = rcBackground.right + 3;
|
||||
|
||||
DrawThemeParentBackground(hwnd, hdc, &rcClient);
|
||||
DrawThemeBackground(hTheme, hdc, iPartID, iStateID, &rcBackground, nullptr);
|
||||
|
||||
DTTOPTS dtto = { sizeof(DTTOPTS), DTT_TEXTCOLOR };
|
||||
dtto.crText = iPartID == SBP_ARROWBTN ? GetSofterTextColor() : GetTextColor();
|
||||
|
||||
if (nStyle & WS_DISABLED)
|
||||
{
|
||||
dtto.crText = GetSofterBackgroundColor();
|
||||
}
|
||||
*/
|
||||
GetClientRect(hwnd, &rcClient);
|
||||
DrawThemeParentBackground(hwnd, hdc, &rcClient);
|
||||
|
||||
if (iPartID == SBP_ARROWBTN)
|
||||
{
|
||||
{
|
||||
HBRUSH hbrush = ::CreateSolidBrush(RGB(0x64, 0x64, 0x64));
|
||||
::FrameRect(hdc, &rcClient, hbrush);
|
||||
::DeleteObject(hbrush);
|
||||
}
|
||||
|
||||
COLORREF color = nStyle & WS_DISABLED ? GetSofterBackgroundColor() : GetSofterTextColor();
|
||||
|
||||
HPEN hPen = CreatePen(PS_SOLID, 1, color);
|
||||
HPEN hOldPen = SelectPen(hdc, hPen);
|
||||
|
||||
HBRUSH hBrush = CreateSolidBrush(color);
|
||||
HBRUSH hOldBrush = SelectBrush(hdc, hBrush);
|
||||
|
||||
// Up arrow
|
||||
RECT rcFocus = rcClient;
|
||||
rcFocus.bottom *= 0.5;
|
||||
rcFocus.left += 1;
|
||||
InflateRect(&rcFocus, -1, -1);
|
||||
|
||||
int triangle_edge = int(0.25 * (rcClient.right - rcClient.left));
|
||||
|
||||
int left_pos = triangle_edge + 1;
|
||||
int shift_from_center = 0.5 * triangle_edge;
|
||||
int bottom_pos = rcFocus.bottom - shift_from_center;
|
||||
rcFocus.bottom += 1;
|
||||
POINT vertices_up[] = { {left_pos, bottom_pos }, {left_pos + triangle_edge, bottom_pos - triangle_edge}, {left_pos + 2*triangle_edge, bottom_pos} };
|
||||
Polygon(hdc, vertices_up, 3);
|
||||
|
||||
if (iStateID == ARROWBTNSTATES::ABS_UPHOT)
|
||||
DrawFocusRect(hdc, &rcFocus);
|
||||
|
||||
// Down arrow
|
||||
rcFocus = rcClient;
|
||||
rcFocus.top = 0.5 * rcFocus.bottom;
|
||||
rcFocus.left += 1;
|
||||
InflateRect(&rcFocus, -1, -1);
|
||||
|
||||
int top_pos = rcFocus.top + shift_from_center;
|
||||
POINT vertices_down[] = { {left_pos, top_pos }, {left_pos + triangle_edge, top_pos + triangle_edge}, {left_pos + 2 * triangle_edge, top_pos} };
|
||||
Polygon(hdc, vertices_down, 3);
|
||||
|
||||
if (iStateID == ARROWBTNSTATES::ABS_DOWNHOT)
|
||||
DrawFocusRect(hdc, &rcFocus);
|
||||
|
||||
SelectBrush(hdc, hOldBrush);
|
||||
DeleteObject(hBrush);
|
||||
|
||||
SelectPen(hdc, hOldPen);
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
/* else
|
||||
DrawThemeTextEx(hTheme, hdc, iPartID, iStateID, szText, -1, dtFlags, &rcText, &dtto);
|
||||
|
||||
if ((nState & BST_FOCUS) && !(uiState & UISF_HIDEFOCUS))
|
||||
{
|
||||
RECT rcTextOut = rcText;
|
||||
dtto.dwFlags |= DTT_CALCRECT;
|
||||
DrawThemeTextEx(hTheme, hdc, iPartID, iStateID, szText, -1, dtFlags | DT_CALCRECT, &rcTextOut, &dtto);
|
||||
RECT rcFocus = rcTextOut;
|
||||
rcFocus.bottom++;
|
||||
rcFocus.left--;
|
||||
rcFocus.right++;
|
||||
DrawFocusRect(hdc, &rcFocus);
|
||||
}
|
||||
|
||||
if (hCreatedFont) DeleteObject(hCreatedFont);
|
||||
SelectObject(hdc, hOldFont);
|
||||
*/ }
|
||||
|
||||
void paintButton(HWND hwnd, HDC hdc, ButtonData& buttonData)
|
||||
{
|
||||
DWORD nState = static_cast<DWORD>(SendMessage(hwnd, BM_GETSTATE, 0, 0));
|
||||
DWORD nStyle = GetWindowLong(hwnd, GWL_STYLE);
|
||||
DWORD nButtonStyle = nStyle & 0xF;
|
||||
|
||||
int iPartID = BP_CHECKBOX;
|
||||
if (nButtonStyle == BS_CHECKBOX || nButtonStyle == BS_AUTOCHECKBOX)
|
||||
{
|
||||
iPartID = BP_CHECKBOX;
|
||||
}
|
||||
else if (nButtonStyle == BS_RADIOBUTTON || nButtonStyle == BS_AUTORADIOBUTTON)
|
||||
{
|
||||
iPartID = BP_RADIOBUTTON;
|
||||
}
|
||||
else if (nButtonStyle == BS_AUTO3STATE)
|
||||
{
|
||||
iPartID = SBP_ARROWBTN;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
|
||||
// states of BP_CHECKBOX and BP_RADIOBUTTON are the same
|
||||
int iStateID = RBS_UNCHECKEDNORMAL;
|
||||
|
||||
if (nStyle & WS_DISABLED) iStateID = RBS_UNCHECKEDDISABLED;
|
||||
else if (nState & BST_PUSHED) iStateID = RBS_UNCHECKEDPRESSED;
|
||||
else if (nState & BST_HOT) iStateID = RBS_UNCHECKEDHOT;
|
||||
|
||||
if (nState & BST_CHECKED) iStateID += 4;
|
||||
|
||||
if (BufferedPaintRenderAnimation(hwnd, hdc))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BP_ANIMATIONPARAMS animParams = { sizeof(animParams) };
|
||||
animParams.style = BPAS_LINEAR;
|
||||
if (iStateID != buttonData.iStateID)
|
||||
{
|
||||
GetThemeTransitionDuration(buttonData.hTheme, iPartID, buttonData.iStateID, iStateID, TMT_TRANSITIONDURATIONS, &animParams.dwDuration);
|
||||
}
|
||||
|
||||
RECT rcClient = { 0 };
|
||||
GetClientRect(hwnd, &rcClient);
|
||||
|
||||
HDC hdcFrom = nullptr;
|
||||
HDC hdcTo = nullptr;
|
||||
HANIMATIONBUFFER hbpAnimation = BeginBufferedAnimation(hwnd, hdc, &rcClient, BPBF_COMPATIBLEBITMAP, nullptr, &animParams, &hdcFrom, &hdcTo);
|
||||
if (hbpAnimation)
|
||||
{
|
||||
if (hdcFrom)
|
||||
{
|
||||
renderButton(hwnd, hdcFrom, buttonData.hTheme, iPartID, buttonData.iStateID);
|
||||
}
|
||||
if (hdcTo)
|
||||
{
|
||||
if (iPartID == SBP_ARROWBTN && (buttonData.iStateID == ARROWBTNSTATES::ABS_DOWNHOT || buttonData.iStateID == ARROWBTNSTATES::ABS_UPHOT) )
|
||||
iStateID = buttonData.iStateID;
|
||||
renderButton(hwnd, hdcTo, buttonData.hTheme, iPartID, iStateID);
|
||||
}
|
||||
|
||||
buttonData.iStateID = iStateID;
|
||||
|
||||
EndBufferedAnimation(hbpAnimation, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderButton(hwnd, hdc, buttonData.hTheme, iPartID, iStateID);
|
||||
|
||||
buttonData.iStateID = iStateID;
|
||||
}
|
||||
}
|
||||
|
||||
constexpr UINT_PTR g_buttonSubclassID = 42;
|
||||
|
||||
LRESULT CALLBACK ButtonSubclass(
|
||||
HWND hWnd,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam,
|
||||
UINT_PTR uIdSubclass,
|
||||
DWORD_PTR dwRefData
|
||||
)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(uIdSubclass);
|
||||
|
||||
auto pButtonData = reinterpret_cast<ButtonData*>(dwRefData);
|
||||
|
||||
auto paint = [pButtonData](HWND hWnd, WPARAM wParam)
|
||||
{
|
||||
PAINTSTRUCT ps = { 0 };
|
||||
HDC hdc = reinterpret_cast<HDC>(wParam);
|
||||
if (!hdc)
|
||||
{
|
||||
hdc = BeginPaint(hWnd, &ps);
|
||||
}
|
||||
|
||||
paintButton(hWnd, hdc, *pButtonData);
|
||||
|
||||
if (ps.hdc)
|
||||
{
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
};
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_UPDATEUISTATE:
|
||||
if (HIWORD(wParam) & (UISF_HIDEACCEL | UISF_HIDEFOCUS))
|
||||
{
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
}
|
||||
break;
|
||||
case WM_NCDESTROY:
|
||||
RemoveWindowSubclass(hWnd, ButtonSubclass, g_buttonSubclassID);
|
||||
delete pButtonData;
|
||||
break;
|
||||
case WM_ERASEBKGND:
|
||||
if (IsEnabled() && pButtonData->ensureTheme(hWnd))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
case WM_THEMECHANGED:
|
||||
pButtonData->closeTheme();
|
||||
break;
|
||||
case WM_PRINTCLIENT:
|
||||
case WM_PAINT:
|
||||
if (pButtonData->ensureTheme(hWnd))
|
||||
{
|
||||
paint(hWnd, wParam);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case WM_MOUSEMOVE:
|
||||
{
|
||||
DWORD nStyle = GetWindowLong(hWnd, GWL_STYLE);
|
||||
DWORD nButtonStyle = nStyle & 0xF;
|
||||
if (nButtonStyle == BS_AUTO3STATE)
|
||||
{
|
||||
int xPos = GET_X_LPARAM(lParam);
|
||||
int yPos = GET_Y_LPARAM(lParam);
|
||||
|
||||
RECT rcClient = { 0 };
|
||||
GetClientRect(hWnd, &rcClient);
|
||||
|
||||
int iStateID = 0;
|
||||
if (xPos <= rcClient.top || xPos >= rcClient.bottom ||
|
||||
yPos <= rcClient.left || yPos >= rcClient.right)
|
||||
iStateID = ARROWBTNSTATES::ABS_UPNORMAL;
|
||||
else
|
||||
iStateID = yPos > 0.5 * rcClient.bottom ? ARROWBTNSTATES::ABS_DOWNHOT : ARROWBTNSTATES::ABS_UPHOT;
|
||||
|
||||
if (pButtonData->iStateID != iStateID)
|
||||
{
|
||||
pButtonData->iStateID = iStateID;
|
||||
paint(hWnd, wParam);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_KEYUP:
|
||||
case WM_CHAR:
|
||||
case WM_KEYDOWN:
|
||||
case WM_VSCROLL:
|
||||
{
|
||||
DWORD nState = GET_KEYSTATE_WPARAM(wParam);
|
||||
if (nState == VK_UP || nState == VK_DOWN) {
|
||||
int iStateID = nState == VK_DOWN ? ARROWBTNSTATES::ABS_DOWNHOT : ARROWBTNSTATES::ABS_UPHOT;
|
||||
if (pButtonData->iStateID != iStateID)
|
||||
{
|
||||
pButtonData->iStateID = iStateID;
|
||||
paint(hWnd, wParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_SIZE:
|
||||
case WM_DESTROY:
|
||||
BufferedPaintStopAllAnimations(hWnd);
|
||||
break;
|
||||
case WM_ENABLE:
|
||||
if (IsEnabled())
|
||||
{
|
||||
// skip the button's normal wndproc so it won't redraw out of wm_paint
|
||||
LRESULT lr = DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
InvalidateRect(hWnd, nullptr, FALSE);
|
||||
return lr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return DefSubclassProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
void subclassButtonControl(HWND hwnd)
|
||||
{
|
||||
DWORD_PTR pButtonData = reinterpret_cast<DWORD_PTR>(new ButtonData());
|
||||
SetWindowSubclass(hwnd, ButtonSubclass, g_buttonSubclassID, pButtonData);
|
||||
}
|
||||
|
||||
void AutoSubclassAndThemeChildControls(HWND hwndParent, bool subclass, bool theme)
|
||||
{
|
||||
if (!IsSupported())
|
||||
return;
|
||||
|
||||
struct Params
|
||||
{
|
||||
const wchar_t* themeClassName = nullptr;
|
||||
bool subclass = false;
|
||||
bool theme = false;
|
||||
};
|
||||
|
||||
Params p{
|
||||
IsEnabled() ? L"DarkMode_Explorer" : nullptr
|
||||
, subclass
|
||||
, theme
|
||||
};
|
||||
|
||||
EnumChildWindows(hwndParent, [](HWND hwnd, LPARAM lParam) WINAPI_LAMBDA{
|
||||
auto & p = *reinterpret_cast<Params*>(lParam);
|
||||
const size_t classNameLen = 16;
|
||||
TCHAR className[classNameLen] = { 0 };
|
||||
GetClassName(hwnd, className, classNameLen);
|
||||
|
||||
if (wcscmp(className, UPDOWN_CLASS) == 0)
|
||||
{
|
||||
auto nButtonStyle = ::GetWindowLongPtr(hwnd, GWL_STYLE) & 0xF;
|
||||
if (nButtonStyle == BS_AUTO3STATE && p.subclass)
|
||||
{
|
||||
subclassButtonControl(hwnd);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}, reinterpret_cast<LPARAM>(&p));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
namespace NppDarkMode
|
||||
{
|
||||
bool IsEnabled();
|
||||
bool IsSupported();
|
||||
bool IsSystemMenuEnabled();
|
||||
|
||||
COLORREF InvertLightness(COLORREF c);
|
||||
COLORREF InvertLightnessSofter(COLORREF c);
|
||||
|
||||
COLORREF GetBackgroundColor();
|
||||
COLORREF GetSofterBackgroundColor();
|
||||
COLORREF GetTextColor();
|
||||
COLORREF GetDarkerTextColor();
|
||||
COLORREF GetEdgeColor();
|
||||
|
||||
HBRUSH GetBackgroundBrush();
|
||||
HBRUSH GetSofterBackgroundBrush();
|
||||
|
||||
// handle events
|
||||
bool OnSettingChange(HWND hwnd, LPARAM lParam); // true if dark mode toggled
|
||||
|
||||
// processes messages related to UAH / custom menubar drawing.
|
||||
// return true if handled, false to continue with normal processing in your wndproc
|
||||
bool UAHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr);
|
||||
|
||||
void DrawUAHMenuNCBottomLine(HWND hWnd);
|
||||
|
||||
// from DarkMode.h
|
||||
void InitDarkMode(bool set_dark_mode, bool set_sys_menu);
|
||||
void SetDarkMode(bool set_dark_mode);
|
||||
void SetSystemMenuForApp(bool set_sys_menu);
|
||||
void AllowDarkModeForApp(bool allow);
|
||||
bool AllowDarkModeForWindow(HWND hWnd, bool allow);
|
||||
void RefreshTitleBarThemeColor(HWND hWnd);
|
||||
|
||||
// enhancements to DarkMode.h
|
||||
void EnableDarkScrollBarForWindowAndChildren(HWND hwnd);
|
||||
|
||||
void SetDarkTitleBar(HWND hwnd);
|
||||
void SetDarkExplorerTheme(HWND hwnd);
|
||||
void SetDarkListView(HWND hwnd);
|
||||
void SetDarkListViewHeader(HWND hwnd);
|
||||
void AutoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
// This file contains code from
|
||||
// https://github.com/stevemk14ebr/PolyHook_2_0/blob/master/sources/IatHook.cpp
|
||||
// which is licensed under the MIT License.
|
||||
// See PolyHook_2_0-LICENSE for more information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
template <typename T, typename T1, typename T2>
|
||||
constexpr T RVA2VA(T1 base, T2 rva)
|
||||
{
|
||||
return reinterpret_cast<T>(reinterpret_cast<ULONG_PTR>(base) + rva);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr T DataDirectoryFromModuleBase(void *moduleBase, size_t entryID)
|
||||
{
|
||||
auto dosHdr = reinterpret_cast<PIMAGE_DOS_HEADER>(moduleBase);
|
||||
auto ntHdr = RVA2VA<PIMAGE_NT_HEADERS>(moduleBase, dosHdr->e_lfanew);
|
||||
auto dataDir = ntHdr->OptionalHeader.DataDirectory;
|
||||
return RVA2VA<T>(moduleBase, dataDir[entryID].VirtualAddress);
|
||||
}
|
||||
|
||||
PIMAGE_THUNK_DATA FindAddressByName(void *moduleBase, PIMAGE_THUNK_DATA impName, PIMAGE_THUNK_DATA impAddr, const char *funcName)
|
||||
{
|
||||
for (; impName->u1.Ordinal; ++impName, ++impAddr)
|
||||
{
|
||||
if (IMAGE_SNAP_BY_ORDINAL(impName->u1.Ordinal))
|
||||
continue;
|
||||
|
||||
auto import = RVA2VA<PIMAGE_IMPORT_BY_NAME>(moduleBase, impName->u1.AddressOfData);
|
||||
if (strcmp(import->Name, funcName) != 0)
|
||||
continue;
|
||||
return impAddr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PIMAGE_THUNK_DATA FindAddressByOrdinal(void *moduleBase, PIMAGE_THUNK_DATA impName, PIMAGE_THUNK_DATA impAddr, uint16_t ordinal)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(moduleBase);
|
||||
for (; impName->u1.Ordinal; ++impName, ++impAddr)
|
||||
{
|
||||
if (IMAGE_SNAP_BY_ORDINAL(impName->u1.Ordinal) && IMAGE_ORDINAL(impName->u1.Ordinal) == ordinal)
|
||||
return impAddr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PIMAGE_THUNK_DATA FindIatThunkInModule(void *moduleBase, const char *dllName, const char *funcName)
|
||||
{
|
||||
auto imports = DataDirectoryFromModuleBase<PIMAGE_IMPORT_DESCRIPTOR>(moduleBase, IMAGE_DIRECTORY_ENTRY_IMPORT);
|
||||
for (; imports->Name; ++imports)
|
||||
{
|
||||
if (_stricmp(RVA2VA<LPCSTR>(moduleBase, imports->Name), dllName) != 0)
|
||||
continue;
|
||||
|
||||
auto origThunk = RVA2VA<PIMAGE_THUNK_DATA>(moduleBase, imports->OriginalFirstThunk);
|
||||
auto thunk = RVA2VA<PIMAGE_THUNK_DATA>(moduleBase, imports->FirstThunk);
|
||||
return FindAddressByName(moduleBase, origThunk, thunk, funcName);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PIMAGE_THUNK_DATA FindDelayLoadThunkInModule(void *moduleBase, const char *dllName, const char *funcName)
|
||||
{
|
||||
auto imports = DataDirectoryFromModuleBase<PIMAGE_DELAYLOAD_DESCRIPTOR>(moduleBase, IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT);
|
||||
for (; imports->DllNameRVA; ++imports)
|
||||
{
|
||||
if (_stricmp(RVA2VA<LPCSTR>(moduleBase, imports->DllNameRVA), dllName) != 0)
|
||||
continue;
|
||||
|
||||
auto impName = RVA2VA<PIMAGE_THUNK_DATA>(moduleBase, imports->ImportNameTableRVA);
|
||||
auto impAddr = RVA2VA<PIMAGE_THUNK_DATA>(moduleBase, imports->ImportAddressTableRVA);
|
||||
return FindAddressByName(moduleBase, impName, impAddr, funcName);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PIMAGE_THUNK_DATA FindDelayLoadThunkInModule(void *moduleBase, const char *dllName, uint16_t ordinal)
|
||||
{
|
||||
auto imports = DataDirectoryFromModuleBase<PIMAGE_DELAYLOAD_DESCRIPTOR>(moduleBase, IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT);
|
||||
for (; imports->DllNameRVA; ++imports)
|
||||
{
|
||||
if (_stricmp(RVA2VA<LPCSTR>(moduleBase, imports->DllNameRVA), dllName) != 0)
|
||||
continue;
|
||||
|
||||
auto impName = RVA2VA<PIMAGE_THUNK_DATA>(moduleBase, imports->ImportNameTableRVA);
|
||||
auto impAddr = RVA2VA<PIMAGE_THUNK_DATA>(moduleBase, imports->ImportAddressTableRVA);
|
||||
return FindAddressByOrdinal(moduleBase, impName, impAddr, ordinal);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
#pragma once
|
||||
|
||||
// MIT license, see LICENSE
|
||||
// Copyright(c) 2021 adzm / Adam D. Walling
|
||||
|
||||
// processes messages related to UAH / custom menubar drawing.
|
||||
// return true if handled, false to continue with normal processing in your wndproc
|
||||
bool UAHDarkModeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr);
|
||||
|
||||
// window messages related to menu bar drawing
|
||||
#define WM_UAHDESTROYWINDOW 0x0090 // handled by DefWindowProc
|
||||
#define WM_UAHDRAWMENU 0x0091 // lParam is UAHMENU
|
||||
#define WM_UAHDRAWMENUITEM 0x0092 // lParam is UAHDRAWMENUITEM
|
||||
#define WM_UAHINITMENU 0x0093 // handled by DefWindowProc
|
||||
#define WM_UAHMEASUREMENUITEM 0x0094 // lParam is UAHMEASUREMENUITEM
|
||||
#define WM_UAHNCPAINTMENUPOPUP 0x0095 // handled by DefWindowProc
|
||||
|
||||
// describes the sizes of the menu bar or menu item
|
||||
typedef union tagUAHMENUITEMMETRICS
|
||||
{
|
||||
// cx appears to be 14 / 0xE less than rcItem's width!
|
||||
// cy 0x14 seems stable, i wonder if it is 4 less than rcItem's height which is always 24 atm
|
||||
struct {
|
||||
DWORD cx;
|
||||
DWORD cy;
|
||||
} rgsizeBar[2];
|
||||
struct {
|
||||
DWORD cx;
|
||||
DWORD cy;
|
||||
} rgsizePopup[4];
|
||||
} UAHMENUITEMMETRICS;
|
||||
|
||||
// not really used in our case but part of the other structures
|
||||
typedef struct tagUAHMENUPOPUPMETRICS
|
||||
{
|
||||
DWORD rgcx[4];
|
||||
DWORD fUpdateMaxWidths : 2; // from kernel symbols, padded to full dword
|
||||
} UAHMENUPOPUPMETRICS;
|
||||
|
||||
// hmenu is the main window menu; hdc is the context to draw in
|
||||
typedef struct tagUAHMENU
|
||||
{
|
||||
HMENU hmenu;
|
||||
HDC hdc;
|
||||
DWORD dwFlags; // no idea what these mean, in my testing it's either 0x00000a00 or sometimes 0x00000a10
|
||||
} UAHMENU;
|
||||
|
||||
// menu items are always referred to by iPosition here
|
||||
typedef struct tagUAHMENUITEM
|
||||
{
|
||||
int iPosition; // 0-based position of menu item in menubar
|
||||
UAHMENUITEMMETRICS umim;
|
||||
UAHMENUPOPUPMETRICS umpm;
|
||||
} UAHMENUITEM;
|
||||
|
||||
// the DRAWITEMSTRUCT contains the states of the menu items, as well as
|
||||
// the position index of the item in the menu, which is duplicated in
|
||||
// the UAHMENUITEM's iPosition as well
|
||||
typedef struct UAHDRAWMENUITEM
|
||||
{
|
||||
DRAWITEMSTRUCT dis; // itemID looks uninitialized
|
||||
UAHMENU um;
|
||||
UAHMENUITEM umi;
|
||||
} UAHDRAWMENUITEM;
|
||||
|
||||
// the MEASUREITEMSTRUCT is intended to be filled with the size of the item
|
||||
// height appears to be ignored, but width can be modified
|
||||
typedef struct tagUAHMEASUREMENUITEM
|
||||
{
|
||||
MEASUREITEMSTRUCT mis;
|
||||
UAHMENU um;
|
||||
UAHMENUITEM umi;
|
||||
} UAHMEASUREMENUITEM;
|
||||
|
|
@ -0,0 +1,275 @@
|
|||
#pragma once
|
||||
#include "IatHook.hpp"
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#include <Uxtheme.h>
|
||||
#include <Vssym32.h>
|
||||
|
||||
#include <unordered_set>
|
||||
#include <mutex>
|
||||
|
||||
enum IMMERSIVE_HC_CACHE_MODE
|
||||
{
|
||||
IHCM_USE_CACHED_VALUE,
|
||||
IHCM_REFRESH
|
||||
};
|
||||
|
||||
// 1903 18362
|
||||
enum PreferredAppMode
|
||||
{
|
||||
Default,
|
||||
AllowDark,
|
||||
ForceDark,
|
||||
ForceLight,
|
||||
Max
|
||||
};
|
||||
|
||||
enum WINDOWCOMPOSITIONATTRIB
|
||||
{
|
||||
WCA_UNDEFINED = 0,
|
||||
WCA_NCRENDERING_ENABLED = 1,
|
||||
WCA_NCRENDERING_POLICY = 2,
|
||||
WCA_TRANSITIONS_FORCEDISABLED = 3,
|
||||
WCA_ALLOW_NCPAINT = 4,
|
||||
WCA_CAPTION_BUTTON_BOUNDS = 5,
|
||||
WCA_NONCLIENT_RTL_LAYOUT = 6,
|
||||
WCA_FORCE_ICONIC_REPRESENTATION = 7,
|
||||
WCA_EXTENDED_FRAME_BOUNDS = 8,
|
||||
WCA_HAS_ICONIC_BITMAP = 9,
|
||||
WCA_THEME_ATTRIBUTES = 10,
|
||||
WCA_NCRENDERING_EXILED = 11,
|
||||
WCA_NCADORNMENTINFO = 12,
|
||||
WCA_EXCLUDED_FROM_LIVEPREVIEW = 13,
|
||||
WCA_VIDEO_OVERLAY_ACTIVE = 14,
|
||||
WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15,
|
||||
WCA_DISALLOW_PEEK = 16,
|
||||
WCA_CLOAK = 17,
|
||||
WCA_CLOAKED = 18,
|
||||
WCA_ACCENT_POLICY = 19,
|
||||
WCA_FREEZE_REPRESENTATION = 20,
|
||||
WCA_EVER_UNCLOAKED = 21,
|
||||
WCA_VISUAL_OWNER = 22,
|
||||
WCA_HOLOGRAPHIC = 23,
|
||||
WCA_EXCLUDED_FROM_DDA = 24,
|
||||
WCA_PASSIVEUPDATEMODE = 25,
|
||||
WCA_USEDARKMODECOLORS = 26,
|
||||
WCA_LAST = 27
|
||||
};
|
||||
|
||||
struct WINDOWCOMPOSITIONATTRIBDATA
|
||||
{
|
||||
WINDOWCOMPOSITIONATTRIB Attrib;
|
||||
PVOID pvData;
|
||||
SIZE_T cbData;
|
||||
};
|
||||
|
||||
using fnRtlGetNtVersionNumbers = void (WINAPI *)(LPDWORD major, LPDWORD minor, LPDWORD build);
|
||||
using fnSetWindowCompositionAttribute = BOOL (WINAPI *)(HWND hWnd, WINDOWCOMPOSITIONATTRIBDATA*);
|
||||
using fnGetDpiForWindow = UINT (WINAPI*)(_In_ HWND hwnd);
|
||||
using fnGetDpiForSystem = UINT(WINAPI*)();
|
||||
// 1809 17763
|
||||
using fnShouldAppsUseDarkMode = bool (WINAPI *)(); // ordinal 132
|
||||
using fnAllowDarkModeForWindow = bool (WINAPI *)(HWND hWnd, bool allow); // ordinal 133
|
||||
using fnAllowDarkModeForApp = bool (WINAPI *)(bool allow); // ordinal 135, in 1809
|
||||
using fnFlushMenuThemes = void (WINAPI *)(); // ordinal 136
|
||||
using fnRefreshImmersiveColorPolicyState = void (WINAPI *)(); // ordinal 104
|
||||
using fnIsDarkModeAllowedForWindow = bool (WINAPI *)(HWND hWnd); // ordinal 137
|
||||
using fnGetIsImmersiveColorUsingHighContrast = bool (WINAPI *)(IMMERSIVE_HC_CACHE_MODE mode); // ordinal 106
|
||||
using fnOpenNcThemeData = HTHEME(WINAPI *)(HWND hWnd, LPCWSTR pszClassList); // ordinal 49
|
||||
// 1903 18362
|
||||
using fnShouldSystemUseDarkMode = bool (WINAPI *)(); // ordinal 138
|
||||
using fnSetPreferredAppMode = PreferredAppMode (WINAPI *)(PreferredAppMode appMode); // ordinal 135, in 1903
|
||||
using fnIsDarkModeAllowedForApp = bool (WINAPI *)(); // ordinal 139
|
||||
|
||||
fnSetWindowCompositionAttribute _SetWindowCompositionAttribute = nullptr;
|
||||
fnGetDpiForWindow _GetDpiForWindow = nullptr;
|
||||
fnGetDpiForSystem _GetDpiForSystem = nullptr;
|
||||
fnShouldAppsUseDarkMode _ShouldAppsUseDarkMode = nullptr;
|
||||
fnAllowDarkModeForWindow _AllowDarkModeForWindow = nullptr;
|
||||
fnAllowDarkModeForApp _AllowDarkModeForApp = nullptr;
|
||||
fnFlushMenuThemes _FlushMenuThemes = nullptr;
|
||||
fnRefreshImmersiveColorPolicyState _RefreshImmersiveColorPolicyState = nullptr;
|
||||
fnIsDarkModeAllowedForWindow _IsDarkModeAllowedForWindow = nullptr;
|
||||
fnGetIsImmersiveColorUsingHighContrast _GetIsImmersiveColorUsingHighContrast = nullptr;
|
||||
fnOpenNcThemeData _OpenNcThemeData = nullptr;
|
||||
// 1903 18362
|
||||
fnShouldSystemUseDarkMode _ShouldSystemUseDarkMode = nullptr;
|
||||
fnSetPreferredAppMode _SetPreferredAppMode = nullptr;
|
||||
|
||||
bool g_darkModeSupported = false;
|
||||
bool g_darkModeEnabled = false;
|
||||
bool g_SystemMenuEnabled = true;
|
||||
DWORD g_buildNumber = 0;
|
||||
|
||||
bool AllowDarkModeForWindow(HWND hWnd, bool allow)
|
||||
{
|
||||
if (g_darkModeSupported)
|
||||
return _AllowDarkModeForWindow(hWnd, allow);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsHighContrast()
|
||||
{
|
||||
HIGHCONTRASTW highContrast = { sizeof(highContrast) };
|
||||
if (SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(highContrast), &highContrast, FALSE))
|
||||
return highContrast.dwFlags & HCF_HIGHCONTRASTON;
|
||||
return false;
|
||||
}
|
||||
|
||||
void RefreshTitleBarThemeColor(HWND hWnd)
|
||||
{
|
||||
BOOL dark = FALSE;
|
||||
if (_IsDarkModeAllowedForWindow(hWnd) &&
|
||||
_ShouldAppsUseDarkMode() &&
|
||||
!IsHighContrast())
|
||||
{
|
||||
dark = TRUE;
|
||||
}
|
||||
if (g_buildNumber < 18362)
|
||||
SetPropW(hWnd, L"UseImmersiveDarkModeColors", reinterpret_cast<HANDLE>(static_cast<INT_PTR>(dark)));
|
||||
else if (_SetWindowCompositionAttribute)
|
||||
{
|
||||
WINDOWCOMPOSITIONATTRIBDATA data = { WCA_USEDARKMODECOLORS, &dark, sizeof(dark) };
|
||||
_SetWindowCompositionAttribute(hWnd, &data);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsColorSchemeChangeMessage(LPARAM lParam)
|
||||
{
|
||||
bool is = false;
|
||||
if (lParam && (0 == lstrcmpi(reinterpret_cast<LPCWCH>(lParam), L"ImmersiveColorSet")))
|
||||
{
|
||||
_RefreshImmersiveColorPolicyState();
|
||||
is = true;
|
||||
}
|
||||
_GetIsImmersiveColorUsingHighContrast(IHCM_REFRESH);
|
||||
return is;
|
||||
}
|
||||
|
||||
bool IsColorSchemeChangeMessage(UINT message, LPARAM lParam)
|
||||
{
|
||||
if (message == WM_SETTINGCHANGE)
|
||||
return IsColorSchemeChangeMessage(lParam);
|
||||
return false;
|
||||
}
|
||||
|
||||
void AllowDarkModeForApp(bool allow)
|
||||
{
|
||||
if (_AllowDarkModeForApp)
|
||||
_AllowDarkModeForApp(allow);
|
||||
else if (_SetPreferredAppMode)
|
||||
_SetPreferredAppMode(allow ? ForceDark : ForceLight);
|
||||
}
|
||||
|
||||
// limit dark scroll bar to specific windows and their children
|
||||
|
||||
std::unordered_set<HWND> g_darkScrollBarWindows;
|
||||
std::mutex g_darkScrollBarMutex;
|
||||
|
||||
void EnableDarkScrollBarForWindowAndChildren(HWND hwnd)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(g_darkScrollBarMutex);
|
||||
g_darkScrollBarWindows.insert(hwnd);
|
||||
}
|
||||
|
||||
bool IsWindowOrParentUsingDarkScrollBar(HWND hwnd)
|
||||
{
|
||||
HWND hwndRoot = GetAncestor(hwnd, GA_ROOT);
|
||||
|
||||
std::lock_guard<std::mutex> lock(g_darkScrollBarMutex);
|
||||
if (g_darkScrollBarWindows.count(hwnd)) {
|
||||
return true;
|
||||
}
|
||||
if (hwnd != hwndRoot && g_darkScrollBarWindows.count(hwndRoot)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void FixDarkScrollBar()
|
||||
{
|
||||
HMODULE hComctl = LoadLibraryExW(L"comctl32.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
if (hComctl)
|
||||
{
|
||||
auto addr = FindDelayLoadThunkInModule(hComctl, "uxtheme.dll", 49); // OpenNcThemeData
|
||||
if (addr)
|
||||
{
|
||||
DWORD oldProtect;
|
||||
if (VirtualProtect(addr, sizeof(IMAGE_THUNK_DATA), PAGE_READWRITE, &oldProtect))
|
||||
{
|
||||
auto MyOpenThemeData = [](HWND hWnd, LPCWSTR classList) -> HTHEME {
|
||||
if (wcscmp(classList, L"ScrollBar") == 0) {
|
||||
hWnd = nullptr;
|
||||
classList = L"Explorer::ScrollBar";
|
||||
}
|
||||
if (wcscmp(classList, L"MENU") == 0) {
|
||||
hWnd = nullptr;
|
||||
classList = L"Explorer::Menu";
|
||||
}
|
||||
return _OpenNcThemeData(hWnd, classList);
|
||||
};
|
||||
|
||||
addr->u1.Function = reinterpret_cast<ULONG_PTR>(static_cast<fnOpenNcThemeData>(MyOpenThemeData));
|
||||
VirtualProtect(addr, sizeof(IMAGE_THUNK_DATA), oldProtect, &oldProtect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
constexpr bool CheckBuildNumber(DWORD buildNumber)
|
||||
{
|
||||
return (buildNumber == 17763 || // 1809
|
||||
buildNumber == 18362 || // 1903
|
||||
buildNumber == 18363 || // 1909
|
||||
buildNumber >= 19041); // Windows 10 any version > 2004 and newer
|
||||
}
|
||||
|
||||
void InitDarkMode()
|
||||
{
|
||||
auto RtlGetNtVersionNumbers = reinterpret_cast<fnRtlGetNtVersionNumbers>(GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlGetNtVersionNumbers"));
|
||||
if (RtlGetNtVersionNumbers)
|
||||
{
|
||||
DWORD major, minor;
|
||||
RtlGetNtVersionNumbers(&major, &minor, &g_buildNumber);
|
||||
g_buildNumber &= ~0xF0000000;
|
||||
if (major == 10 && minor == 0 && CheckBuildNumber(g_buildNumber))
|
||||
{
|
||||
HMODULE hUxtheme = LoadLibraryExW(L"uxtheme.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
if (hUxtheme)
|
||||
{
|
||||
_OpenNcThemeData = reinterpret_cast<fnOpenNcThemeData>(GetProcAddress(hUxtheme, MAKEINTRESOURCEA(49)));
|
||||
_RefreshImmersiveColorPolicyState = reinterpret_cast<fnRefreshImmersiveColorPolicyState>(GetProcAddress(hUxtheme, MAKEINTRESOURCEA(104)));
|
||||
_GetIsImmersiveColorUsingHighContrast = reinterpret_cast<fnGetIsImmersiveColorUsingHighContrast>(GetProcAddress(hUxtheme, MAKEINTRESOURCEA(106)));
|
||||
_ShouldAppsUseDarkMode = reinterpret_cast<fnShouldAppsUseDarkMode>(GetProcAddress(hUxtheme, MAKEINTRESOURCEA(132)));
|
||||
_AllowDarkModeForWindow = reinterpret_cast<fnAllowDarkModeForWindow>(GetProcAddress(hUxtheme, MAKEINTRESOURCEA(133)));
|
||||
|
||||
auto ord135 = GetProcAddress(hUxtheme, MAKEINTRESOURCEA(135));
|
||||
if (g_buildNumber < 18362)
|
||||
_AllowDarkModeForApp = reinterpret_cast<fnAllowDarkModeForApp>(ord135);
|
||||
else
|
||||
_SetPreferredAppMode = reinterpret_cast<fnSetPreferredAppMode>(ord135);
|
||||
|
||||
_FlushMenuThemes = reinterpret_cast<fnFlushMenuThemes>(GetProcAddress(hUxtheme, MAKEINTRESOURCEA(136)));
|
||||
_IsDarkModeAllowedForWindow = reinterpret_cast<fnIsDarkModeAllowedForWindow>(GetProcAddress(hUxtheme, MAKEINTRESOURCEA(137)));
|
||||
|
||||
_SetWindowCompositionAttribute = reinterpret_cast<fnSetWindowCompositionAttribute>(GetProcAddress(GetModuleHandleW(L"user32.dll"), "SetWindowCompositionAttribute"));
|
||||
|
||||
_GetDpiForWindow = reinterpret_cast<fnGetDpiForWindow>(GetProcAddress(GetModuleHandleW(L"user32.dll"), "GetDpiForWindow"));
|
||||
_GetDpiForSystem = reinterpret_cast<fnGetDpiForSystem>(GetProcAddress(GetModuleHandleW(L"user32.dll"), "GetDpiForSystem"));
|
||||
|
||||
if (_OpenNcThemeData &&
|
||||
_RefreshImmersiveColorPolicyState &&
|
||||
_ShouldAppsUseDarkMode &&
|
||||
_AllowDarkModeForWindow &&
|
||||
(_AllowDarkModeForApp || _SetPreferredAppMode) &&
|
||||
_FlushMenuThemes &&
|
||||
_IsDarkModeAllowedForWindow)
|
||||
{
|
||||
g_darkModeSupported = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|