main menu and temp cleanups and tweaks
This commit is contained in:
parent
fcbe264d1a
commit
f9e6ac62b7
panels
styles
@ -119,13 +119,6 @@ class MainPanel(MenuPanel):
|
|||||||
temp = self._gtk.Button("")
|
temp = self._gtk.Button("")
|
||||||
temp.connect('clicked', self.on_popover_clicked, device)
|
temp.connect('clicked', self.on_popover_clicked, device)
|
||||||
|
|
||||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
|
||||||
|
|
||||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
|
||||||
dev.set_hexpand(True)
|
|
||||||
dev.set_vexpand(False)
|
|
||||||
dev.add(labels)
|
|
||||||
|
|
||||||
self.devices[device] = {
|
self.devices[device] = {
|
||||||
"class": class_name,
|
"class": class_name,
|
||||||
"name": name,
|
"name": name,
|
||||||
@ -171,21 +164,19 @@ class MainPanel(MenuPanel):
|
|||||||
|
|
||||||
name = Gtk.Label("")
|
name = Gtk.Label("")
|
||||||
temp = Gtk.Label(_("Temp (°C)"))
|
temp = Gtk.Label(_("Temp (°C)"))
|
||||||
temp.set_size_request(round(self._gtk.get_font_size() * 7.7), 0)
|
temp.set_size_request(round(self._gtk.get_font_size() * 7.7), -1)
|
||||||
|
|
||||||
self.labels['devices'].attach(name, 0, 0, 1, 1)
|
self.labels['devices'].attach(name, 0, 0, 1, 1)
|
||||||
self.labels['devices'].attach(temp, 1, 0, 1, 1)
|
self.labels['devices'].attach(temp, 1, 0, 1, 1)
|
||||||
|
|
||||||
da = HeaterGraph(self._printer, self._gtk.get_font_size())
|
self.labels['da'] = HeaterGraph(self._printer, self._gtk.get_font_size())
|
||||||
da.set_vexpand(True)
|
self.labels['da'].set_vexpand(True)
|
||||||
self.labels['da'] = da
|
|
||||||
|
|
||||||
scroll = self._gtk.ScrolledWindow()
|
scroll = self._gtk.ScrolledWindow()
|
||||||
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
|
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
|
||||||
scroll.add(self.labels['devices'])
|
scroll.add(self.labels['devices'])
|
||||||
|
|
||||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||||
box.set_vexpand(True)
|
|
||||||
box.add(scroll)
|
box.add(scroll)
|
||||||
box.add(self.labels['da'])
|
box.add(self.labels['da'])
|
||||||
|
|
||||||
@ -202,10 +193,9 @@ class MainPanel(MenuPanel):
|
|||||||
popover.set_position(Gtk.PositionType.BOTTOM)
|
popover.set_position(Gtk.PositionType.BOTTOM)
|
||||||
self.labels['popover'] = popover
|
self.labels['popover'] = popover
|
||||||
|
|
||||||
i = sum(1 for d in self._printer.get_temp_store_devices() if self.add_device(d))
|
for d in self._printer.get_temp_store_devices():
|
||||||
|
self.add_device(d)
|
||||||
|
|
||||||
graph_height = (self._gtk.get_content_height() / 2) - ((i + 2) * 4 * self._gtk.get_font_size())
|
|
||||||
self.labels['da'].set_size_request(-1, graph_height)
|
|
||||||
return box
|
return box
|
||||||
|
|
||||||
def graph_show_device(self, widget, show=True):
|
def graph_show_device(self, widget, show=True):
|
||||||
|
@ -321,13 +321,6 @@ class TemperaturePanel(ScreenPanel):
|
|||||||
temp = self._gtk.Button("")
|
temp = self._gtk.Button("")
|
||||||
temp.connect('clicked', self.select_heater, device)
|
temp.connect('clicked', self.select_heater, device)
|
||||||
|
|
||||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
|
||||||
|
|
||||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
|
||||||
dev.set_hexpand(True)
|
|
||||||
dev.set_vexpand(False)
|
|
||||||
dev.add(labels)
|
|
||||||
|
|
||||||
self.devices[device] = {
|
self.devices[device] = {
|
||||||
"class": class_name,
|
"class": class_name,
|
||||||
"name": name,
|
"name": name,
|
||||||
@ -377,21 +370,19 @@ class TemperaturePanel(ScreenPanel):
|
|||||||
|
|
||||||
name = Gtk.Label("")
|
name = Gtk.Label("")
|
||||||
temp = Gtk.Label(_("Temp (°C)"))
|
temp = Gtk.Label(_("Temp (°C)"))
|
||||||
temp.set_size_request(round(self._gtk.get_font_size() * 7.7), 0)
|
temp.set_size_request(round(self._gtk.get_font_size() * 7.7), -1)
|
||||||
|
|
||||||
self.labels['devices'].attach(name, 0, 0, 1, 1)
|
self.labels['devices'].attach(name, 0, 0, 1, 1)
|
||||||
self.labels['devices'].attach(temp, 1, 0, 1, 1)
|
self.labels['devices'].attach(temp, 1, 0, 1, 1)
|
||||||
|
|
||||||
da = HeaterGraph(self._printer, self._gtk.get_font_size())
|
self.labels['da'] = HeaterGraph(self._printer, self._gtk.get_font_size())
|
||||||
da.set_vexpand(True)
|
self.labels['da'].set_vexpand(True)
|
||||||
self.labels['da'] = da
|
|
||||||
|
|
||||||
scroll = self._gtk.ScrolledWindow()
|
scroll = self._gtk.ScrolledWindow()
|
||||||
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
|
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
|
||||||
scroll.add(self.labels['devices'])
|
scroll.add(self.labels['devices'])
|
||||||
|
|
||||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||||
box.set_vexpand(True)
|
|
||||||
box.add(scroll)
|
box.add(scroll)
|
||||||
box.add(self.labels['da'])
|
box.add(self.labels['da'])
|
||||||
|
|
||||||
@ -408,10 +399,9 @@ class TemperaturePanel(ScreenPanel):
|
|||||||
popover.set_position(Gtk.PositionType.BOTTOM)
|
popover.set_position(Gtk.PositionType.BOTTOM)
|
||||||
self.labels['popover'] = popover
|
self.labels['popover'] = popover
|
||||||
|
|
||||||
i = sum(1 for d in self._printer.get_temp_store_devices() if self.add_device(d))
|
for d in self._printer.get_temp_store_devices():
|
||||||
|
self.add_device(d)
|
||||||
|
|
||||||
graph_height = (self._gtk.get_content_height() / 2) - ((i + 2) * 4 * self._gtk.get_font_size())
|
|
||||||
self.labels['da'].set_size_request(-1, graph_height)
|
|
||||||
return box
|
return box
|
||||||
|
|
||||||
def graph_show_device(self, widget, show=True):
|
def graph_show_device(self, widget, show=True):
|
||||||
|
@ -21,7 +21,6 @@ button:active {
|
|||||||
border-color: #073642; /*base02*/
|
border-color: #073642; /*base02*/
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
border-width: .25em;
|
|
||||||
background-color: #073642; /*base02*/
|
background-color: #073642; /*base02*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ button:active {
|
|||||||
.button_active {
|
.button_active {
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
border-color: #d81549;
|
border-color: #d81549;
|
||||||
|
border-width: .15em;
|
||||||
border-style: dashed;
|
border-style: dashed;
|
||||||
border-width: .25em;
|
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ button:active {
|
|||||||
.button_active {
|
.button_active {
|
||||||
border-color: #282828;
|
border-color: #282828;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: .25em;
|
|
||||||
background-color: #282828;
|
background-color: #282828;
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,8 @@ button:active {
|
|||||||
.button_active {
|
.button_active {
|
||||||
border-color: #BDBDBD;
|
border-color: #BDBDBD;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: .25em;
|
|
||||||
background-color: white;
|
background-color: white;
|
||||||
box-shadow: .1em .1em #BDBDBD;
|
box-shadow: .15em .15em #BDBDBD;
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user