forked from openlp/openlp
dockwidget tweak
This commit is contained in:
parent
2354ae6530
commit
3a3aee9c4a
@ -37,13 +37,15 @@ class OpenLPDockWidget(QtGui.QDockWidget):
|
|||||||
"""
|
"""
|
||||||
Custom DockWidget class to handle events
|
Custom DockWidget class to handle events
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent=None, name=None):
|
def __init__(self, parent=None, name=None, icon=None):
|
||||||
"""
|
"""
|
||||||
Initialise the DockWidget
|
Initialise the DockWidget
|
||||||
"""
|
"""
|
||||||
log.debug(u'Initialise the DockWidget %s' % name)
|
log.debug(u'Initialise the %s widget' % name)
|
||||||
QtGui.QDockWidget.__init__(self, parent)
|
QtGui.QDockWidget.__init__(self, parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
if name:
|
if name:
|
||||||
self.setObjectName(name)
|
self.setObjectName(name)
|
||||||
|
if icon:
|
||||||
|
self.setWindowIcon(icon)
|
||||||
self.setFloating(False)
|
self.setFloating(False)
|
||||||
|
@ -141,13 +141,12 @@ class Ui_MainWindow(object):
|
|||||||
self.DefaultThemeLabel.setObjectName(u'DefaultThemeLabel')
|
self.DefaultThemeLabel.setObjectName(u'DefaultThemeLabel')
|
||||||
self.StatusBar.addPermanentWidget(self.DefaultThemeLabel)
|
self.StatusBar.addPermanentWidget(self.DefaultThemeLabel)
|
||||||
# Create the MediaManager
|
# Create the MediaManager
|
||||||
self.MediaManagerDock = OpenLPDockWidget(MainWindow)
|
self.MediaManagerDock = OpenLPDockWidget(
|
||||||
self.MediaManagerDock.setWindowIcon(
|
MainWindow, u'MediaManagerDock',
|
||||||
build_icon(u':/system/system_mediamanager.png'))
|
build_icon(u':/system/system_mediamanager.png'))
|
||||||
self.MediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE)
|
self.MediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE)
|
||||||
self.MediaManagerDock.setMinimumWidth(
|
self.MediaManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_left)
|
self.settingsmanager.mainwindow_left)
|
||||||
self.MediaManagerDock.setObjectName(u'MediaManagerDock')
|
|
||||||
self.MediaManagerContents = QtGui.QWidget(MainWindow)
|
self.MediaManagerContents = QtGui.QWidget(MainWindow)
|
||||||
self.MediaManagerContents.setObjectName(u'MediaManagerContents')
|
self.MediaManagerContents.setObjectName(u'MediaManagerContents')
|
||||||
self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents)
|
self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents)
|
||||||
@ -161,10 +160,9 @@ class Ui_MainWindow(object):
|
|||||||
MainWindow.addDockWidget(
|
MainWindow.addDockWidget(
|
||||||
QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
|
QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
|
||||||
# Create the service manager
|
# Create the service manager
|
||||||
self.ServiceManagerDock = OpenLPDockWidget(MainWindow)
|
self.ServiceManagerDock = OpenLPDockWidget(
|
||||||
self.ServiceManagerDock.setWindowIcon(
|
MainWindow, u'ServiceManagerDock',
|
||||||
build_icon(u':/system/system_servicemanager.png'))
|
build_icon(u':/system/system_servicemanager.png'))
|
||||||
self.ServiceManagerDock.setObjectName(u'ServiceManagerDock')
|
|
||||||
self.ServiceManagerDock.setMinimumWidth(
|
self.ServiceManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_right)
|
self.settingsmanager.mainwindow_right)
|
||||||
self.ServiceManagerContents = ServiceManager(self)
|
self.ServiceManagerContents = ServiceManager(self)
|
||||||
@ -172,10 +170,9 @@ class Ui_MainWindow(object):
|
|||||||
MainWindow.addDockWidget(
|
MainWindow.addDockWidget(
|
||||||
QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
|
QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
|
||||||
# Create the theme manager
|
# Create the theme manager
|
||||||
self.ThemeManagerDock = OpenLPDockWidget(MainWindow)
|
self.ThemeManagerDock = OpenLPDockWidget(
|
||||||
self.ThemeManagerDock.setWindowIcon(
|
MainWindow, u'ThemeManagerDock',
|
||||||
build_icon(u':/system/system_thememanager.png'))
|
build_icon(u':/system/system_thememanager.png'))
|
||||||
self.ThemeManagerDock.setObjectName(u'ThemeManagerDock')
|
|
||||||
self.ThemeManagerDock.setMinimumWidth(
|
self.ThemeManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_right)
|
self.settingsmanager.mainwindow_right)
|
||||||
self.ThemeManagerContents = ThemeManager(self)
|
self.ThemeManagerContents = ThemeManager(self)
|
||||||
@ -1000,4 +997,4 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.recentFiles.insert(0, QtCore.QString(filename))
|
self.recentFiles.insert(0, QtCore.QString(filename))
|
||||||
while self.recentFiles.count() > maxRecentFiles:
|
while self.recentFiles.count() > maxRecentFiles:
|
||||||
# Don't care what API says takeLast works, removeLast doesn't!
|
# Don't care what API says takeLast works, removeLast doesn't!
|
||||||
self.recentFiles.takeLast()
|
self.recentFiles.takeLast()
|
||||||
|
Loading…
Reference in New Issue
Block a user