From 1d305db29ebd37466e461cc9dfe05c4fb7ff3769 Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Sat, 29 Jun 2013 19:02:19 +0200 Subject: [PATCH] minor UI layout tweaks --- lib/solaar/ui/config_panel.py | 10 ++++++---- lib/solaar/ui/window.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py index 18dc71aa..0fc14312 100644 --- a/lib/solaar/ui/config_panel.py +++ b/lib/solaar/ui/config_panel.py @@ -16,7 +16,7 @@ try: from Queue import Queue as _Queue except ImportError: from queue import Queue as _Queue -_apply_queue = _Queue(4) +_apply_queue = _Queue(8) def _process_apply_queue(): def _write_start(sbox): @@ -160,16 +160,17 @@ _items = {} def create(): global _box assert _box is None - _box = Gtk.VBox(homogeneous=False, spacing=4) - # _box.set_property('margin', 8) + _box = Gtk.VBox(homogeneous=False, spacing=8) _box._last_device = None return _box -def update(device, is_online): +def update(device, is_online=None): assert _box is not None assert device device_id = (device.receiver.path, device.number) + if is_online is None: + is_online = bool(device.online) # if the device changed since last update, clear the box first if device_id != _box._last_device: @@ -196,6 +197,7 @@ def update(device, is_online): _box.set_visible(True) + def clean(device): """Remove the controls for a given device serial. Needed after the device has been unpaired. diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py index 14c75fd3..08835c5b 100644 --- a/lib/solaar/ui/window.py +++ b/lib/solaar/ui/window.py @@ -135,7 +135,7 @@ def _create_device_panel(): p.pack_start(p._lux, False, False, 0) p._config = _config_panel.create() - p.pack_end(p._config, False, False, 8) + p.pack_end(p._config, False, False, 4) return p