mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-15 18:32:27 +12:00
Merge pull request #1060 from tcsch/feature/split-editor-functionality
Feature/split editor functionality
This commit is contained in:
commit
3e811c75d1
|
@ -217,6 +217,11 @@ class mainEditor(QWidget, Ui_mainEditor):
|
|||
title = self.getIndexTitle(index)
|
||||
|
||||
if tabWidget == None:
|
||||
# no tabWidget specified, update all tabs of views that are a target
|
||||
for ts in self.allTabSplitters():
|
||||
if ts.isTarget:
|
||||
self.setCurrentModelIndex(index, newTab, tabWidget=ts.tab)
|
||||
# additionally always update the current tabWidget
|
||||
tabWidget = self.currentTabWidget()
|
||||
|
||||
# Checking if tab is already opened
|
||||
|
|
|
@ -4,6 +4,7 @@ import locale
|
|||
|
||||
from PyQt5.QtCore import QModelIndex, QRect, QPoint, Qt, QObject, QSize
|
||||
from PyQt5.QtGui import QIcon, QPalette
|
||||
from PyQt5.QtGui import QDropEvent, QDragEnterEvent
|
||||
from PyQt5.QtWidgets import QWidget, QPushButton, qApp
|
||||
|
||||
from manuskript.functions import mainWindow, appPath
|
||||
|
@ -80,6 +81,19 @@ class tabSplitter(QWidget, Ui_tabSplitter):
|
|||
self.tab.currentChanged.connect(self.mainEditor.tabChanged)
|
||||
qApp.focusChanged.connect(self.focusChanged)
|
||||
|
||||
self.setAcceptDrops(True)
|
||||
|
||||
def dragEnterEvent(self, event: QDragEnterEvent) -> None:
|
||||
if event.mimeData().hasFormat('application/xml'):
|
||||
event.accept()
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
def dropEvent(self, event: QDropEvent) -> None:
|
||||
itemID = mainWindow().mdlOutline.decodeMimeData(event.mimeData())[0].ID()
|
||||
itemIndex = mainWindow().mdlOutline.getIndexByID(itemID)
|
||||
self.mainEditor.setCurrentModelIndex(itemIndex, tabWidget = self.tab)
|
||||
|
||||
def updateStyleSheet(self):
|
||||
self.setStyleSheet(style.mainEditorTabSS())
|
||||
if self.secondTab:
|
||||
|
|
Loading…
Reference in a new issue