def setupUi(self, editorWidget_ui): editorWidget_ui.setObjectName("editorWidget_ui") editorWidget_ui.resize(400, 300) self.verticalLayout_2 = QtWidgets.QVBoxLayout(editorWidget_ui) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.stack = QtWidgets.QStackedWidget(editorWidget_ui) self.stack.setObjectName("stack") self.text = QtWidgets.QWidget() self.text.setObjectName("text") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.text) self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.txtRedacText = textEditView(self.text) self.txtRedacText.setFrameShape(QtWidgets.QFrame.NoFrame) self.txtRedacText.setObjectName("txtRedacText") self.horizontalLayout_2.addWidget(self.txtRedacText) self.stack.addWidget(self.text) self.folder = QtWidgets.QWidget() self.folder.setObjectName("folder") self.verticalLayout = QtWidgets.QVBoxLayout(self.folder) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.scroll = QtWidgets.QScrollArea(self.folder) self.scroll.setAutoFillBackground(True) self.scroll.setFrameShape(QtWidgets.QFrame.NoFrame) self.scroll.setWidgetResizable(True) self.scroll.setObjectName("scroll") self.scrollAreaWidgetContents = QtWidgets.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 400, 300)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.scroll.setWidget(self.scrollAreaWidgetContents) self.verticalLayout.addWidget(self.scroll) self.stack.addWidget(self.folder) self.cork = QtWidgets.QWidget() self.cork.setObjectName("cork") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.cork) self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.corkView = corkView(self.cork) self.corkView.setFrameShape(QtWidgets.QFrame.NoFrame) self.corkView.setObjectName("corkView") self.horizontalLayout_3.addWidget(self.corkView) self.stack.addWidget(self.cork) self.outline = QtWidgets.QWidget() self.outline.setObjectName("outline") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.outline) self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.outlineView = outlineView(self.outline) self.outlineView.setFrameShape(QtWidgets.QFrame.NoFrame) self.outlineView.setObjectName("outlineView") self.verticalLayout_3.addWidget(self.outlineView) self.stack.addWidget(self.outline) self.verticalLayout_2.addWidget(self.stack) self.retranslateUi(editorWidget_ui) self.stack.setCurrentIndex(3) QtCore.QMetaObject.connectSlotsByName(editorWidget_ui)
def addTitle(itm): edt = textEditView(self, html="<h{l}>{t}</h{l}>".format(l=min( itm.level() + 1, 5), t=itm.title()), autoResize=True) edt.setFrameShape(QFrame.NoFrame) self.txtEdits.append(edt) l.addWidget(edt)
def setupUi(self, editorWidget_ui): editorWidget_ui.setObjectName("editorWidget_ui") editorWidget_ui.resize(400, 300) self.verticalLayout_2 = QtWidgets.QVBoxLayout(editorWidget_ui) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.stack = QtWidgets.QStackedWidget(editorWidget_ui) self.stack.setObjectName("stack") self.text = QtWidgets.QWidget() self.text.setObjectName("text") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.text) self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.txtRedacText = textEditView(self.text) self.txtRedacText.setObjectName("txtRedacText") self.horizontalLayout_2.addWidget(self.txtRedacText) self.stack.addWidget(self.text) self.folder = QtWidgets.QWidget() self.folder.setObjectName("folder") self.verticalLayout = QtWidgets.QVBoxLayout(self.folder) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setSpacing(0) self.verticalLayout.setObjectName("verticalLayout") self.scroll = QtWidgets.QScrollArea(self.folder) self.scroll.setAutoFillBackground(True) self.scroll.setWidgetResizable(True) self.scroll.setObjectName("scroll") self.scrollAreaWidgetContents = QtWidgets.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 96, 26)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.scroll.setWidget(self.scrollAreaWidgetContents) self.verticalLayout.addWidget(self.scroll) self.stack.addWidget(self.folder) self.cork = QtWidgets.QWidget() self.cork.setObjectName("cork") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.cork) self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.corkView = corkView(self.cork) self.corkView.setObjectName("corkView") self.horizontalLayout_3.addWidget(self.corkView) self.stack.addWidget(self.cork) self.outline = QtWidgets.QWidget() self.outline.setObjectName("outline") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.outline) self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.outlineView = outlineView(self.outline) self.outlineView.setObjectName("outlineView") self.verticalLayout_3.addWidget(self.outlineView) self.stack.addWidget(self.outline) self.verticalLayout_2.addWidget(self.stack) self.retranslateUi(editorWidget_ui) self.stack.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(editorWidget_ui)
def setupUi(self, basicItemView): basicItemView.setObjectName("basicItemView") basicItemView.resize(400, 425) self.verticalLayout = QtWidgets.QVBoxLayout(basicItemView) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout_11 = QtWidgets.QHBoxLayout() self.horizontalLayout_11.setObjectName("horizontalLayout_11") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_11.addItem(spacerItem) self.lblPlanPOV = QtWidgets.QLabel(basicItemView) self.lblPlanPOV.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.lblPlanPOV.setObjectName("lblPlanPOV") self.horizontalLayout_11.addWidget(self.lblPlanPOV) self.cmbPOV = cmbOutlineCharacterChoser(basicItemView) self.cmbPOV.setFrame(False) self.cmbPOV.setObjectName("cmbPOV") self.horizontalLayout_11.addWidget(self.cmbPOV) self.lblGoal = QtWidgets.QLabel(basicItemView) self.lblGoal.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.lblGoal.setObjectName("lblGoal") self.horizontalLayout_11.addWidget(self.lblGoal) self.txtGoal = lineEditView(basicItemView) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.txtGoal.sizePolicy().hasHeightForWidth()) self.txtGoal.setSizePolicy(sizePolicy) self.txtGoal.setAutoFillBackground(False) self.txtGoal.setStyleSheet("border-radius: 6px;") self.txtGoal.setFrame(False) self.txtGoal.setObjectName("txtGoal") self.horizontalLayout_11.addWidget(self.txtGoal) self.verticalLayout.addLayout(self.horizontalLayout_11) self.txtSummarySentence = lineEditView(basicItemView) self.txtSummarySentence.setText("") self.txtSummarySentence.setObjectName("txtSummarySentence") self.verticalLayout.addWidget(self.txtSummarySentence) self.label_9 = QtWidgets.QLabel(basicItemView) self.label_9.setObjectName("label_9") self.verticalLayout.addWidget(self.label_9) self.txtSummaryFull = textEditView(basicItemView) self.txtSummaryFull.setObjectName("txtSummaryFull") self.verticalLayout.addWidget(self.txtSummaryFull) self.retranslateUi(basicItemView) QtCore.QMetaObject.connectSlotsByName(basicItemView)
def addThemePreviewText(pixmap, themeDatas, screenRect): # Text previewText = textEditView(highlighting=True) previewText.setFrameStyle(QFrame.NoFrame) previewText.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) previewText.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) f = QFile(appPath("resources/themes/preview.txt")) f.open(QIODevice.ReadOnly) previewText.setPlainText(QTextStream(f).readAll()) setThemeEditorDatas(previewText, themeDatas, pixmap, screenRect) previewText.render(pixmap, previewText.pos())
def addText(itm): edt = textEditView(self, index=itm.index(), spellcheck=self.spellcheck, dict=settings.dict, highlighting=True, autoResize=True) edt.setFrameShape(QFrame.NoFrame) edt.setStatusTip("{}".format(itm.path())) self.toggledSpellcheck.connect(edt.toggleSpellcheck, AUC) self.dictChanged.connect(edt.setDict, AUC) # edt.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) self.txtEdits.append(edt) l.addWidget(edt)
def addText(itm): edt = textEditView(self, index=itm.index(), spellcheck=self.spellcheck, dict=settings.dict, highlighting=True, autoResize=True) edt.setFrameShape(QFrame.NoFrame) edt.setStyleSheet("background: {};".format(settings.textEditor["background"])) edt.setStatusTip("{} ({})".format(itm.path(), itm.type())) self.toggledSpellcheck.connect(edt.toggleSpellcheck, AUC) self.dictChanged.connect(edt.setDict, AUC) # edt.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) self.txtEdits.append(edt) l.addWidget(edt)
def setupUi(self, basicItemView): basicItemView.setObjectName("basicItemView") basicItemView.resize(400, 425) self.verticalLayout = QtWidgets.QVBoxLayout(basicItemView) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout_11 = QtWidgets.QHBoxLayout() self.horizontalLayout_11.setObjectName("horizontalLayout_11") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_11.addItem(spacerItem) self.lblPlanPOV = QtWidgets.QLabel(basicItemView) self.lblPlanPOV.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lblPlanPOV.setObjectName("lblPlanPOV") self.horizontalLayout_11.addWidget(self.lblPlanPOV) self.cmbPOV = cmbOutlineCharacterChoser(basicItemView) self.cmbPOV.setFrame(False) self.cmbPOV.setObjectName("cmbPOV") self.horizontalLayout_11.addWidget(self.cmbPOV) self.lblGoal = QtWidgets.QLabel(basicItemView) self.lblGoal.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lblGoal.setObjectName("lblGoal") self.horizontalLayout_11.addWidget(self.lblGoal) self.txtGoal = lineEditView(basicItemView) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.txtGoal.sizePolicy().hasHeightForWidth()) self.txtGoal.setSizePolicy(sizePolicy) self.txtGoal.setAutoFillBackground(False) self.txtGoal.setStyleSheet("border-radius: 6px;") self.txtGoal.setFrame(False) self.txtGoal.setObjectName("txtGoal") self.horizontalLayout_11.addWidget(self.txtGoal) self.verticalLayout.addLayout(self.horizontalLayout_11) self.txtSummarySentence = lineEditView(basicItemView) self.txtSummarySentence.setText("") self.txtSummarySentence.setObjectName("txtSummarySentence") self.verticalLayout.addWidget(self.txtSummarySentence) self.label_9 = QtWidgets.QLabel(basicItemView) self.label_9.setObjectName("label_9") self.verticalLayout.addWidget(self.label_9) self.txtSummaryFull = textEditView(basicItemView) self.txtSummaryFull.setObjectName("txtSummaryFull") self.verticalLayout.addWidget(self.txtSummaryFull) self.retranslateUi(basicItemView) QtCore.QMetaObject.connectSlotsByName(basicItemView)
def __init__(self, index, parent=None): QWidget.__init__(self, parent) self._background = None self._index = index self._theme = findThemePath(settings.fullScreenTheme) self._themeDatas = loadThemeDatas(self._theme) self.setMouseTracking(True) self._geometries = {} # Text editor self.editor = textEditView(self, index=index, spellcheck=settings.spellcheck, highlighting=True, dict=settings.dict) self.editor.setFrameStyle(QFrame.NoFrame) self.editor.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.editor.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.editor.installEventFilter(self) self.editor.setMouseTracking(True) self.editor.setVerticalScrollBar(myScrollBar()) self.scrollBar = self.editor.verticalScrollBar() self.scrollBar.setParent(self) # Top Panel self.topPanel = myPanel(parent=self) # self.topPanel.layout().addStretch(1) # Spell checking if enchant: self.btnSpellCheck = QPushButton(self) self.btnSpellCheck.setFlat(True) self.btnSpellCheck.setIcon(QIcon.fromTheme("tools-check-spelling")) self.btnSpellCheck.setCheckable(True) self.btnSpellCheck.setChecked(self.editor.spellcheck) self.btnSpellCheck.toggled.connect(self.editor.toggleSpellcheck) self.topPanel.layout().addWidget(self.btnSpellCheck) self.topPanel.layout().addStretch(1) # Formatting self.textFormat = textFormat(self) self.topPanel.layout().addWidget(self.textFormat) self.topPanel.layout().addStretch(1) self.btnClose = QPushButton(self) self.btnClose.setIcon(qApp.style().standardIcon(QStyle.SP_DialogCloseButton)) self.btnClose.clicked.connect(self.close) self.btnClose.setFlat(True) self.topPanel.layout().addWidget(self.btnClose) # Left Panel self._locked = False self.leftPanel = myPanel(vertical=True, parent=self) self.locker = locker(self) self.locker.lockChanged.connect(self.setLocked) self.leftPanel.layout().addWidget(self.locker) # Bottom Panel self.bottomPanel = myPanel(parent=self) self.bottomPanel.layout().addSpacing(24) self.lstThemes = QComboBox(self) self.lstThemes.setAttribute(Qt.WA_TranslucentBackground) paths = allPaths("resources/themes") for p in paths: lst = [i for i in os.listdir(p) if os.path.splitext(i)[1] == ".theme"] for t in lst: themeIni = os.path.join(p, t) name = loadThemeDatas(themeIni)["Name"] # self.lstThemes.addItem(os.path.splitext(t)[0]) self.lstThemes.addItem(name) self.lstThemes.setItemData(self.lstThemes.count()-1, os.path.splitext(t)[0]) self.lstThemes.setCurrentIndex(self.lstThemes.findData(settings.fullScreenTheme)) # self.lstThemes.setCurrentText(settings.fullScreenTheme) self.lstThemes.currentTextChanged.connect(self.setTheme) self.lstThemes.setMaximumSize(QSize(300, QFontMetrics(qApp.font()).height())) self.bottomPanel.layout().addWidget(QLabel(self.tr("Theme:"), self)) self.bottomPanel.layout().addWidget(self.lstThemes) self.bottomPanel.layout().addStretch(1) self.lblProgress = QLabel(self) self.lblProgress.setMaximumSize(QSize(200, 14)) self.lblProgress.setMinimumSize(QSize(100, 14)) self.lblWC = QLabel(self) self.bottomPanel.layout().addWidget(self.lblWC) self.bottomPanel.layout().addWidget(self.lblProgress) self.updateStatusBar() self.bottomPanel.layout().addSpacing(24) # Connection self._index.model().dataChanged.connect(self.dataChanged) # self.updateTheme() self.showFullScreen()
def setupUi(self, metadataView): metadataView.setObjectName("metadataView") metadataView.resize(400, 537) self.verticalLayout = QtWidgets.QVBoxLayout(metadataView) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.grpProperties = collapsibleGroupBox2(metadataView) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.grpProperties.sizePolicy().hasHeightForWidth()) self.grpProperties.setSizePolicy(sizePolicy) self.grpProperties.setFlat(True) self.grpProperties.setCheckable(True) self.grpProperties.setObjectName("grpProperties") self.verticalLayout_28 = QtWidgets.QVBoxLayout(self.grpProperties) self.verticalLayout_28.setSpacing(0) self.verticalLayout_28.setContentsMargins(0, 0, 0, 0) self.verticalLayout_28.setObjectName("verticalLayout_28") self.properties = propertiesView(self.grpProperties) self.properties.setMinimumSize(QtCore.QSize(0, 50)) self.properties.setObjectName("properties") self.verticalLayout_28.addWidget(self.properties) self.verticalLayout.addWidget(self.grpProperties) self.grpSummary = collapsibleGroupBox2(metadataView) self.grpSummary.setFlat(True) self.grpSummary.setCheckable(True) self.grpSummary.setObjectName("grpSummary") self.verticalLayout_22 = QtWidgets.QVBoxLayout(self.grpSummary) self.verticalLayout_22.setSpacing(0) self.verticalLayout_22.setContentsMargins(0, 0, 0, 0) self.verticalLayout_22.setObjectName("verticalLayout_22") self.txtSummarySentance = lineEditView(self.grpSummary) self.txtSummarySentance.setInputMask("") self.txtSummarySentance.setFrame(False) self.txtSummarySentance.setObjectName("txtSummarySentance") self.verticalLayout_22.addWidget(self.txtSummarySentance) self.line = QtWidgets.QFrame(self.grpSummary) self.line.setFrameShadow(QtWidgets.QFrame.Plain) self.line.setLineWidth(0) self.line.setMidLineWidth(0) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_22.addWidget(self.line) self.txtSummaryFull = textEditView(self.grpSummary) self.txtSummaryFull.setFrameShape(QtWidgets.QFrame.NoFrame) self.txtSummaryFull.setObjectName("txtSummaryFull") self.verticalLayout_22.addWidget(self.txtSummaryFull) self.verticalLayout.addWidget(self.grpSummary) self.grpNotes = collapsibleGroupBox2(metadataView) self.grpNotes.setFlat(True) self.grpNotes.setCheckable(True) self.grpNotes.setObjectName("grpNotes") self.horizontalLayout_29 = QtWidgets.QHBoxLayout(self.grpNotes) self.horizontalLayout_29.setSpacing(0) self.horizontalLayout_29.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_29.setObjectName("horizontalLayout_29") self.txtNotes = textEditCompleter(self.grpNotes) self.txtNotes.setObjectName("txtNotes") self.horizontalLayout_29.addWidget(self.txtNotes) self.verticalLayout.addWidget(self.grpNotes) self.grpRevisions = collapsibleGroupBox2(metadataView) self.grpRevisions.setFlat(True) self.grpRevisions.setCheckable(True) self.grpRevisions.setObjectName("grpRevisions") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.grpRevisions) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.revisions = revisions(self.grpRevisions) self.revisions.setMinimumSize(QtCore.QSize(0, 50)) self.revisions.setObjectName("revisions") self.verticalLayout_2.addWidget(self.revisions) self.verticalLayout.addWidget(self.grpRevisions) self.retranslateUi(metadataView) QtCore.QMetaObject.connectSlotsByName(metadataView)
def addTitle(itm): edt = textEditView(self, html="<h{l}>{t}</h{l}>".format(l=min(itm.level() + 1, 5), t=itm.title()), autoResize=True) edt.setFrameShape(QFrame.NoFrame) self.txtEdits.append(edt) l.addWidget(edt)
def __init__(self, index, parent=None): QWidget.__init__(self, parent) self._background = None self._index = index self._theme = findThemePath(settings.fullScreenTheme) self._themeDatas = loadThemeDatas(self._theme) self.setMouseTracking(True) self._geometries = {} # Text editor self.editor = textEditView(self, index=index, spellcheck=settings.spellcheck, highlighting=True, dict=settings.dict) self.editor.setFrameStyle(QFrame.NoFrame) self.editor.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.editor.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.editor.installEventFilter(self) self.editor.setMouseTracking(True) self.editor.setVerticalScrollBar(myScrollBar()) self.scrollBar = self.editor.verticalScrollBar() self.scrollBar.setParent(self) # Top Panel self.topPanel = myPanel(parent=self) # self.topPanel.layout().addStretch(1) # Spell checking if enchant: self.btnSpellCheck = QPushButton(self) self.btnSpellCheck.setFlat(True) self.btnSpellCheck.setIcon(QIcon.fromTheme("tools-check-spelling")) self.btnSpellCheck.setCheckable(True) self.btnSpellCheck.setChecked(self.editor.spellcheck) self.btnSpellCheck.toggled.connect(self.editor.toggleSpellcheck) self.topPanel.layout().addWidget(self.btnSpellCheck) self.topPanel.layout().addStretch(1) # Formatting self.textFormat = textFormat(self) self.topPanel.layout().addWidget(self.textFormat) self.topPanel.layout().addStretch(1) self.btnClose = QPushButton(self) self.btnClose.setIcon(qApp.style().standardIcon(QStyle.SP_DialogCloseButton)) self.btnClose.clicked.connect(self.close) self.btnClose.setFlat(True) self.topPanel.layout().addWidget(self.btnClose) # Left Panel self._locked = False self.leftPanel = myPanel(vertical=True, parent=self) self.locker = locker(self) self.locker.lockChanged.connect(self.setLocked) self.leftPanel.layout().addWidget(self.locker) # Bottom Panel self.bottomPanel = myPanel(parent=self) self.bottomPanel.layout().addSpacing(24) self.lstThemes = QComboBox(self) self.lstThemes.setAttribute(Qt.WA_TranslucentBackground) paths = allPaths("resources/themes") for p in paths: lst = [i for i in os.listdir(p) if os.path.splitext(i)[1] == ".theme"] for t in lst: themeIni = os.path.join(p, t) self.lstThemes.addItem(os.path.splitext(t)[0]) self.lstThemes.setCurrentText(settings.fullScreenTheme) self.lstThemes.currentTextChanged.connect(self.setTheme) self.lstThemes.setMaximumSize(QSize(300, QFontMetrics(qApp.font()).height())) self.bottomPanel.layout().addWidget(QLabel(self.tr("Theme:"), self)) self.bottomPanel.layout().addWidget(self.lstThemes) self.bottomPanel.layout().addStretch(1) self.lblProgress = QLabel(self) self.lblProgress.setMaximumSize(QSize(200, 14)) self.lblProgress.setMinimumSize(QSize(100, 14)) self.lblWC = QLabel(self) self.bottomPanel.layout().addWidget(self.lblWC) self.bottomPanel.layout().addWidget(self.lblProgress) self.updateStatusBar() self.bottomPanel.layout().addSpacing(24) # Connection self._index.model().dataChanged.connect(self.dataChanged) # self.updateTheme() self.showFullScreen()
def setupUi(self, metadataView): metadataView.setObjectName("metadataView") metadataView.resize(400, 537) self.verticalLayout = QtWidgets.QVBoxLayout(metadataView) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.grpProperties = collapsibleGroupBox2(metadataView) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.grpProperties.sizePolicy().hasHeightForWidth()) self.grpProperties.setSizePolicy(sizePolicy) self.grpProperties.setFlat(True) self.grpProperties.setCheckable(True) self.grpProperties.setObjectName("grpProperties") self.verticalLayout_28 = QtWidgets.QVBoxLayout(self.grpProperties) self.verticalLayout_28.setSpacing(0) self.verticalLayout_28.setContentsMargins(0, 0, 0, 0) self.verticalLayout_28.setObjectName("verticalLayout_28") self.properties = propertiesView(self.grpProperties) self.properties.setMinimumSize(QtCore.QSize(0, 50)) self.properties.setObjectName("properties") self.verticalLayout_28.addWidget(self.properties) self.verticalLayout.addWidget(self.grpProperties) self.grpSummary = collapsibleGroupBox2(metadataView) self.grpSummary.setFlat(True) self.grpSummary.setCheckable(True) self.grpSummary.setObjectName("grpSummary") self.verticalLayout_22 = QtWidgets.QVBoxLayout(self.grpSummary) self.verticalLayout_22.setSpacing(0) self.verticalLayout_22.setContentsMargins(0, 0, 0, 0) self.verticalLayout_22.setObjectName("verticalLayout_22") self.txtSummarySentence = lineEditView(self.grpSummary) self.txtSummarySentence.setInputMask("") self.txtSummarySentence.setFrame(False) self.txtSummarySentence.setObjectName("txtSummarySentence") self.verticalLayout_22.addWidget(self.txtSummarySentence) self.line = QtWidgets.QFrame(self.grpSummary) self.line.setFrameShadow(QtWidgets.QFrame.Plain) self.line.setLineWidth(0) self.line.setMidLineWidth(0) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_22.addWidget(self.line) self.txtSummaryFull = textEditView(self.grpSummary) self.txtSummaryFull.setFrameShape(QtWidgets.QFrame.NoFrame) self.txtSummaryFull.setObjectName("txtSummaryFull") self.verticalLayout_22.addWidget(self.txtSummaryFull) self.verticalLayout.addWidget(self.grpSummary) self.grpNotes = collapsibleGroupBox2(metadataView) self.grpNotes.setFlat(True) self.grpNotes.setCheckable(True) self.grpNotes.setObjectName("grpNotes") self.horizontalLayout_29 = QtWidgets.QHBoxLayout(self.grpNotes) self.horizontalLayout_29.setSpacing(0) self.horizontalLayout_29.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_29.setObjectName("horizontalLayout_29") self.txtNotes = textEditCompleter(self.grpNotes) self.txtNotes.setFrameShape(QtWidgets.QFrame.NoFrame) self.txtNotes.setObjectName("txtNotes") self.horizontalLayout_29.addWidget(self.txtNotes) self.verticalLayout.addWidget(self.grpNotes) self.grpRevisions = collapsibleGroupBox2(metadataView) self.grpRevisions.setFlat(True) self.grpRevisions.setCheckable(True) self.grpRevisions.setObjectName("grpRevisions") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.grpRevisions) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.revisions = revisions(self.grpRevisions) self.revisions.setMinimumSize(QtCore.QSize(0, 50)) self.revisions.setObjectName("revisions") self.verticalLayout_2.addWidget(self.revisions) self.verticalLayout.addWidget(self.grpRevisions) self.retranslateUi(metadataView) QtCore.QMetaObject.connectSlotsByName(metadataView)