Fix the colour of the icons on macOS

This commit is contained in:
Raoul Snyman 2020-07-03 11:45:17 -07:00
parent 28a7840b9f
commit 5c0082e434
No known key found for this signature in database
GPG Key ID: 7347E1FA47B16091
3 changed files with 34 additions and 2 deletions

View File

@ -49,9 +49,9 @@ class UiIcons(metaclass=Singleton):
qta.load_font('op', font_path, charmap_path)
palette = QtWidgets.QApplication.palette()
qta.set_defaults(color=palette.color(QtGui.QPalette.Active,
QtGui.QPalette.ButtonText),
QtGui.QPalette.WindowText),
color_disabled=palette.color(QtGui.QPalette.Disabled,
QtGui.QPalette.ButtonText))
QtGui.QPalette.WindowText))
icon_list = {
'active': {'icon': 'fa.child'},
'add': {'icon': 'fa.plus-circle'},

View File

@ -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')
@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')
def test_critical_error_question(mocked_critical):
"""

View File

@ -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
@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.pjlinkcommands, 'log')
def test_projector_avmt_audio_muted(mock_log, mock_UpdateIcons, pjlink):