Browse Source

add MDI

master 0.5.0
Ivan Holmes 3 years ago
parent
commit
ce3ed11f12
  1. 136
      gui.py
  2. BIN
      preview.pdf
  3. 3
      requirements.txt
  4. 84
      ui/blocks.ui
  5. 93
      ui/chords.ui
  6. 22
      ui/docinfo.ui
  7. 2
      ui/document.ui
  8. 63
      ui/new.ui
  9. 13
      ui/preview.ui
  10. 293
      ui/psetup.ui
  11. 52
      ui/sections.ui

136
gui.py

@ -14,9 +14,9 @@ import os
import time
from copy import copy
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut, QMdiSubWindow
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QFontComboBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut, QMdiSubWindow
from PyQt5.QtCore import QFile, QObject, Qt, pyqtSlot, QSettings
from PyQt5.QtGui import QPixmap, QImage, QKeySequence
from PyQt5.QtGui import QPixmap, QImage, QKeySequence, QFontInfo, QFont, QRawFont
from PyQt5 import uic
from chordsheet.tableView import ChordTableView, BlockTableView
from chordsheet.comboBox import MComboBox
@ -77,6 +77,9 @@ class MainWindow(QMainWindow):
self.setMenuBar(self.window.menuBar)
self.setWindowTitle("Chordsheet")
self.lastSubWindow = None
self.currentSection = None
if filename:
try:
self.openFile(filename)
@ -114,6 +117,14 @@ class MainWindow(QMainWindow):
self.addDockWidget(Qt.RightDockWidgetArea, self.sectionsw)
self.addDockWidget(Qt.RightDockWidgetArea, self.blocksw)
# Check all the boxes in the window menu
self.window.actionDocument_information.setChecked(True)
self.window.actionPage_setup.setChecked(True)
self.window.actionChords.setChecked(True)
self.window.actionSections.setChecked(True)
self.window.actionBlocks.setChecked(True)
self.window.actionPreview.setChecked(True)
# link all the UI elements
self.window.mdiArea.subWindowActivated.connect(self.switchDocument)
@ -145,6 +156,14 @@ class MainWindow(QMainWindow):
self.window.actionCopy.setShortcut(QKeySequence.Copy)
self.window.actionPaste.setShortcut(QKeySequence.Paste)
self.window.actionDocument_information.triggered.connect(self.menuWindowDocInfoAction)
self.window.actionPage_setup.triggered.connect(self.menuWindowPageSetupAction)
self.window.actionChords.triggered.connect(self.menuWindowChordsAction)
self.window.actionSections.triggered.connect(self.menuWindowSectionsAction)
self.window.actionBlocks.triggered.connect(self.menuWindowBlocksAction)
self.window.actionPreview.triggered.connect(self.menuWindowPreviewAction)
self.psetup.widget().pageSizeComboBox.currentIndexChanged.connect(
self.pageSizeAction)
self.psetup.widget().documentUnitsComboBox.currentIndexChanged.connect(
@ -158,6 +177,7 @@ class MainWindow(QMainWindow):
self.psetup.widget().documentUnitsComboBox.setCurrentText(
list(unitDict.keys())[0])
self.psetup.widget().fontComboBox.currentFontChanged.connect(self.fontChangeAction)
self.psetup.widget().includedFontCheckBox.stateChanged.connect(
self.includedFontAction)
@ -210,13 +230,17 @@ class MainWindow(QMainWindow):
self.chordsw.widget().chordTableView.populate(doc.chordList)
self.sectionsw.widget().sectionTableView.populate(doc.sectionList)
self.updateChordDict(doc)
self.updateSectionDict(doc)
# populate the block table with the first section, account for a document with no sections
self.currentSection = doc.sectionList[0] if len(
doc.sectionList) else None
if self.currentSection is None:
self.currentSection = doc.sectionList[0] if doc.sectionList else None
else:
self.blocksw.widget().blockSectionComboBox.setCurrentText(
self.currentSection.name)
self.blocksw.widget().blockTableView.populate(
self.currentSection.blockList if self.currentSection else [])
self.updateChordDict(doc)
self.updateSectionDict(doc)
def UIInitStyle(self, style):
"""
@ -235,8 +259,7 @@ class MainWindow(QMainWindow):
self.psetup.widget().topMarginLineEdit.setText(str(style.topMargin))
self.psetup.widget().bottomMarginLineEdit.setText(str(style.bottomMargin))
self.psetup.widget().fontComboBox.setDisabled(True)
# self.psetup.widget().fontComboBox.setDisabled(True)
self.psetup.widget().includedFontCheckBox.setChecked(True)
self.psetup.widget().beatWidthLineEdit.setText(str(style.unitWidth))
@ -259,10 +282,27 @@ class MainWindow(QMainWindow):
self.blocksw.widget().blockSectionComboBox.addItems(
list(self.sectionDict.keys()))
def switchDocument(self):
def fontChangeAction(self):
if self.window.mdiArea.currentSubWindow() is not None:
self.UIInitDocument(self.window.mdiArea.currentSubWindow().doc)
self.UIInitStyle(self.window.mdiArea.currentSubWindow().style)
qFont = self.psetup.widget().fontComboBox.currentFont()
qFontReal = QRawFont.fromFont(qFont)
#fontInfo = QFontInfo(qFont)
#qFontReal = QRawFont(fontInfo.family())
print(qFont.rawName())
def switchDocument(self, curWindow):
if curWindow is not None:
if self.lastSubWindow is not None:
self.lastSubWindow.currentSection = self.currentSection
self.UIInitDocument(curWindow.doc)
self.UIInitStyle(curWindow.style)
self.currentSection = curWindow.currentSection
if self.currentSection is not None:
self.blocksw.widget().blockSectionComboBox.setCurrentText(
self.currentSection.name)
self.lastSubWindow = curWindow
def generateAction(self):
if self.window.mdiArea.currentSubWindow() is not None:
@ -287,7 +327,7 @@ class MainWindow(QMainWindow):
b.chord = None
self.blocksw.widget().blockTableView.populate(self.currentSection.blockList)
self.clearChordLineEdits()
self.window.mdiArea.currentSubWindow().updateChordDict()
self.updateChordDict(self.window.mdiArea.currentSubWindow().doc)
def addChordAction(self):
success = False # initialise
@ -319,7 +359,7 @@ class MainWindow(QMainWindow):
if success == True: # if chord was parsed properly
self.chordsw.widget().chordTableView.populate(self.window.mdiArea.currentSubWindow().doc.chordList)
self.clearChordLineEdits()
self.window.mdiArea.currentSubWindow().updateChordDict()
self.updateChordDict(self.window.mdiArea.currentSubWindow().doc)
def updateChordAction(self):
success = False # see comments above
@ -351,7 +391,7 @@ class MainWindow(QMainWindow):
ChordNameWarningMessageBox().exec()
if success == True:
self.window.mdiArea.currentSubWindow().updateChordDict()
self.updateChordDict(self.window.mdiArea.currentSubWindow().doc)
self.chordsw.widget().chordTableView.populate(self.window.mdiArea.currentSubWindow().doc.chordList)
# update the names of chords in all blocklists in case they've already been used
for s in self.window.mdiArea.currentSubWindow().doc.sectionList:
@ -372,7 +412,7 @@ class MainWindow(QMainWindow):
self.sectionsw.widget().sectionTableView.populate(self.window.mdiArea.currentSubWindow().doc.sectionList)
self.clearSectionLineEdits()
self.window.mdiArea.currentSubWindow().updateSectionDict()
self.updateSectionDict(self.window.mdiArea.currentSubWindow().doc)
def addSectionAction(self):
self.window.mdiArea.currentSubWindow().updateSections()
@ -382,7 +422,7 @@ class MainWindow(QMainWindow):
self.window.mdiArea.currentSubWindow().doc.sectionList.append(Section(name=sName))
self.sectionsw.widget().sectionTableView.populate(self.window.mdiArea.currentSubWindow().doc.sectionList)
self.clearSectionLineEdits()
self.window.mdiArea.currentSubWindow().updateSectionDict()
self.updateSectionDict(self.window.mdiArea.currentSubWindow().doc)
else:
# Section has no name or non unique, warn user
SectionNameWarningMessageBox().exec()
@ -397,7 +437,7 @@ class MainWindow(QMainWindow):
self.window.mdiArea.currentSubWindow().doc.sectionList[row].name = sName
self.sectionsw.widget().sectionTableView.populate(self.window.mdiArea.currentSubWindow().doc.sectionList)
self.clearSectionLineEdits()
self.window.mdiArea.currentSubWindow().updateSectionDict()
self.updateSectionDict(self.window.mdiArea.currentSubWindow().doc)
else:
# Section has no name or non unique, warn user
SectionNameWarningMessageBox().exec()
@ -495,10 +535,11 @@ class MainWindow(QMainWindow):
if sName:
if self.window.mdiArea.currentSubWindow() is not None:
self.currentSection = self.sectionDict.get(sName, None)
# self.window.mdiArea.currentSubWindow().currentSection = self.currentSection
if self.currentSection is not None:
self.blocksw.widget().blockTableView.populate(self.currentSection.blockList)
else:
self.currentSection = None
pass # self.currentSection = None
def blockClickedAction(self, index):
# set the controls to the values from the selected block
@ -537,7 +578,7 @@ class MainWindow(QMainWindow):
self.window.mdiArea.addSubWindow(dw)
self.UIInitDocument(dw.doc)
self.UIInitStyle(dw.style)
self.currentSection = None
# self.currentSection = None
dw.show()
@ -618,6 +659,54 @@ class MainWindow(QMainWindow):
except Exception:
pass
# self.docinfo = DocInfoDockWidget()
# self.psetup = PageSetupDockWidget()
# self.chordsw = ChordsDockWidget()
# self.sectionsw = SectionsDockWidget()
# self.blocksw = BlocksDockWidget()
# self.previeww = PreviewDockWidget()
def menuWindowDocInfoAction(self):
if self.window.actionDocument_information.isChecked():
self.docinfo.show()
else:
self.docinfo.hide()
def menuWindowPageSetupAction(self):
if self.window.actionPage_setup.isChecked():
self.psetup.show()
else:
self.psetup.hide()
def menuWindowChordsAction(self):
if self.window.actionChords.isChecked():
self.chordsw.show()
else:
self.chordsw.hide()
def menuWindowSectionsAction(self):
if self.window.actionSections.isChecked():
self.sectionsw.show()
else:
self.sectionsw.hide()
def menuWindowBlocksAction(self):
if self.window.actionBlocks.isChecked():
self.blocksw.show()
else:
self.blocksw.hide()
def menuWindowPreviewAction(self):
if self.window.actionPreview.isChecked():
self.previeww.show()
else:
self.previeww.hide()
def guitarVoicingAction(self):
gdialog = GuitarDialog()
@ -666,9 +755,10 @@ class DocumentWindow(QMdiSubWindow):
self.lastDoc = copy(self.doc)
self.currentFilePath = filename
self.currentSection = None
mw.updateChordDict(self.doc)
mw.updateSectionDict(self.doc)
self.currentSection = None
def UIFileLoader(self, ui_file):
ui_file = QFile(ui_file)
@ -696,13 +786,17 @@ class DocumentWindow(QMdiSubWindow):
else: # if fileExt in [".xml", ".cml"]:
self.doc.loadXML(self.currentFilePath)
self.updatePreview()
self.lastDoc = copy(self.doc)
mw.setPath("workingPath", self.currentFilePath)
mw.updateChordDict(self.doc)
mw.updateSectionDict(self.doc)
self.currentSection = (self.doc.sectionList[0] if self.doc.sectionList else None)
self.updateTitleBar()
self.updatePreview()
def saveFile(self, filePath):
"""

BIN
preview.pdf

3
requirements.txt

@ -0,0 +1,3 @@
reportlab>=3.5.67
PyMuPDF>=1.18.13
PyQt5>=5.15.4

84
ui/blocks.ui

@ -6,21 +6,46 @@
<rect>
<x>0</x>
<y>0</y>
<width>437</width>
<height>371</height>
<width>387</width>
<height>206</height>
</rect>
</property>
<property name="windowTitle">
<string>Blocks</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="blockTabLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="blockSectionLabel">
<property name="text">
@ -79,6 +104,21 @@
</item>
<item>
<layout class="QGridLayout" name="blockGridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="blockLengthLabel">
<property name="text">
@ -155,6 +195,21 @@
</item>
<item>
<layout class="QHBoxLayout" name="bottomBlockHorizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="removeBlockButton">
<property name="text">
@ -187,16 +242,29 @@
</item>
<item>
<widget class="QPushButton" name="addBlockButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Add block</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
@ -211,8 +279,6 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>blockSectionComboBox</tabstop>
<tabstop>blockTableView</tabstop>
<tabstop>blockLengthLineEdit</tabstop>
<tabstop>blockChordComboBox</tabstop>
<tabstop>blockNotesLineEdit</tabstop>

93
ui/chords.ui

@ -6,16 +6,29 @@
<rect>
<x>0</x>
<y>0</y>
<width>443</width>
<height>359</height>
<width>393</width>
<height>236</height>
</rect>
</property>
<property name="windowTitle">
<string>Chords</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="chordTabLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="ChordTableView" name="chordTableView">
<property name="sizePolicy">
@ -56,15 +69,28 @@
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<layout class="QGridLayout" name="chordGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="chordNameLabel">
<property name="text">
<string>Chord name</string>
<property name="spacing">
<number>6</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="guitarVoicingLineEdit">
<property name="sizePolicy">
@ -82,6 +108,9 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="pianoVoicingLineEdit"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="chordNameLineEdit">
<property name="sizePolicy">
@ -98,6 +127,20 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="pianoVoicingLabel">
<property name="text">
<string>Piano voicing</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="chordNameLabel">
<property name="text">
<string>Chord name</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="guitarVoicingButton">
<property name="maximumSize">
@ -111,20 +154,27 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="pianoVoicingLineEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="pianoVoicingLabel">
<property name="text">
<string>Piano voicing</string>
</property>
</widget>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="bottomChordHorizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="removeChordButton">
<property name="text">
@ -165,8 +215,6 @@
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
@ -176,7 +224,6 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>chordTableView</tabstop>
<tabstop>chordNameLineEdit</tabstop>
<tabstop>guitarVoicingLineEdit</tabstop>
<tabstop>guitarVoicingButton</tabstop>

22
ui/docinfo.ui

@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>202</height>
<width>291</width>
<height>170</height>
</rect>
</property>
<property name="sizePolicy">
@ -23,11 +23,29 @@
<string>Document information</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<layout class="QFormLayout" name="formLayoutOverview">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="titleLabel">
<property name="text">

2
ui/document.ui

@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
<string>Unsaved</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">

63
ui/new.ui

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1061</width>
<height>659</height>
<height>639</height>
</rect>
</property>
<property name="windowTitle">
@ -88,8 +88,21 @@
<addaction name="separator"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuWindow">
<property name="title">
<string>Window</string>
</property>
<addaction name="actionDocument_information"/>
<addaction name="actionPage_setup"/>
<addaction name="actionChords"/>
<addaction name="actionSections"/>
<addaction name="actionBlocks"/>
<addaction name="separator"/>
<addaction name="actionPreview"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuEdit"/>
<addaction name="menuWindow"/>
</widget>
<action name="actionNew">
<property name="text">
@ -166,6 +179,54 @@
<string>About</string>
</property>
</action>
<action name="actionDocument_information">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Document information</string>
</property>
</action>
<action name="actionPage_setup">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Page setup</string>
</property>
</action>
<action name="actionChords">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Chords</string>
</property>
</action>
<action name="actionSections">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Sections</string>
</property>
</action>
<action name="actionBlocks">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Blocks</string>
</property>
</action>
<action name="actionPreview">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Preview</string>
</property>
</action>
</widget>
<resources/>
<connections/>

13
ui/preview.ui

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<width>248</width>
<height>40</height>
</rect>
</property>
@ -25,7 +25,10 @@
<property name="windowTitle">
<string>Preview</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
@ -40,6 +43,12 @@
</property>
<item>
<widget class="QPushButton" name="updatePreviewButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Update preview</string>
</property>

293
ui/psetup.ui

@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>500</height>
<width>257</width>
<height>271</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -20,44 +20,33 @@
<string>Page setup</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="pageGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="title">
<string>Page options</string>
<property name="bottomMargin">
<number>6</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="pageSizeLabel">
<property name="text">
<string>Page size</string>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0">
<property name="spacing">
<number>6</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="pageSizeComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="documentUnitsLabel">
<property name="text">
<string>Document units</string>
<item row="11" column="0">
<widget class="QLabel" name="lineSpacingLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="documentUnitsComboBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="leftMarginLabel">
<property name="text">
<string>Left margin</string>
<string>Line spacing</string>
</property>
</widget>
</item>
@ -71,10 +60,26 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="topMarginLabel">
<item row="10" column="0">
<widget class="QLabel" name="fontLabel">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Top margin</string>
<string>Font</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="bottomMarginLineEdit">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
@ -88,10 +93,19 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="rightMarginLabel">
<property name="text">
<string>Right margin</string>
<item row="11" column="1">
<widget class="QDoubleSpinBox" name="lineSpacingDoubleSpinBox">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
@ -105,15 +119,43 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="bottomMarginLabel">
<item row="0" column="1">
<widget class="QComboBox" name="pageSizeComboBox">
<property name="maximumSize">
<size>
<width>70</width>
<height>26</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="topMarginLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777194</height>
</size>
</property>
<property name="text">
<string>Bottom margin</string>
<string>Top margin</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="bottomMarginLineEdit">
<item row="12" column="1">
<widget class="QLineEdit" name="beatWidthLineEdit">
<property name="maximumSize">
<size>
<width>60</width>
@ -122,129 +164,113 @@
</property>
</widget>
</item>
</layout>
</item>
</layout>
<item row="0" column="0">
<widget class="QLabel" name="pageSizeLabel">
<property name="text">
<string>Page size</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="fontGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Font options</string>
<item row="1" column="0">
<widget class="QLabel" name="documentUnitsLabel">
<property name="text">
<string>Units</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="fontLabel">
<property name="maximumSize">
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="bottomMarginLabel">
<property name="minimumSize">
<size>
<width>40</width>
<height>16777215</height>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font</string>
<string>Bottom margin</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fontComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="0">
<widget class="QLabel" name="leftMarginLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Left margin</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<item row="10" column="1">
<widget class="QCheckBox" name="includedFontCheckBox">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Use included FreeSans</string>
<string>Use FreeSans</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="textGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Text options</string>
<item row="12" column="0">
<widget class="QLabel" name="beatWidthLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="lineSpacingLabel">
<property name="text">
<string>Line spacing</string>
<string>Beat width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="lineSpacingDoubleSpinBox">
<item row="3" column="0">
<widget class="QLabel" name="rightMarginLabel">
<property name="minimumSize">
<size>
<width>70</width>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Right margin</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="documentUnitsComboBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
<height>26</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="blockOptions">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Block options</string>
<property name="editable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="beatWidthLabel">
<property name="text">
<string>Beat width</string>
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="beatWidthLineEdit">
<item row="6" column="0" colspan="2">
<widget class="QFontComboBox" name="fontComboBox">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
<width>16777215</width>
<height>26</height>
</size>
</property>
</widget>
@ -253,9 +279,6 @@
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>pageSizeComboBox</tabstop>
<tabstop>documentUnitsComboBox</tabstop>
@ -263,9 +286,9 @@
<tabstop>rightMarginLineEdit</tabstop>
<tabstop>topMarginLineEdit</tabstop>
<tabstop>bottomMarginLineEdit</tabstop>
<tabstop>lineSpacingDoubleSpinBox</tabstop>
<tabstop>fontComboBox</tabstop>
<tabstop>includedFontCheckBox</tabstop>
<tabstop>lineSpacingDoubleSpinBox</tabstop>
<tabstop>beatWidthLineEdit</tabstop>
</tabstops>
<resources/>

52
ui/sections.ui

@ -6,16 +6,29 @@
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<height>325</height>
<width>405</width>
<height>170</height>
</rect>
</property>
<property name="windowTitle">
<string>Sections</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="sectionTabLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="SectionTableView" name="sectionTableView">
<property name="sizePolicy">
@ -58,6 +71,21 @@
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="sectionNameLabel">
<property name="text">
@ -72,6 +100,18 @@
</item>
<item>
<layout class="QHBoxLayout" name="bottomSectionHorizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="removeSectionButton">
<property name="text">
@ -112,8 +152,6 @@
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>

Loading…
Cancel
Save