diff --git a/ks_includes/graph.py b/ks_includes/graph.py index 0616f03f..25d33ebe 100644 --- a/ks_includes/graph.py +++ b/ks_includes/graph.py @@ -42,8 +42,8 @@ class HeaterGraph(Gtk.DrawingArea): height = da.get_allocated_height() g_width_start = 30 - g_width = width - 5 - g_height_start = 5 + g_width = width - 15 + g_height_start = 15 g_height = height - 30 ctx.set_source_rgb(.5, .5, .5) @@ -66,8 +66,11 @@ class HeaterGraph(Gtk.DrawingArea): ] - points_per_pixel = self.max_length / (gsize[1][0]-gsize[0][0]) - data_points = (gsize[1][0]-gsize[0][0]) * points_per_pixel + graph_width = gsize[1][0] - gsize[0][0] + points_per_pixel = self.max_length / graph_width + if points_per_pixel > 3: + points_per_pixel = 3 + data_points = graph_width * points_per_pixel logging.info("aa: %s %s" % (points_per_pixel, data_points)) max_num = math.ceil(self.get_max_num(data_points) * 1.1 / 10) * 10 d_width = 1 / points_per_pixel @@ -130,7 +133,7 @@ class HeaterGraph(Gtk.DrawingArea): for i in range(r): ctx.set_source_rgb(.5, .5, .5) lheight = gsize[1][1] - nscale*i*hscale - ctx.move_to(10, lheight + 3) + ctx.move_to(6, lheight + 3) ctx.show_text(str(nscale*i).rjust(3, " ")) ctx.stroke() ctx.set_source_rgba(.5, .5, .5, .2) @@ -156,7 +159,7 @@ class HeaterGraph(Gtk.DrawingArea): ctx.stroke() ctx.set_source_rgb(.5, .5, .5) - ctx.move_to(x - 15, gsize[1][1] + 10) + ctx.move_to(x - 15, gsize[1][1] + 15) hour = now.hour min = now.minute - (now.minute % 2) - i*2 diff --git a/ks_includes/screen_panel.py b/ks_includes/screen_panel.py index 26a322b6..016e423e 100644 --- a/ks_includes/screen_panel.py +++ b/ks_includes/screen_panel.py @@ -41,10 +41,8 @@ class ScreenPanel: self._screen._ws.klippy.emergency_stop() def format_target(self, temp): - _ = self.lang.gettext - if temp <= 0: - return _("Off") + return "" else: return self.format_temp(temp, 0) diff --git a/panels/main_menu.py b/panels/main_menu.py index 375abf0e..4a027f78 100644 --- a/panels/main_menu.py +++ b/panels/main_menu.py @@ -94,6 +94,9 @@ class MainPanel(MenuPanel): name.connect('clicked', self.on_popover_clicked, device) name.set_alignment(0, .5) name.get_style_context().add_class(class_name) + child = name.get_children()[0].get_children()[0].get_children()[1] + child.set_ellipsize(True) + child.set_ellipsize(Pango.EllipsizeMode.END) logging.info("DClass %s %s" % (device, class_name)) diff --git a/styles/base.css b/styles/base.css index 448fa1be..da4c244a 100644 --- a/styles/base.css +++ b/styles/base.css @@ -247,6 +247,10 @@ trough { min-height: 350px; } +.heater-grid { + margin-right: .5em; +} + .heater-grid label { margin-top: .3em; margin-bottom: .3em;