Frames now follow the window scaling.

This commit is contained in:
Filippo Scognamiglio 2014-07-09 19:03:02 +02:00
parent ef3303134d
commit 7dead18a56
5 changed files with 36 additions and 21 deletions

View File

@ -107,12 +107,12 @@ Item{
? virtualCharSize
: Qt.size(paintedSize.width / 2, paintedSize.height / 2);
var virtualPxSize = Qt.size(paintedSize.width / charSize.width,
paintedSize.height / charSize.height)
var virtualPxSize = Qt.size((paintedSize.width / charSize.width) * shadersettings.window_scaling,
(paintedSize.height / charSize.height) * shadersettings.window_scaling)
terminalContainer.virtualPxSize = virtualPxSize;
setLineSpacing(lineSpacing);
setLineSpacing(lineSpacing * shadersettings.window_scaling);
restartBlurredSource();
}
Component.onCompleted: {

View File

@ -128,11 +128,12 @@ Tab{
Slider{
Layout.fillWidth: true
id: txtslider
stepSize: 0.01
stepSize: 0.25
maximumValue: 1
minimumValue: 0
minimumValue: 0.50
onValueChanged: shadersettings.window_scaling = value;
value: shadersettings.window_scaling
tickmarksEnabled: true
}
Text{text: Math.round(txtslider.value * 100) + "%"}
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2014-07-09T00:22:58. -->
<!-- Written by QtCreator 3.0.1, 2014-07-10T23:48:14. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>

View File

@ -2,6 +2,9 @@ import QtQuick 2.2
Item{
id: framecontainer
property int textureWidth
property int textureHeight
property int addedWidth
property int addedHeight
property int borderLeft
@ -28,8 +31,8 @@ Item{
BorderImage{
id: frameimage
anchors.centerIn: parent
width: parent.width + addedWidth
height: parent.height + addedHeight
width: textureWidth + addedWidth
height: textureHeight + addedHeight
border.bottom: borderBottom
border.top: borderTop
@ -57,14 +60,18 @@ Item{
id: framesource
sourceItem: frameimage
hideSource: true
textureSize: Qt.size(parent.width, parent.height)
}
ShaderEffectSource{
id: framesourcenormals
sourceItem: framenormals
hideSource: true
textureSize: Qt.size(parent.width, parent.height)
}
Loader{
anchors.fill: frameimage
anchors.centerIn: parent
width: parent.width + (addedWidth / textureWidth) * parent.width
height: parent.height + (addedHeight / textureHeight) * parent.height
source: shaderString
}
}

View File

@ -95,24 +95,31 @@ ApplicationWindow{
id: shadersettings
}
Loader{
id: frame
property rect sourceRect: Qt.rect(-item.rectX * shadersettings.window_scaling,
-item.rectY * shadersettings.window_scaling,
terminal.width + 2*item.rectX * shadersettings.window_scaling,
terminal.height + 2*item.rectY * shadersettings.window_scaling)
anchors.fill: parent
z: 2.1
source: shadersettings.frame_source
opacity: 1.0
}
Item{
id: maincontainer
anchors.centerIn: parent
width: parent.width * shadersettings.window_scaling
height: parent.height * shadersettings.window_scaling
scale: 1.0 / shadersettings.window_scaling
smooth: false
antialiasing: false
Loader{
id: frame
property rect sourceRect: Qt.rect(-item.rectX * shadersettings.window_scaling,
-item.rectY * shadersettings.window_scaling,
terminal.width + 2*item.rectX * shadersettings.window_scaling,
terminal.height + 2*item.rectY * shadersettings.window_scaling)
anchors.fill: parent
z: 2.1
source: shadersettings.frame_source
opacity: 1.0
onLoaded: {
item.textureWidth = Qt.binding(function() { return terminalWindow.width;})
item.textureHeight = Qt.binding(function () {return terminalWindow.height;})
console.log(terminalWindow.width);
}
}
Image{
id: randtexture
source: "frames/images/randfunction.png"