diff options
Diffstat (limited to 'shell/console')
-rw-r--r-- | shell/console/__init__.py | 19 | ||||
-rw-r--r-- | shell/console/console.py | 9 | ||||
-rw-r--r-- | shell/console/logviewer.py | 6 |
3 files changed, 9 insertions, 25 deletions
diff --git a/shell/console/__init__.py b/shell/console/__init__.py index d6553b7..5e15721 100644 --- a/shell/console/__init__.py +++ b/shell/console/__init__.py @@ -1,20 +1 @@ from console import Console - -console = None - -def show(): - global console - if not console: - console = Console() - console.show() - -def hide(): - if console: - console.hide() - -def toggle_visibility(): - if not console or not console.props.visible: - show() - else: - hide() - diff --git a/shell/console/console.py b/shell/console/console.py index 1bdd5ce..9e4578b 100644 --- a/shell/console/console.py +++ b/shell/console/console.py @@ -3,10 +3,14 @@ import os import gtk import hippo +from sugar.graphics.roundbox import CanvasRoundBox + class Console(gtk.Window): - def __init__(self): + def __init__(self, shell_model): gtk.Window.__init__(self) + self._shell_model = shell_model + self.set_default_size(gtk.gdk.screen_width() * 3 / 4, gtk.gdk.screen_height() * 3 / 4) self.set_decorated(False) @@ -17,8 +21,7 @@ class Console(gtk.Window): self.add(canvas) canvas.show() - box = hippo.CanvasBox(padding=20, border_color=0x000000FF, - border=3) + box = hippo.CanvasBox(padding=20, background_color=0x000000FF) canvas.set_root(box) self.registry = Registry() diff --git a/shell/console/logviewer.py b/shell/console/logviewer.py index 102552b..ed631fa 100644 --- a/shell/console/logviewer.py +++ b/shell/console/logviewer.py @@ -5,7 +5,6 @@ import hippo import gnomevfs from louie import dispatcher -from sugar.graphics.roundbox import CanvasRoundBox from sugar import env class LogEntry(object): @@ -55,7 +54,7 @@ class LogView(hippo.CanvasBox): widget.props.vadjustment.connect('changed', self._vadj_changed_cb) self.append(scrollbars, hippo.PACK_EXPAND) - self.box = hippo.CanvasBox(spacing=5) + self.box = hippo.CanvasBox(spacing=5, background_color=0xFFFFFFFF) scrollbars.set_root(self.box) for entry_model in self.model: @@ -64,10 +63,11 @@ class LogView(hippo.CanvasBox): dispatcher.connect(self._entry_added_cb, 'entry-added', self.model) def add_entry(self, entry_model): - entry_box = CanvasRoundBox(background_color=0xffffffff, padding=5) + entry_box = hippo.CanvasBox(padding=5) self.box.append(entry_box) entry = hippo.CanvasText(text=entry_model.text, + xalign=hippo.ALIGNMENT_START, size_mode=hippo.CANVAS_SIZE_WRAP_WORD) entry_box.append(entry) |