OctoPrint-TFT
OctoPrint-TFT copied to clipboard
Won't scale
Hello,
the GUI won't scale when I change the reselution. I'm using the offical 7" pi screen.
Thanks, Raiv3n
You can get it to scale with these steps:
- Make your own copy of the file at /opt/octoprint-tft/styles/default/style.css. Edit it to modify the styling. I updated font sizes so they look decent on the 7" Pi screen. See the code fragment below for the lines I inserted at the top of the file:
- Note the full path of your edited style.css. Into the same directory, copy over the images/ directory (recursively with all its contents) from /opt/octoprint-tft/styles/default/.
- Open /etc/octoprint-tft-environment and set the variable OCTOPRINT_TFT_STYLE_PATH to the path (just the full path to the directory in which your style.css and images/ sit). You may need to do this with sudo so you have write permission on the file.
- Reboot the pi.
button {
font: 24px Sans;
}
label {
font: 18px Sans;
}
progressbar {
font: 18px Sans;
padding: 10px;
}
There is a problem in the main() function with the variables, height & width. Golang is a "pass-by-value" language. The 'getSize()' function will not alter the inherent value of the variables 'height & width' as written. Because of the scope of those variables, any changes accomplished in 'getSize()' are lost when go returns to main().
The fix for this problem is to declare 'height & width' like this: var ( BaseURL string APIKey string ConfigFile string Resolution string height int width int ) or use pointers