新增图标文件,修复更改主题网络图标不更新的问题

# Conflicts:
#	panels/base_panel.py   resolved by d6fcc79a209f8deb7aa63a41cda67f2a78ce6d25 version
This commit is contained in:
张开科 2025-03-04 16:11:47 +08:00
parent f892315588
commit ee29d06f9e
3 changed files with 27 additions and 20 deletions

View File

@ -25,31 +25,12 @@ class BasePanel(ScreenPanel):
self.current_extruder = None
self.last_usage_report = datetime.now()
self.usage_report = 0
icon_size_width = self._gtk.content_width * 0.05
icon_size_height = self._gtk.content_height * 0.05
network_icons_map = {
"excellent": "wifi_excellent",
"good": "wifi_good",
"fair": "wifi_fair",
"weak": "wifi_weak",
"ethernet": "ethernet",
}
self.network_icons = {
key: self._gtk.PixbufFromIcon(value, width=icon_size_width, height=icon_size_height)
for key, value in network_icons_map.items()
}
self.load_network_icons()
try:
self.sdbus_nm = SdbusNm(self.network_interface_refresh)
except Exception as e:
logging.exception("Failed to initialize SdbusNm: %s", e)
self.sdbus_nm = None
# Action bar buttons
abscale = self.bts * 1.1
self.control['back'] = self._gtk.Button('back', scale=abscale)
@ -195,6 +176,7 @@ class BasePanel(ScreenPanel):
width = pixbuf.get_width()
height = pixbuf.get_height()
button.set_image(self._gtk.Image(name, width, height))
self.load_network_icons()
def show_heaters(self, show=True):
try:
@ -471,6 +453,21 @@ class BasePanel(ScreenPanel):
else:
return self.network_icons["weak"]
def load_network_icons(self):
icon_size_width = self._gtk.content_width * 0.05
icon_size_height = self._gtk.content_height * 0.05
network_icons_map = {
"excellent": "wifi_excellent",
"good": "wifi_good",
"fair": "wifi_fair",
"weak": "wifi_weak",
"ethernet": "ethernet",
}
self.network_icons = {
key: self._gtk.PixbufFromIcon(value, width=icon_size_width, height=icon_size_height)
for key, value in network_icons_map.items()
}
def set_ks_printer_cfg(self, printer):
ScreenPanel.ks_printer_cfg = self._config.get_printer_config(printer)
if self.ks_printer_cfg is not None:

View File

@ -0,0 +1,9 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.5 22.2048V26.0048" stroke="white" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M23 26.4573H12" stroke="white" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11 22H26.5663C27.3855 22 28 21.4324 28 20.6757V9.32432C28 8.56757 27.3855 8 26.5663 8H14.0723" stroke="white" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.42857 18H4.57143C4.28571 18 4 17.7345 4 17.469V8.53097C4 8.26549 4.28571 8 4.57143 8H9.42857C9.71429 8 10 8.26549 10 8.53097V17.469C10 17.7345 9.71429 18 9.42857 18Z" stroke="white" stroke-width="1.6" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.30078 11.9812H10.1008" stroke="white" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.19922 14.9669V11.9812" stroke="white" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.19922 27V18.5857" stroke="white" stroke-width="1.6" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1741054395799" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9361" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M789.640533 664.8832H340.241067a27.204267 27.204267 0 1 1 0-54.442667h449.399466c22.4256 0 40.686933-18.261333 40.686934-40.686933V265.796267c0-22.4256-18.261333-40.686933-40.686934-40.686934H439.569067a27.204267 27.204267 0 1 1 0-54.442666h350.071466a95.232 95.232 0 0 1 95.1296 95.1296v303.957333a95.232 95.232 0 0 1-95.1296 95.1296z" fill="#2c2c2c" p-id="9362"></path><path d="M207.530667 539.2384a68.266667 68.266667 0 0 1-68.266667-68.266667V238.933333a68.266667 68.266667 0 0 1 68.266667-68.266666h106.359466a68.266667 68.266667 0 0 1 68.266667 68.266666v232.0384a68.266667 68.266667 0 0 1-68.266667 68.266667H207.496533z m-13.858134-71.509333a17.066667 17.066667 0 0 0 17.066667 17.066666h99.908267a17.066667 17.066667 0 0 0 17.066666-17.066666V242.176a17.066667 17.066667 0 0 0-17.066666-17.066667H210.7392a17.066667 17.066667 0 0 0-17.066667 17.066667v225.553067z" fill="#2c2c2c" p-id="9363"></path><path d="M354.9184 350.685867H188.450133a27.204267 27.204267 0 1 1 0-54.408534h166.468267a27.204267 27.204267 0 1 1 0 54.442667z m-94.208 502.5792a27.204267 27.204267 0 0 1-27.204267-27.204267v-314.094933a27.204267 27.204267 0 1 1 54.442667 0V826.026667c0 15.018667-12.1856 27.204267-27.2384 27.204266z" fill="#2c2c2c" p-id="9364"></path><path d="M260.7104 425.3696a27.204267 27.204267 0 0 1-27.204267-27.204267v-70.656a27.204267 27.204267 0 1 1 54.442667 0v70.656c0 15.018667-12.1856 27.204267-27.2384 27.204267zM543.402667 853.333333a27.204267 27.204267 0 0 1-27.204267-27.204266v-157.047467a27.204267 27.204267 0 1 1 54.442667 0v157.013333c0 15.0528-12.1856 27.2384-27.2384 27.2384z" fill="#2c2c2c" p-id="9365"></path><path d="M700.484267 853.333333h-314.129067a27.204267 27.204267 0 1 1 0-54.4768h314.129067a27.204267 27.204267 0 1 1 0 54.442667z" fill="#2c2c2c" p-id="9366"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB