implemented font and fontsize in toolbar of songeditor
This commit is contained in:
parent
bc6f6b0606
commit
eaa32c8b2b
4 changed files with 39 additions and 4 deletions
7
TODO.org
7
TODO.org
|
@ -8,9 +8,12 @@
|
||||||
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Controls.ToolBar {]]
|
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Controls.ToolBar {]]
|
||||||
|
|
||||||
- [X] alignment
|
- [X] alignment
|
||||||
- [X] font
|
- [X] font - Need to finish the UI portion of it
|
||||||
- [X] fontsize
|
- [X] fontsize - Need to finish the UI portion of it
|
||||||
- [ ] effects?
|
- [ ] effects?
|
||||||
|
For effects, I'm not 100% sure how to do this in an easy to build out way. Should I just do them the same as the other attributes or have effects be individually stored? Which effects to use?
|
||||||
|
|
||||||
|
I'm thinking shadows for sure for readability on slides. Also, maybe I should have an effect of like glow? But maybe I'll come back to this after more of the core system is finished.
|
||||||
|
|
||||||
** TODO bug in changing slides with the arrows
|
** TODO bug in changing slides with the arrows
|
||||||
[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::function changeSlide() {]]
|
[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::function changeSlide() {]]
|
||||||
|
|
|
@ -15,16 +15,19 @@ Item {
|
||||||
property string videoBackground
|
property string videoBackground
|
||||||
property var hTextAlignment
|
property var hTextAlignment
|
||||||
property var vTextAlignment
|
property var vTextAlignment
|
||||||
|
property string font
|
||||||
|
property real fontSize
|
||||||
|
|
||||||
Presenter.Slide {
|
Presenter.Slide {
|
||||||
id: representation
|
id: representation
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
textSize: width / 15
|
|
||||||
editMode: true
|
editMode: true
|
||||||
imageSource: imageBackground
|
imageSource: imageBackground
|
||||||
videoSource: videoBackground
|
videoSource: videoBackground
|
||||||
hTextAlignment: root.hTextAlignment
|
hTextAlignment: root.hTextAlignment
|
||||||
vTextAlignment: root.vTextAlignment
|
vTextAlignment: root.vTextAlignment
|
||||||
|
chosenFont: font
|
||||||
|
textSize: fontSize
|
||||||
preview: true
|
preview: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ Item {
|
||||||
editable: true
|
editable: true
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
flat: true
|
flat: true
|
||||||
onCurrentTextChanged: showPassiveNotification(currentText)
|
onActivated: updateFont(currentText)
|
||||||
}
|
}
|
||||||
Controls.SpinBox {
|
Controls.SpinBox {
|
||||||
id: fontSizeBox
|
id: fontSizeBox
|
||||||
|
@ -41,6 +41,7 @@ Item {
|
||||||
from: 5
|
from: 5
|
||||||
to: 72
|
to: 72
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
onValueModified: updateFontSize(value)
|
||||||
}
|
}
|
||||||
Controls.ComboBox {
|
Controls.ComboBox {
|
||||||
id: hAlignmentBox
|
id: hAlignmentBox
|
||||||
|
@ -290,6 +291,8 @@ Item {
|
||||||
|
|
||||||
changeSlideHAlignment(song.horizontalTextAlignment);
|
changeSlideHAlignment(song.horizontalTextAlignment);
|
||||||
changeSlideVAlignment(song.verticalTextAlignment);
|
changeSlideVAlignment(song.verticalTextAlignment);
|
||||||
|
changeSlideFont(song.font, true);
|
||||||
|
changeSlideFontSize(song.fontSize, true)
|
||||||
|
|
||||||
print(song);
|
print(song);
|
||||||
}
|
}
|
||||||
|
@ -336,6 +339,16 @@ Item {
|
||||||
songsqlmodel.updateVerticalTextAlignment(songIndex, textAlignment)
|
songsqlmodel.updateVerticalTextAlignment(songIndex, textAlignment)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateFont(font) {
|
||||||
|
changeSlideFont(font, false);
|
||||||
|
songsqlmodel.updateFont(songIndex, font);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateFontSize(fontSize) {
|
||||||
|
changeSlideFontSize(fontSize, false);
|
||||||
|
songsqlmodel.updateFontSize(songIndex, fontSize);
|
||||||
|
}
|
||||||
|
|
||||||
function changeSlideHAlignment(alignment) {
|
function changeSlideHAlignment(alignment) {
|
||||||
switch (alignment) {
|
switch (alignment) {
|
||||||
case "left" :
|
case "left" :
|
||||||
|
@ -373,4 +386,18 @@ Item {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeSlideFont(font, updateBox) {
|
||||||
|
const fontIndex = fontBox.find(font);
|
||||||
|
print(fontIndex);
|
||||||
|
if (updateBox)
|
||||||
|
fontBox.currentIndex = fontIndex;
|
||||||
|
slideEditor.font = font;
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeSlideFontSize(fontSize, updateBox) {
|
||||||
|
if (updateBox)
|
||||||
|
fontSizeBox.value = fontSize;
|
||||||
|
slideEditor.fontSize = fontSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,8 @@ QHash<int, QByteArray> SongSqlModel::roleNames() const
|
||||||
names[Qt::UserRole + 8] = "backgroundType";
|
names[Qt::UserRole + 8] = "backgroundType";
|
||||||
names[Qt::UserRole + 9] = "horizontalTextAlignment";
|
names[Qt::UserRole + 9] = "horizontalTextAlignment";
|
||||||
names[Qt::UserRole + 10] = "verticalTextAlignment";
|
names[Qt::UserRole + 10] = "verticalTextAlignment";
|
||||||
|
names[Qt::UserRole + 11] = "font";
|
||||||
|
names[Qt::UserRole + 12] = "fontSize";
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue