Skip to content

Commit

Permalink
Merge pull request #1315 from ByteOfBrie/fix-outline-crash
Browse files Browse the repository at this point in the history
Fix crash when clicking outline
  • Loading branch information
TheJackiMonster authored Oct 2, 2024
2 parents 5d66131 + e1c7cd6 commit 54d2ca1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manuskript/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def launch(arguments, app, MW = None):
kernel.initialize(['python', '--matplotlib=qt'])

# Create the console in a new process and connect
console = connect_qtconsole(kernel.abs_connection_file, profile=kernel.profile)
console = connect_qtconsole(kernel.abs_connection_file)

# Export MW and app variable to the console's namespace
kernel.shell.user_ns['MW'] = MW
Expand Down
2 changes: 1 addition & 1 deletion manuskript/ui/editors/fullScreenEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def paintEvent(self, event):
# painter.restore()

# slider
r = style.subControlRect(style.CC_ScrollBar, opt, style.SC_ScrollBarSlider)
r = style.subControlRect(style.CC_ScrollBar, opt, style.SC_ScrollBarSlider, None)
painter.fillRect(r, self._color)
painter.end()

Expand Down
10 changes: 5 additions & 5 deletions manuskript/ui/views/outlineDelegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def paint(self, painter, option, index):
opt = QStyleOptionViewItem(option)
self.initStyleOption(opt, index)

iconRect = style.subElementRect(style.SE_ItemViewItemDecoration, opt)
textRect = style.subElementRect(style.SE_ItemViewItemText, opt)
iconRect = style.subElementRect(style.SE_ItemViewItemDecoration, opt, None)
textRect = style.subElementRect(style.SE_ItemViewItemText, opt, None)

# Background
style.drawPrimitive(style.PE_PanelItemViewItem, opt, painter)
Expand Down Expand Up @@ -183,7 +183,7 @@ def paint(self, painter, option, index):
if itemIndex.isValid() and self.mdlCharacter.data(itemIndex) not in ["", None]:
opt = QStyleOptionComboBox()
opt.rect = option.rect
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow)
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow, None)
option.rect = r
qApp.style().drawPrimitive(QStyle.PE_IndicatorArrowDown, option, painter)

Expand Down Expand Up @@ -295,7 +295,7 @@ def paint(self, painter, option, index):
if index.isValid() and index.internalPointer().data(Outline.status) not in ["", None, "0", 0]:
opt = QStyleOptionComboBox()
opt.rect = option.rect
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow)
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow, None)
option.rect = r
qApp.style().drawPrimitive(QStyle.PE_IndicatorArrowDown, option, painter)

Expand Down Expand Up @@ -361,6 +361,6 @@ def paint(self, painter, option, index):
if index.isValid() and index.internalPointer().data(Outline.label) not in ["", None, "0", 0]:
opt = QStyleOptionComboBox()
opt.rect = option.rect
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow)
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow, None)
option.rect = r
qApp.style().drawPrimitive(QStyle.PE_IndicatorArrowDown, option, painter)

0 comments on commit 54d2ca1

Please sign in to comment.