layout: various tweaks
increase font-size job_status improved auto-sized thumb prioritize data over names in main and temp
This commit is contained in:
parent
e8e046469b
commit
ef81bb4769
@ -39,7 +39,7 @@ class KlippyGtk:
|
||||
self.width = screen.width
|
||||
self.height = screen.height
|
||||
self.ultra_tall = (self.height / self.width) >= 3
|
||||
self.font_ratio = [31, 47] if self.screen.vertical_mode else [43, 29]
|
||||
self.font_ratio = [28, 42] if self.screen.vertical_mode else [40, 27]
|
||||
self.font_size = min(self.width / self.font_ratio[0], self.height / self.font_ratio[1])
|
||||
self.img_scale = self.font_size * 2
|
||||
self.button_image_scale = 1.38
|
||||
@ -47,15 +47,16 @@ class KlippyGtk:
|
||||
self.dialog_buttons_height = round(self.height / 5)
|
||||
|
||||
if self.font_size_type == "max":
|
||||
self.font_size = self.font_size * 1.2
|
||||
self.font_size = self.font_size * 1.06
|
||||
self.img_scale = self.img_scale * 0.7
|
||||
self.bsidescale = .7
|
||||
elif self.font_size_type == "extralarge":
|
||||
self.font_size = self.font_size * 1.14
|
||||
self.font_size = self.font_size * 1.05
|
||||
self.img_scale = self.img_scale * 0.7
|
||||
self.bsidescale = 1
|
||||
self.bsidescale = 1.0
|
||||
elif self.font_size_type == "large":
|
||||
self.font_size = self.font_size * 1.09
|
||||
self.img_scale = self.img_scale * 0.9
|
||||
self.font_size = self.font_size * 1.025
|
||||
self.img_scale = self.img_scale * 0.85
|
||||
self.bsidescale = .8
|
||||
elif self.font_size_type == "small":
|
||||
self.font_size = self.font_size * 0.91
|
||||
@ -155,7 +156,7 @@ class KlippyGtk:
|
||||
return pixbuf
|
||||
|
||||
def Button(self, image_name=None, label=None, style=None, scale=None, position=Gtk.PositionType.TOP, lines=2):
|
||||
if self.font_size_type == "max" and label is not None and scale is None:
|
||||
if self.font_size_type == "max" and label is not None:
|
||||
image_name = None
|
||||
b = Gtk.Button(hexpand=True, vexpand=True, can_focus=False, image_position=position, always_show_image=True)
|
||||
if label is not None:
|
||||
|
@ -203,6 +203,8 @@ class ScreenPanel:
|
||||
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(new_label_text)
|
||||
if lines == 2:
|
||||
return
|
||||
if show_power:
|
||||
self.labels[dev].get_style_context().add_class("heater-grid-temp-power")
|
||||
else:
|
||||
|
@ -89,7 +89,7 @@ class Panel(ScreenPanel):
|
||||
self.labels[label].set_halign(Gtk.Align.START)
|
||||
self.labels[label].set_ellipsize(Pango.EllipsizeMode.END)
|
||||
|
||||
fi_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, valign=Gtk.Align.CENTER)
|
||||
fi_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
|
||||
fi_box.add(self.labels['file'])
|
||||
fi_box.add(self.labels['lcdmessage'])
|
||||
self.grid.attach(fi_box, 1, 0, 3, 1)
|
||||
@ -110,7 +110,6 @@ class Panel(ScreenPanel):
|
||||
|
||||
self.labels['thumbnail'] = self._gtk.Button("file")
|
||||
self.labels['thumbnail'].connect("clicked", self.show_fullscreen_thumbnail)
|
||||
self.labels['thumbnail'].set_hexpand(False)
|
||||
self.labels['info_grid'] = Gtk.Grid()
|
||||
self.labels['info_grid'].attach(self.labels['thumbnail'], 0, 0, 1, 1)
|
||||
self.current_extruder = self._printer.get_stat("toolhead", "extruder")
|
||||
@ -737,13 +736,18 @@ class Panel(ScreenPanel):
|
||||
|
||||
def show_file_thumbnail(self):
|
||||
if self._screen.vertical_mode:
|
||||
width = self._screen.width * 0.9
|
||||
height = self._screen.height / 4
|
||||
max_width = self._screen.width * 0.9
|
||||
max_height = self._screen.height / 4
|
||||
else:
|
||||
width = self._screen.width * .25
|
||||
height = self._gtk.content_height * 0.47
|
||||
max_width = self._screen.width * .25
|
||||
max_height = self._gtk.content_height * 0.47
|
||||
width = min(self.labels['thumbnail'].get_allocated_width(), max_width)
|
||||
height = min(self.labels['thumbnail'].get_allocated_height(), max_height)
|
||||
if width <= 1 or height <= 1:
|
||||
width = max_width
|
||||
height = max_height
|
||||
self.labels['thumbnail'].set_hexpand(False)
|
||||
pixbuf = self.get_file_image(self.filename, width, height)
|
||||
logging.debug(self.filename)
|
||||
if pixbuf is None:
|
||||
logging.debug("no pixbuf")
|
||||
return
|
||||
|
@ -6,6 +6,7 @@ from gi.repository import Gtk, GLib
|
||||
from panels.menu import Panel as MenuPanel
|
||||
from ks_includes.widgets.heatergraph import HeaterGraph
|
||||
from ks_includes.widgets.keypad import Keypad
|
||||
from ks_includes.KlippyGtk import find_widget
|
||||
|
||||
|
||||
class Panel(MenuPanel):
|
||||
@ -141,6 +142,7 @@ class Panel(MenuPanel):
|
||||
self.labels['da'].set_showing(device, visible)
|
||||
|
||||
temp = self._gtk.Button(label="", lines=1)
|
||||
find_widget(temp, Gtk.Label).set_ellipsize(False)
|
||||
if can_target:
|
||||
temp.connect("clicked", self.show_numpad, device)
|
||||
|
||||
|
@ -378,6 +378,7 @@ class Panel(ScreenPanel):
|
||||
|
||||
self.labels["da"].add_object(device, "temperatures", rgb, False, False)
|
||||
temp = self._gtk.Button(label="", lines=1)
|
||||
find_widget(temp, Gtk.Label).set_ellipsize(False)
|
||||
|
||||
if self._printer.device_has_target(device):
|
||||
temp.connect("clicked", self.show_numpad, device)
|
||||
|
Loading…
x
Reference in New Issue
Block a user