Commit ba2a1ed1 authored by Roman Alifanov's avatar Roman Alifanov

widgets/info_graph_multi: use Adw.WrapBox for centered last row

parent 4ec846c6
from gi.repository import Gtk
from gi.repository import Adw, Gtk
from .BaseWidget import BaseWidget
......@@ -14,22 +14,24 @@ class InfoGraphMultiWidget(BaseWidget):
self.columns = setting.map.get('columns', 3) if setting.map else 3
def create_row(self):
self.flow_box = Gtk.FlowBox(
homogeneous=True,
selection_mode=Gtk.SelectionMode.NONE,
self.wrap_box = Adw.WrapBox(
line_homogeneous=True,
natural_line_length=self.columns * 160,
justify=Adw.JustifyMode.NONE,
align=0.5,
margin_start=6,
margin_end=6,
margin_top=6,
margin_bottom=6,
row_spacing=6,
column_spacing=6
line_spacing=6,
child_spacing=6
)
self.row = Gtk.ListBoxRow(
selectable=False,
activatable=False
)
self.row.set_child(self.flow_box)
self.row.set_child(self.wrap_box)
return self.row
......@@ -46,7 +48,8 @@ class InfoGraphMultiWidget(BaseWidget):
orientation=Gtk.Orientation.VERTICAL,
spacing=0,
css_classes=["card"],
width_request=150
width_request=150,
hexpand=False
)
drawing_area = Gtk.DrawingArea()
......@@ -152,7 +155,7 @@ class InfoGraphMultiWidget(BaseWidget):
if name not in self.graphs:
card = self._create_graph_card(name)
self.flow_box.append(card)
self.wrap_box.append(card)
graph = self.graphs[name]
graph['history'].append(value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment