From 7cc33e72b9cd08f41eb8d13a29f013238ca85577 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 28 Feb 2023 13:32:16 +0530 Subject: Toolbar Color Change and Close Button Added for Project Title Bar --- src/main/python/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/python/main.py') diff --git a/src/main/python/main.py b/src/main/python/main.py index 3aa8e6a..bf94a5b 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -108,7 +108,7 @@ class appWindow(QMainWindow): if not project.tabList: # important when unpickling a file instead project.newDiagram() #create a new tab in the new file project.fileCloseEvent.connect(self.fileClosed) #closed file signal to switch to sub window view - if self.count > 1: #switch to tab view if needed + if self.count > 0: #switch to tab view if needed self.mdi.setViewMode(QMdiArea.TabbedView) project.show() @@ -170,7 +170,7 @@ class appWindow(QMainWindow): def fileClosed(self, index): #checks if the file tab menu needs to be removed - if self.count <= 2 : + if self.count <= 1 : self.mdi.setViewMode(QMdiArea.SubWindowView) def writeSettings(self): -- cgit From 8aac54fa34d3f4916cf7da2bedefa56cb91d55be Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 28 Feb 2023 14:07:53 +0530 Subject: Remove Project Title Bar --- src/main/python/main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/main/python/main.py') diff --git a/src/main/python/main.py b/src/main/python/main.py index bf94a5b..5af252d 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -104,12 +104,12 @@ class appWindow(QMainWindow): #call to create a new file inside mdi area project = FileWindow(self.mdi) project.setObjectName("New Project") + project.setWindowFlags(Qt.FramelessWindowHint) self.mdi.addSubWindow(project) if not project.tabList: # important when unpickling a file instead project.newDiagram() #create a new tab in the new file project.fileCloseEvent.connect(self.fileClosed) #closed file signal to switch to sub window view - if self.count > 0: #switch to tab view if needed - self.mdi.setViewMode(QMdiArea.TabbedView) + self.mdi.setViewMode(QMdiArea.TabbedView) project.show() def openProject(self): @@ -126,9 +126,7 @@ class appWindow(QMainWindow): project.resizeHandler() project.fileCloseEvent.connect(self.fileClosed) project.show() - if self.count > 1: - # self.tabSpace.setVisible(True) - self.mdi.setViewMode(QMdiArea.TabbedView) + self.mdi.setViewMode(QMdiArea.TabbedView) def saveProject(self): #serialize all files in mdi area @@ -169,9 +167,10 @@ class appWindow(QMainWindow): self.writeSettings() def fileClosed(self, index): + pass #checks if the file tab menu needs to be removed - if self.count <= 1 : - self.mdi.setViewMode(QMdiArea.SubWindowView) + # if self.count <= 1 : + # self.mdi.setViewMode(QMdiArea.SubWindowView) def writeSettings(self): # write window state on window close -- cgit