mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-20 20:09:14 +00:00
Changing font properties doesn't reload the terminal.
This commit is contained in:
parent
05edbb9504
commit
4ad83b2dcc
@ -74,6 +74,7 @@ Item{
|
||||
property int frames_index: 1
|
||||
property var frames_list: framelist
|
||||
|
||||
signal terminalFontChanged
|
||||
property real font_scaling: 1.0
|
||||
property var font: currentfont
|
||||
property int font_index: 0
|
||||
@ -90,11 +91,10 @@ Item{
|
||||
onFont_scalingChanged: handleFontChanged();
|
||||
|
||||
function handleFontChanged(){
|
||||
terminal.unloadKTerminal();
|
||||
currentfont.source = fontlist.get(font_index).source;
|
||||
currentfont.pixelSize = fontlist.get(font_index).pixelSize;
|
||||
currentfont.lineSpacing = fontlist.get(font_index).lineSpacing;
|
||||
terminal.loadKTerminal();
|
||||
terminalFontChanged();
|
||||
}
|
||||
|
||||
FontLoader{
|
||||
|
@ -44,7 +44,6 @@ Item{
|
||||
|
||||
function restartBlurredSource(){
|
||||
if(!blurredSource) return;
|
||||
|
||||
blurredSource.live = true;
|
||||
livetimer.restart()
|
||||
}
|
||||
@ -85,15 +84,18 @@ Item{
|
||||
}
|
||||
}
|
||||
|
||||
onUpdatedImage: {blurredSource.live = true;livetimer.restart();}
|
||||
|
||||
Component.onCompleted: {
|
||||
function handleFontChange(){
|
||||
var scaling_factor = shadersettings.font_scaling * shadersettings.window_scaling;
|
||||
var font_size = Math.ceil(shadersettings.font.pixelSize * scaling_factor);
|
||||
var line_spacing = Math.ceil(shadersettings.font.lineSpacing * font_size);
|
||||
font.pixelSize = font_size;
|
||||
font.family = shadersettings.font.name;
|
||||
setLineSpacing(line_spacing);
|
||||
}
|
||||
|
||||
onUpdatedImage: {blurredSource.live = true;livetimer.restart();}
|
||||
Component.onCompleted: {
|
||||
shadersettings.terminalFontChanged.connect(handleFontChange);
|
||||
forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-05-29T01:07:57. -->
|
||||
<!-- Written by QtCreator 3.0.1, 2014-05-29T11:32:54. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
|
@ -152,9 +152,6 @@ ApplicationWindow{
|
||||
}
|
||||
ShaderSettings{
|
||||
id: shadersettings
|
||||
Component.onCompleted: {
|
||||
terminal.loadKTerminal();
|
||||
}
|
||||
}
|
||||
SettingsWindow{
|
||||
id: settingswindow
|
||||
@ -169,4 +166,8 @@ ApplicationWindow{
|
||||
terminalSize: terminal.terminalSize
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
terminal.loadKTerminal();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user