fix stuff....
This commit is contained in:
parent
b4ad828af4
commit
c9cc1e688b
29
main.go
29
main.go
@ -34,9 +34,8 @@ var (
|
|||||||
err error
|
err error
|
||||||
monitors []*glfw.Monitor
|
monitors []*glfw.Monitor
|
||||||
projMonitor *glfw.Monitor
|
projMonitor *glfw.Monitor
|
||||||
mw1, mw2 *imagick.MagickWand
|
mw1 *imagick.MagickWand
|
||||||
tex1 uint32
|
tex1 uint32
|
||||||
//drawSlide func()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -51,11 +50,6 @@ func main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*func init() {
|
|
||||||
// GLFW event handling must run on the main OS thread
|
|
||||||
//runtime.LockOSThread()
|
|
||||||
}*/
|
|
||||||
|
|
||||||
func run() error {
|
func run() error {
|
||||||
var mainQml qml.Object
|
var mainQml qml.Object
|
||||||
imagick.Initialize()
|
imagick.Initialize()
|
||||||
@ -91,8 +85,8 @@ func run() error {
|
|||||||
qml.RunMain(glInit)
|
qml.RunMain(glInit)
|
||||||
|
|
||||||
window.Wait()
|
window.Wait()
|
||||||
//win.Destroy()
|
|
||||||
mw2.Destroy()
|
mw1.Destroy()
|
||||||
imagick.Terminate()
|
imagick.Terminate()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -100,9 +94,9 @@ func run() error {
|
|||||||
func setupScene() {
|
func setupScene() {
|
||||||
|
|
||||||
gl.ClearColor(0.1, 0.5, 0.9, 0.0)
|
gl.ClearColor(0.1, 0.5, 0.9, 0.0)
|
||||||
mw2 = resizeImage(mw1, x, y, true, true)
|
mw1 = resizeImage(mw1, x, y, true, true)
|
||||||
|
|
||||||
tex1 = newTexture(*mw2)
|
tex1 = newTexture(*mw1)
|
||||||
|
|
||||||
gl.MatrixMode(gl.PROJECTION)
|
gl.MatrixMode(gl.PROJECTION)
|
||||||
gl.LoadIdentity()
|
gl.LoadIdentity()
|
||||||
@ -242,7 +236,6 @@ func setSignals() {
|
|||||||
window.On("closing", func() {
|
window.On("closing", func() {
|
||||||
fmt.Println(window.Bool("cls"))
|
fmt.Println(window.Bool("cls"))
|
||||||
win.Hide()
|
win.Hide()
|
||||||
//win.Destroy()
|
|
||||||
window.Set("cls", true)
|
window.Set("cls", true)
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -259,9 +252,7 @@ func setSignals() {
|
|||||||
cel = slides[textEdit.Int("cell")]
|
cel = slides[textEdit.Int("cell")]
|
||||||
if textEdit.Bool("txt") {
|
if textEdit.Bool("txt") {
|
||||||
cel.qmlcell.ObjectByName("cellText").Set("text", str)
|
cel.qmlcell.ObjectByName("cellText").Set("text", str)
|
||||||
//fmt.Println("haha.....:-P")
|
|
||||||
cel.text = str
|
cel.text = str
|
||||||
//fmt.Println("----->"+cel.text, str, textEdit.Int("cell"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -270,13 +261,12 @@ func setSignals() {
|
|||||||
|
|
||||||
func (cl *cell) setSignal() {
|
func (cl *cell) setSignal() {
|
||||||
cl.qmlcell.ObjectByName("cellMouse").On("doubleClicked", func() {
|
cl.qmlcell.ObjectByName("cellMouse").On("doubleClicked", func() {
|
||||||
cellText := cl.qmlcell.ObjectByName("cellText")
|
|
||||||
|
|
||||||
textEdit.Set("cell", cl.index)
|
textEdit.Set("cell", cl.index)
|
||||||
textEdit.Set("x", cellText.Int("x")+4)
|
textEdit.Set("x", cl.qmlcell.Int("x")+4)
|
||||||
textEdit.Set("y", cellText.Int("y")+4)
|
textEdit.Set("y", cl.qmlcell.Int("y")+4)
|
||||||
textEdit.Set("width", cellText.Int("width"))
|
textEdit.Set("width", cl.qmlcell.Int("width"))
|
||||||
textEdit.Set("height", cellText.Int("height"))
|
textEdit.Set("height", cl.qmlcell.Int("height"))
|
||||||
textEdit.Set("opacity", 100)
|
textEdit.Set("opacity", 100)
|
||||||
textEdit.Set("visible", true)
|
textEdit.Set("visible", true)
|
||||||
textEdit.ObjectByName("textEdit1").Set("focus", true)
|
textEdit.ObjectByName("textEdit1").Set("focus", true)
|
||||||
@ -299,7 +289,6 @@ func (sl *slide) addCell( /*cl *cell*/ ) {
|
|||||||
cl.text = "testing 1... 2... 3..."
|
cl.text = "testing 1... 2... 3..."
|
||||||
cl.qmlcell.ObjectByName("cellText").Set("text", cl.text)
|
cl.qmlcell.ObjectByName("cellText").Set("text", cl.text)
|
||||||
*sl = append(*sl, &cl)
|
*sl = append(*sl, &cl)
|
||||||
//fmt.Println("add Cell!!!!! :-P")
|
|
||||||
cl.setSignal()
|
cl.setSignal()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
17
main.qml
17
main.qml
@ -15,10 +15,12 @@ ApplicationWindow {
|
|||||||
property bool cls: false
|
property bool cls: false
|
||||||
|
|
||||||
onClosing: if (!cls) {
|
onClosing: if (!cls) {
|
||||||
close.accepted = false
|
// close.accepted = false
|
||||||
}
|
}
|
||||||
|
|
||||||
AboutDialog { id: aboutDialog }
|
AboutDialog {
|
||||||
|
id: aboutDialog
|
||||||
|
}
|
||||||
|
|
||||||
Action {
|
Action {
|
||||||
id: aboutAction
|
id: aboutAction
|
||||||
@ -96,7 +98,6 @@ ApplicationWindow {
|
|||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
//onAdded: children.width = data1.width
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +137,6 @@ ApplicationWindow {
|
|||||||
x: 8
|
x: 8
|
||||||
y: 8
|
y: 8
|
||||||
text: qsTr("Button")
|
text: qsTr("Button")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,7 +153,8 @@ ApplicationWindow {
|
|||||||
visible: false
|
visible: false
|
||||||
property bool txt: true
|
property bool txt: true
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
if ((event.key == Qt.Key_Return) && (event.modifiers & Qt.ControlModifier)) {
|
if ((event.key == Qt.Key_Return)
|
||||||
|
&& (event.modifiers & Qt.ControlModifier)) {
|
||||||
txt = true
|
txt = true
|
||||||
|
|
||||||
x = -100
|
x = -100
|
||||||
@ -164,9 +165,9 @@ ApplicationWindow {
|
|||||||
opacity = 0
|
opacity = 0
|
||||||
textEdit1.focus = false
|
textEdit1.focus = false
|
||||||
|
|
||||||
|
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.key == Qt.Key_Escape) {
|
if (event.key == Qt.Key_Escape) {
|
||||||
txt = false
|
txt = false
|
||||||
x = -100
|
x = -100
|
||||||
@ -177,12 +178,10 @@ ApplicationWindow {
|
|||||||
opacity = 0
|
opacity = 0
|
||||||
textEdit1.focus = false
|
textEdit1.focus = false
|
||||||
|
|
||||||
|
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TextArea {
|
TextArea {
|
||||||
id: textEdit1
|
id: textEdit1
|
||||||
objectName: "textEdit1"
|
objectName: "textEdit1"
|
||||||
|
@ -1,48 +1,12 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:BSD$
|
|
||||||
** You may use this file under the terms of the BSD license as follows:
|
|
||||||
**
|
|
||||||
** "Redistribution and use in source and binary forms, with or without
|
|
||||||
** modification, are permitted provided that the following conditions are
|
|
||||||
** met:
|
|
||||||
** * Redistributions of source code must retain the above copyright
|
|
||||||
** notice, this list of conditions and the following disclaimer.
|
|
||||||
** * Redistributions in binary form must reproduce the above copyright
|
|
||||||
** notice, this list of conditions and the following disclaimer in
|
|
||||||
** the documentation and/or other materials provided with the
|
|
||||||
** distribution.
|
|
||||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
|
||||||
** of its contributors may be used to endorse or promote products derived
|
|
||||||
** from this software without specific prior written permission.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtQuick.Dialogs 1.1
|
import QtQuick.Dialogs 1.1
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
icon: StandardIcon.Information
|
icon: StandardIcon.Information
|
||||||
text: "Presentation App for use in a church service"
|
text: "Presentation App \nVersion: Alpha"
|
||||||
detailedText: "Made in 2016 by Timmy Welch."
|
detailedText: "Presentation App for use in a church service\nMade in 2016 by Timmy Welch."
|
||||||
title: "About"
|
title: "About"
|
||||||
|
height: 100
|
||||||
|
width: 200
|
||||||
|
standardButtons: StandardButton.Close
|
||||||
}
|
}
|
||||||
|
10
qml/cell.qml
10
qml/cell.qml
@ -7,6 +7,7 @@ Rectangle {
|
|||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
border.width: 2
|
border.width: 2
|
||||||
|
border.color: "black"
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
||||||
@ -31,6 +32,8 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onFocusChanged: if (focus) {
|
onFocusChanged: if (focus) {
|
||||||
selected()
|
selected()
|
||||||
|
} else {
|
||||||
|
notSelected()
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@ -47,8 +50,11 @@ Rectangle {
|
|||||||
parent.color = "black"
|
parent.color = "black"
|
||||||
}
|
}
|
||||||
|
|
||||||
onExited: {
|
onExited: notSelected()
|
||||||
parent.parent.border.color = "white"
|
|
||||||
|
function notSelected() {
|
||||||
|
|
||||||
|
parent.parent.border.color = "black"
|
||||||
parent.parent.color = "white"
|
parent.parent.color = "white"
|
||||||
parent.color = "black"
|
parent.color = "black"
|
||||||
if (focus) {
|
if (focus) {
|
||||||
|
Loading…
Reference in New Issue
Block a user