Styling updates (#279)

* Dialog buttons colors

* Zcalibrate add colors for buttons

* Fix move panel misalignment and add color to home button

* z-bolt switch styling

* Splash screen homogeneous buttons

* remove switch slider border

* Remove max chars from filename (ellipsizes anyway)

* Fix colorized buttons moving when pressed

* Updater more row spacing

* Colorized button press
This commit is contained in:
Alfredo Monclus
2021-09-23 00:14:21 -03:00
committed by GitHub
parent 7b904fec79
commit 5e3e8be005
8 changed files with 43 additions and 16 deletions

View File

@@ -45,7 +45,6 @@ class JobStatusPanel(ScreenPanel):
self.labels['file'].set_halign(Gtk.Align.START)
self.labels['file'].set_vexpand(False)
self.labels['file'].get_style_context().add_class("printing-filename")
self.labels['file'].set_max_width_chars(26)
self.labels['file'].set_ellipsize(True)
self.labels['file'].set_ellipsize(Pango.EllipsizeMode.END)
self.labels['status'] = Gtk.Label()
@@ -56,7 +55,6 @@ class JobStatusPanel(ScreenPanel):
self.labels['lcdmessage'].set_halign(Gtk.Align.START)
self.labels['lcdmessage'].set_vexpand(False)
self.labels['lcdmessage'].get_style_context().add_class("printing-status")
self.labels['lcdmessage'].set_max_width_chars(43)
self.labels['lcdmessage'].set_ellipsize(True)
self.labels['lcdmessage'].set_ellipsize(Pango.EllipsizeMode.END)

View File

@@ -19,6 +19,7 @@ class MovePanel(ScreenPanel):
_ = self.lang.gettext
grid = Gtk.Grid()
grid.set_column_homogeneous(True)
self.labels['x+'] = self._gtk.ButtonImage("arrow-right", _("X+"), "color1")
self.labels['x+'].connect("clicked", self.move, "X", "+")
@@ -35,7 +36,7 @@ class MovePanel(ScreenPanel):
self.labels['z-'] = self._gtk.ButtonImage("z-closer", _("Z-"), "color3")
self.labels['z-'].connect("clicked", self.move, "Z", "-")
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"))
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"), "color4")
self.labels['home'].connect("clicked", self.home)
if self._screen.lang_ltr:

View File

@@ -34,9 +34,8 @@ class SplashScreenPanel(ScreenPanel):
self.labels['actions'] = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.labels['actions'].set_hexpand(True)
self.labels['actions'].set_vexpand(False)
self.labels['actions'].set_halign(Gtk.Align.END)
self.labels['actions'].set_margin_end(20)
self.labels['actions'].set_halign(Gtk.Align.CENTER)
self.labels['actions'].set_homogeneous(True)
main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
main.pack_start(image, True, True, 0)
@@ -57,8 +56,6 @@ class SplashScreenPanel(ScreenPanel):
_ = self.lang.gettext
if "firmware_restart" not in self.labels:
self.labels['printer_select'] = self._gtk.ButtonImage("shuffle", _("Change Printer"))
self.labels['printer_select'].connect("clicked", self._screen.show_printer_select)
self.labels['menu'] = self._gtk.ButtonImage("settings", _("Menu"), "color4")
self.labels['menu'].connect("clicked", self._screen._go_to_submenu, "")
self.labels['power'] = self._gtk.ButtonImage("shutdown", _("Power On Printer"), "color3")
@@ -80,8 +77,6 @@ class SplashScreenPanel(ScreenPanel):
self.labels['actions'].add(self.labels['restart'])
self.labels['actions'].add(self.labels['firmware_restart'])
self.labels['actions'].add(self.labels['menu'])
if len(self._config.get_printers()) > 1:
self.labels['actions'].add(self.labels['printer_select'])
self.labels['actions'].show_all()
def firmware_restart(self, widget):

View File

@@ -93,6 +93,7 @@ class SystemPanel(ScreenPanel):
infogrid.attach(self.labels[prog], 1, i, 1, 1)
self.labels[prog].get_style_context().add_class('updater-item')
i = i + 1
scroll.add(infogrid)

View File

@@ -33,9 +33,9 @@ class ZCalibratePanel(ScreenPanel):
box.add(label)
box.add(self.labels['zposition'])
zpos = self._gtk.ButtonImage('z-farther', _("Raise Nozzle"))
zpos = self._gtk.ButtonImage('z-farther', _("Raise Nozzle"), 'color3')
zpos.connect("clicked", self.move, "+")
zneg = self._gtk.ButtonImage('z-closer', _("Lower Nozzle"))
zneg = self._gtk.ButtonImage('z-closer', _("Lower Nozzle"), 'color2')
zneg.connect("clicked", self.move, "-")
distgrid = Gtk.Grid()
@@ -66,7 +66,7 @@ class ZCalibratePanel(ScreenPanel):
complete = self._gtk.ButtonImage('complete', _('Accept'), 'color4')
complete.connect("clicked", self.accept)
b = self._gtk.ButtonImage('cancel', _('Abort'), 'color2')
b = self._gtk.ButtonImage('cancel', _('Abort'), 'color1')
b.connect("clicked", self.abort)