mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-31 07:04:20 +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 |                             onCurrentIndexChanged: shadersettings.font_index = currentIndex | ||||||
|                         } |                         } | ||||||
|                         Text{text: qsTr("Font scaling:")} |                         Text{text: qsTr("Font scaling:")} | ||||||
|                         ComboBox{ |                         SpinBox{ | ||||||
|                             Layout.fillWidth: true |                             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} |                         Item{Layout.fillHeight: true} | ||||||
|                         ColorButton{ |                         ColorButton{ | ||||||
|   | |||||||
| @@ -17,12 +17,16 @@ Item{ | |||||||
|     property int frames_index: 1 |     property int frames_index: 1 | ||||||
|     property var frames_list: framelist |     property var frames_list: framelist | ||||||
|  |  | ||||||
|  |     property real font_scaling: 1.0 | ||||||
|     property var font: currentfont |     property var font: currentfont | ||||||
|     property alias fontSize: currentfont.pixelSize |     property real fontSize: currentfont.pixelSize * font_scaling | ||||||
|     property int font_index: 2 |     property int font_index: 2 | ||||||
|     property var fonts_list: fontlist |     property var fonts_list: fontlist | ||||||
|  |  | ||||||
|     onFont_indexChanged: { |     onFont_indexChanged: handleFontChanged(); | ||||||
|  |     onFont_scalingChanged: handleFontChanged(); | ||||||
|  |  | ||||||
|  |     function handleFontChanged(){ | ||||||
|         terminalwindowloader.source = ""; |         terminalwindowloader.source = ""; | ||||||
|         currentfont.source = fontlist.get(font_index).source; |         currentfont.source = fontlist.get(font_index).source; | ||||||
|         currentfont.pixelSize = fontlist.get(font_index).pixelSize; |         currentfont.pixelSize = fontlist.get(font_index).pixelSize; | ||||||
| @@ -85,7 +89,9 @@ Item{ | |||||||
|         scanlines = settings.scanlines ? settings.scanlines : scanlines; |         scanlines = settings.scanlines ? settings.scanlines : scanlines; | ||||||
|  |  | ||||||
|         frames_index = settings.frames_index ? settings.frames_index : frames_index; |         frames_index = settings.frames_index ? settings.frames_index : frames_index; | ||||||
|  |  | ||||||
|         font_index = settings.font_index ? settings.font_index : font_index; |         font_index = settings.font_index ? settings.font_index : font_index; | ||||||
|  |         font_scaling = settings.font_scaling ? settings.font_scaling: font_scaling; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     function storeToDb(){ |     function storeToDb(){ | ||||||
| @@ -99,7 +105,8 @@ Item{ | |||||||
|             glowing_line_strength: glowing_line_strength, |             glowing_line_strength: glowing_line_strength, | ||||||
|             scanlines: scanlines, |             scanlines: scanlines, | ||||||
|             frames_index: frames_index, |             frames_index: frames_index, | ||||||
|             font_index: font_index |             font_index: font_index, | ||||||
|  |             font_scaling: font_scaling | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         storage.setSetting("CURRENT_SETTINGS", JSON.stringify(settings)); |         storage.setSetting("CURRENT_SETTINGS", JSON.stringify(settings)); | ||||||
|   | |||||||
| @@ -22,8 +22,7 @@ ApplicationWindow{ | |||||||
|             MenuItem { |             MenuItem { | ||||||
|                 text: qsTr("Settings") |                 text: qsTr("Settings") | ||||||
|                 onTriggered: { |                 onTriggered: { | ||||||
|                     var component = Qt.createComponent("SettingsWindow.qml"); |                     settingswindow.show(); | ||||||
|                     component.createObject(terminalWindow); |  | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -36,4 +36,9 @@ Item{ | |||||||
|     Loader{ |     Loader{ | ||||||
|         id: terminalwindowloader |         id: terminalwindowloader | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     SettingsWindow{ | ||||||
|  |         id: settingswindow | ||||||
|  |         visible: false | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user