def _on_fullscreen_requested(self, request): request.accept() on = request.toggleOn() self.fullscreen_requested.emit(on) if on: notification = miscwidgets.FullscreenNotification(self) notification.show() notification.set_timeout(3000)
def test_timeout(self, qtbot, key_config_stub): w = miscwidgets.FullscreenNotification() qtbot.add_widget(w) with qtbot.waitSignal(w.destroyed): w.set_timeout(1)
def test_text(self, qtbot, config_stub, key_config_stub, bindings, text): config_stub.val.bindings.default = {} config_stub.val.bindings.commands = {'normal': bindings} w = miscwidgets.FullscreenNotification() qtbot.add_widget(w) assert w.text() == text
def test_timeout(self, qtbot, key_config_stub): key_config_stub.set_bindings_for('normal', {}) w = miscwidgets.FullscreenNotification() qtbot.add_widget(w) with qtbot.waitSignal(w.destroyed): w.set_timeout(1)
def test_text(self, qtbot, key_config_stub, bindings, text): key_config_stub.set_bindings_for('normal', bindings) w = miscwidgets.FullscreenNotification() qtbot.add_widget(w) assert w.text() == text