diff --git a/calculate-monitors.patch b/calculate-monitors.patch new file mode 100644 index 0000000..cd00379 --- /dev/null +++ b/calculate-monitors.patch @@ -0,0 +1,22 @@ +diff --git a/toolbars.py b/toolbars.py +index ca24c2c..9924a00 100644 +--- a/toolbars.py ++++ b/toolbars.py +@@ -13,6 +13,8 @@ from sugar3.graphics.toolbutton import ToolButton + from sugar3.graphics.toggletoolbutton import ToggleToolButton + from sugar3.graphics.style import GRID_CELL_SIZE + ++from sugarapp.helpers import PrimaryMonitor ++ + import logging + _logger = logging.getLogger('calc-activity') + +@@ -383,7 +385,7 @@ class MiscToolbar(Gtk.Toolbar): + self.show_all() + + def update_layout(self): +- if Gdk.Screen.width() < 14 * GRID_CELL_SIZE or \ ++ if PrimaryMonitor.width() < 14 * GRID_CELL_SIZE or \ + self._target_toolbar is None: + target_toolbar = self + if self._target_toolbar is not None: diff --git a/calculate-port.patch b/calculate-port.patch index c4a8cff..d5782d6 100644 --- a/calculate-port.patch +++ b/calculate-port.patch @@ -44,25 +44,3 @@ index 46d02b2..1e8de97 100644 self._sync_hid = None self._message_cbs = {} -diff --git a/toolbars.py b/toolbars.py -index ca24c2c..9924a00 100644 ---- a/toolbars.py -+++ b/toolbars.py -@@ -13,6 +13,8 @@ from sugar3.graphics.toolbutton import ToolButton - from sugar3.graphics.toggletoolbutton import ToggleToolButton - from sugar3.graphics.style import GRID_CELL_SIZE - -+from sugarapp.helpers import PrimaryMonitor -+ - import logging - _logger = logging.getLogger('calc-activity') - -@@ -383,7 +385,7 @@ class MiscToolbar(Gtk.Toolbar): - self.show_all() - - def update_layout(self): -- if Gdk.Screen.width() < 14 * GRID_CELL_SIZE or \ -+ if PrimaryMonitor.width() < 14 * GRID_CELL_SIZE or \ - self._target_toolbar is None: - target_toolbar = self - if self._target_toolbar is not None: diff --git a/org.sugarlabs.Calculate.json b/org.sugarlabs.Calculate.json index f28f664..75d501d 100644 --- a/org.sugarlabs.Calculate.json +++ b/org.sugarlabs.Calculate.json @@ -35,6 +35,10 @@ { "type": "patch", "path": "calculate-info.patch" + }, + { + "type": "patch", + "path": "calculate-monitors.patch" } ], "post-install": [