Skip to content

Commit

Permalink
patch: seperated port and monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoSu-bham committed Aug 15, 2024
1 parent 91abf08 commit 965577b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
22 changes: 22 additions & 0 deletions calculate-monitors.patch
Original file line number Diff line number Diff line change
@@ -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:
22 changes: 0 additions & 22 deletions calculate-port.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions org.sugarlabs.Calculate.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
{
"type": "patch",
"path": "calculate-info.patch"
},
{
"type": "patch",
"path": "calculate-monitors.patch"
}
],
"post-install": [
Expand Down

0 comments on commit 965577b

Please sign in to comment.