mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-30 22:54:21 +00:00 
			
		
		
		
	Font scaling now works. (Yes, there are still problems with on the fly font changing)
This commit is contained in:
		| @@ -49,8 +49,14 @@ ApplicationWindow { | ||||
|                             onCurrentIndexChanged: shadersettings.font_index = currentIndex | ||||
|                         } | ||||
|                         Text{text: qsTr("Font scaling:")} | ||||
|                         ComboBox{ | ||||
|                         SpinBox{ | ||||
|                             Layout.fillWidth: true | ||||
|                             decimals: 1 | ||||
|                             stepSize: 0.1 | ||||
|                             minimumValue: 0.5 | ||||
|                             maximumValue: 1.5 | ||||
|                             onValueChanged: shadersettings.font_scaling = value; | ||||
|                             Component.onCompleted: value = shadersettings.font_scaling; | ||||
|                         } | ||||
|                         Item{Layout.fillHeight: true} | ||||
|                         ColorButton{ | ||||
|   | ||||
| @@ -17,12 +17,16 @@ Item{ | ||||
|     property int frames_index: 1 | ||||
|     property var frames_list: framelist | ||||
|  | ||||
|     property real font_scaling: 1.0 | ||||
|     property var font: currentfont | ||||
|     property alias fontSize: currentfont.pixelSize | ||||
|     property real fontSize: currentfont.pixelSize * font_scaling | ||||
|     property int font_index: 2 | ||||
|     property var fonts_list: fontlist | ||||
|  | ||||
|     onFont_indexChanged: { | ||||
|     onFont_indexChanged: handleFontChanged(); | ||||
|     onFont_scalingChanged: handleFontChanged(); | ||||
|  | ||||
|     function handleFontChanged(){ | ||||
|         terminalwindowloader.source = ""; | ||||
|         currentfont.source = fontlist.get(font_index).source; | ||||
|         currentfont.pixelSize = fontlist.get(font_index).pixelSize; | ||||
| @@ -85,7 +89,9 @@ Item{ | ||||
|         scanlines = settings.scanlines ? settings.scanlines : scanlines; | ||||
|  | ||||
|         frames_index = settings.frames_index ? settings.frames_index : frames_index; | ||||
|  | ||||
|         font_index = settings.font_index ? settings.font_index : font_index; | ||||
|         font_scaling = settings.font_scaling ? settings.font_scaling: font_scaling; | ||||
|     } | ||||
|  | ||||
|     function storeToDb(){ | ||||
| @@ -99,7 +105,8 @@ Item{ | ||||
|             glowing_line_strength: glowing_line_strength, | ||||
|             scanlines: scanlines, | ||||
|             frames_index: frames_index, | ||||
|             font_index: font_index | ||||
|             font_index: font_index, | ||||
|             font_scaling: font_scaling | ||||
|         } | ||||
|  | ||||
|         storage.setSetting("CURRENT_SETTINGS", JSON.stringify(settings)); | ||||
|   | ||||
| @@ -22,8 +22,7 @@ ApplicationWindow{ | ||||
|             MenuItem { | ||||
|                 text: qsTr("Settings") | ||||
|                 onTriggered: { | ||||
|                     var component = Qt.createComponent("SettingsWindow.qml"); | ||||
|                     component.createObject(terminalWindow); | ||||
|                     settingswindow.show(); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -36,4 +36,9 @@ Item{ | ||||
|     Loader{ | ||||
|         id: terminalwindowloader | ||||
|     } | ||||
|  | ||||
|     SettingsWindow{ | ||||
|         id: settingswindow | ||||
|         visible: false | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user