From 0de49ee0cd1caa1892f40ccc4509e9fb3d113c24 Mon Sep 17 00:00:00 2001 From: alfrix Date: Sat, 22 Oct 2022 14:26:56 -0300 Subject: [PATCH] base_panel: calculate the amount of titlebar items to be shown --- panels/base_panel.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/panels/base_panel.py b/panels/base_panel.py index d96f6c17..365f604a 100644 --- a/panels/base_panel.py +++ b/panels/base_panel.py @@ -7,6 +7,7 @@ gi.require_version("Gtk", "3.0") from gi.repository import GLib, Gtk, Pango from jinja2 import Environment from datetime import datetime +from math import log from ks_includes.screen_panel import ScreenPanel @@ -140,12 +141,7 @@ class BasePanel(ScreenPanel): self.labels[f'{device}_box'].pack_start(self.labels[device], False, False, 0) # Limit the number of items according to resolution - if self._screen.width <= 480: - nlimit = 3 - elif self._screen.width <= 800: - nlimit = 4 - else: - nlimit = 5 + nlimit = int(round(log(self._screen.width, 10) * 5 - 10.5)) n = 0 if self._screen.printer.get_tools():