← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~floft/openlp/hidecursor into lp:openlp

 

You have been requested to review the proposed merge of lp:~floft/openlp/hidecursor into lp:openlp.

For more details, see:
https://code.launchpad.net/~floft/openlp/hidecursor/+merge/46519

Add a setting to hide the mouse cursor when moved onto the display screen.

-- 
https://code.launchpad.net/~floft/openlp/hidecursor/+merge/46519
Your team OpenLP Core is requested to review the proposed merge of lp:~floft/openlp/hidecursor into lp:openlp.
=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py	2011-01-04 09:19:53 +0000
+++ openlp/core/ui/advancedtab.py	2011-01-17 19:37:16 +0000
@@ -72,6 +72,14 @@
             u'enableAutoCloseCheckBox')
         self.uiLayout.addRow(self.enableAutoCloseCheckBox)
         self.leftLayout.addWidget(self.uiGroupBox)
+        self.hideMouseGroupBox = QtGui.QGroupBox(self.leftColumn)
+        self.hideMouseGroupBox.setObjectName(u'hideMouseGroupBox')
+        self.hideMouseLayout = QtGui.QVBoxLayout(self.hideMouseGroupBox)
+        self.hideMouseLayout.setObjectName(u'hideMouseLayout')
+        self.hideMouseCheckBox = QtGui.QCheckBox(self.hideMouseGroupBox)
+        self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
+        self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
+        self.leftLayout.addWidget(self.hideMouseGroupBox)
 #        self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn)
 #        self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
 #        self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox)
@@ -117,6 +125,10 @@
             'Expand new service items on creation'))
         self.enableAutoCloseCheckBox.setText(translate('OpenLP.AdvancedTab',
             'Enable application exit confirmation'))
+        self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
+            'Mouse Cursor'))
+        self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
+            'Hide the mouse cursor when moved over the display window'))
 #        self.sharedDirGroupBox.setTitle(
 #            translate('AdvancedTab', 'Central Data Store'))
 #        self.sharedCheckBox.setText(
@@ -150,6 +162,9 @@
         self.enableAutoCloseCheckBox.setChecked(
             settings.value(u'enable exit confirmation',
             QtCore.QVariant(True)).toBool())
+        self.hideMouseCheckBox.setChecked(
+            settings.value(u'hide mouse',
+            QtCore.QVariant(False)).toBool())
         settings.endGroup()
 
     def save(self):
@@ -168,6 +183,8 @@
             QtCore.QVariant(self.expandServiceItemCheckBox.isChecked()))
         settings.setValue(u'enable exit confirmation',
             QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
+        settings.setValue(u'hide mouse',
+            QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
         settings.endGroup()
 
 #    def onSharedCheckBoxChanged(self, checked):

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2011-01-17 15:43:07 +0000
+++ openlp/core/ui/maindisplay.py	2011-01-17 19:37:16 +0000
@@ -435,6 +435,14 @@
         # if was hidden keep it hidden
         if self.hideMode and self.isLive:
             self.hideDisplay(self.hideMode)
+        # Hide mouse cursor when moved over display if enabled in settings
+        settings = QtCore.QSettings()
+        if settings.value(u'advanced/hide mouse', QtCore.QVariant(False)).toBool():
+            self.setCursor(QtCore.Qt.BlankCursor)
+            self.frame.evaluateJavaScript('document.body.style.cursor = "none"')
+        else:
+            self.setCursor(QtCore.Qt.ArrowCursor)
+            self.frame.evaluateJavaScript('document.body.style.cursor = "auto"')
 
     def footer(self, text):
         """


References