mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
disable plastique theme on osx as possible crash fix
This commit is contained in:
parent
1df385db12
commit
927e618f53
1 changed files with 18 additions and 10 deletions
|
@ -1,10 +1,14 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
from anki.lang import _
|
import re
|
||||||
|
import os
|
||||||
|
import urllib2
|
||||||
|
import ctypes
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
from anki.lang import _
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
import re, os, urllib2, ctypes
|
|
||||||
from anki.utils import stripHTML, isWin, isMac, namedtmp, json, stripHTMLMedia
|
from anki.utils import stripHTML, isWin, isMac, namedtmp, json, stripHTMLMedia
|
||||||
import anki.sound
|
import anki.sound
|
||||||
from anki.hooks import runHook, runFilter
|
from anki.hooks import runHook, runFilter
|
||||||
|
@ -15,7 +19,6 @@ from aqt.utils import shortcut, showInfo, showWarning, getBase, getFile, \
|
||||||
import aqt
|
import aqt
|
||||||
import anki.js
|
import anki.js
|
||||||
from BeautifulSoup import BeautifulSoup
|
from BeautifulSoup import BeautifulSoup
|
||||||
import urllib
|
|
||||||
|
|
||||||
pics = ("jpg", "jpeg", "png", "tif", "tiff", "gif", "svg")
|
pics = ("jpg", "jpeg", "png", "tif", "tiff", "gif", "svg")
|
||||||
audio = ("wav", "mp3", "ogg", "flac", "mp4", "swf", "mov", "mpeg", "mkv")
|
audio = ("wav", "mp3", "ogg", "flac", "mp4", "swf", "mov", "mpeg", "mkv")
|
||||||
|
@ -313,7 +316,8 @@ class Editor(object):
|
||||||
b.setFixedHeight(20)
|
b.setFixedHeight(20)
|
||||||
b.setFixedWidth(20)
|
b.setFixedWidth(20)
|
||||||
if not native:
|
if not native:
|
||||||
b.setStyle(self.plastiqueStyle)
|
if self.plastiqueStyle:
|
||||||
|
b.setStyle(self.plastiqueStyle)
|
||||||
b.setFocusPolicy(Qt.NoFocus)
|
b.setFocusPolicy(Qt.NoFocus)
|
||||||
else:
|
else:
|
||||||
b.setAutoDefault(False)
|
b.setAutoDefault(False)
|
||||||
|
@ -333,18 +337,22 @@ class Editor(object):
|
||||||
def setupButtons(self):
|
def setupButtons(self):
|
||||||
self._buttons = {}
|
self._buttons = {}
|
||||||
# button styles for mac
|
# button styles for mac
|
||||||
self.plastiqueStyle = QStyleFactory.create("plastique")
|
if not isMac:
|
||||||
if not self.plastiqueStyle:
|
self.plastiqueStyle = QStyleFactory.create("plastique")
|
||||||
# plastique was removed in qt5
|
if not self.plastiqueStyle:
|
||||||
self.plastiqueStyle = QStyleFactory.create("fusion")
|
# plastique was removed in qt5
|
||||||
self.widget.setStyle(self.plastiqueStyle)
|
self.plastiqueStyle = QStyleFactory.create("fusion")
|
||||||
|
self.widget.setStyle(self.plastiqueStyle)
|
||||||
|
else:
|
||||||
|
self.plastiqueStyle = None
|
||||||
# icons
|
# icons
|
||||||
self.iconsBox = QHBoxLayout()
|
self.iconsBox = QHBoxLayout()
|
||||||
if not isMac:
|
if not isMac:
|
||||||
self.iconsBox.setMargin(6)
|
self.iconsBox.setMargin(6)
|
||||||
|
self.iconsBox.setSpacing(0)
|
||||||
else:
|
else:
|
||||||
self.iconsBox.setMargin(0)
|
self.iconsBox.setMargin(0)
|
||||||
self.iconsBox.setSpacing(0)
|
self.iconsBox.setSpacing(14)
|
||||||
self.outerLayout.addLayout(self.iconsBox)
|
self.outerLayout.addLayout(self.iconsBox)
|
||||||
b = self._addButton
|
b = self._addButton
|
||||||
b("fields", self.onFields, "",
|
b("fields", self.onFields, "",
|
||||||
|
|
Loading…
Reference in a new issue