forked from openlp/openlp
Fix the colour of the icons on macOS
This commit is contained in:
parent
28a7840b9f
commit
5c0082e434
@ -49,9 +49,9 @@ class UiIcons(metaclass=Singleton):
|
|||||||
qta.load_font('op', font_path, charmap_path)
|
qta.load_font('op', font_path, charmap_path)
|
||||||
palette = QtWidgets.QApplication.palette()
|
palette = QtWidgets.QApplication.palette()
|
||||||
qta.set_defaults(color=palette.color(QtGui.QPalette.Active,
|
qta.set_defaults(color=palette.color(QtGui.QPalette.Active,
|
||||||
QtGui.QPalette.ButtonText),
|
QtGui.QPalette.WindowText),
|
||||||
color_disabled=palette.color(QtGui.QPalette.Disabled,
|
color_disabled=palette.color(QtGui.QPalette.Disabled,
|
||||||
QtGui.QPalette.ButtonText))
|
QtGui.QPalette.WindowText))
|
||||||
icon_list = {
|
icon_list = {
|
||||||
'active': {'icon': 'fa.child'},
|
'active': {'icon': 'fa.child'},
|
||||||
'add': {'icon': 'fa.plus-circle'},
|
'add': {'icon': 'fa.plus-circle'},
|
||||||
|
@ -88,6 +88,22 @@ def test_critical_error_message_box(MockRegistry):
|
|||||||
MockRegistry.return_value.get.return_value.error_message.assert_called_once_with('Error', 'This is an error')
|
MockRegistry.return_value.get.return_value.error_message.assert_called_once_with('Error', 'This is an error')
|
||||||
|
|
||||||
|
|
||||||
|
@patch('openlp.core.lib.ui.Registry')
|
||||||
|
@patch('openlp.core.lib.ui.QtWidgets.QMessageBox.critical')
|
||||||
|
def test_critical_error_message_box_without_mainwindow(mocked_critical, MockRegistry):
|
||||||
|
"""
|
||||||
|
Test the critical_error_message_box() function
|
||||||
|
"""
|
||||||
|
# GIVEN: A mocked Registry with no MainWindow
|
||||||
|
MockRegistry.return_value.get.return_value = None
|
||||||
|
|
||||||
|
# WHEN: critical_error_message_box() is called
|
||||||
|
critical_error_message_box('Error', 'This is an error')
|
||||||
|
|
||||||
|
# THEN: The error_message() method on the main window should be called
|
||||||
|
mocked_critical.assert_called_once_with(None, 'Error', 'This is an error')
|
||||||
|
|
||||||
|
|
||||||
@patch('openlp.core.lib.ui.QtWidgets.QMessageBox.critical')
|
@patch('openlp.core.lib.ui.QtWidgets.QMessageBox.critical')
|
||||||
def test_critical_error_question(mocked_critical):
|
def test_critical_error_question(mocked_critical):
|
||||||
"""
|
"""
|
||||||
|
@ -28,6 +28,22 @@ from openlp.core.projectors.pjlinkcommands import process_command
|
|||||||
from openlp.core.projectors.constants import E_ERROR, E_WARN, PJLINK_ERST_DATA, PJLINK_ERST_STATUS, S_OK
|
from openlp.core.projectors.constants import E_ERROR, E_WARN, PJLINK_ERST_DATA, PJLINK_ERST_STATUS, S_OK
|
||||||
|
|
||||||
|
|
||||||
|
@patch.object(openlp.core.projectors.pjlinkcommands, 'log')
|
||||||
|
def test_projector_ackn(mock_log, pjlink):
|
||||||
|
"""
|
||||||
|
Test ackn command (empty test)
|
||||||
|
"""
|
||||||
|
# GIVEN: Test setup
|
||||||
|
log_debug_text = [call('({ip}) Processing command "ACKN" with data "0"'.format(ip=pjlink.name)),
|
||||||
|
call('({ip}) Calling function for ACKN'.format(ip=pjlink.name))]
|
||||||
|
|
||||||
|
# WHEN: Called with setting shutter closed and mute on
|
||||||
|
process_command(projector=pjlink, cmd='ACKN', data='0')
|
||||||
|
|
||||||
|
# THEN: Shutter should be closed and mute should be True
|
||||||
|
mock_log.debug.assert_has_calls(log_debug_text)
|
||||||
|
|
||||||
|
|
||||||
@patch.object(openlp.core.projectors.pjlink.PJLink, 'projectorUpdateIcons')
|
@patch.object(openlp.core.projectors.pjlink.PJLink, 'projectorUpdateIcons')
|
||||||
@patch.object(openlp.core.projectors.pjlinkcommands, 'log')
|
@patch.object(openlp.core.projectors.pjlinkcommands, 'log')
|
||||||
def test_projector_avmt_audio_muted(mock_log, mock_UpdateIcons, pjlink):
|
def test_projector_avmt_audio_muted(mock_log, mock_UpdateIcons, pjlink):
|
||||||
|
Loading…
Reference in New Issue
Block a user