mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-11-04 00:52:11 +00:00 
			
		
		
		
	Merge pull request #154 from Swordfish90/improveosx
Merge OSX specific issues.
This commit is contained in:
		@@ -37,9 +37,10 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
    engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir"));
 | 
					    engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir"));
 | 
				
			||||||
    engine.rootContext()->setContextProperty("shellProgram", getNamedArgument(args, "--program"));
 | 
					    engine.rootContext()->setContextProperty("shellProgram", getNamedArgument(args, "--program"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Manage import paths
 | 
					    // Manage import paths for Linux and OSX.
 | 
				
			||||||
    QStringList importPathList = engine.importPathList();
 | 
					    QStringList importPathList = engine.importPathList();
 | 
				
			||||||
    importPathList.prepend(QCoreApplication::applicationDirPath() + "/imports/");
 | 
					    importPathList.prepend(QCoreApplication::applicationDirPath() + "/imports/");
 | 
				
			||||||
 | 
					    importPathList.prepend(QCoreApplication::applicationDirPath() + "/../PlugIns");
 | 
				
			||||||
    engine.setImportPathList(importPathList);
 | 
					    engine.setImportPathList(importPathList);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    engine.load(QUrl("qrc:/main.qml"));
 | 
					    engine.load(QUrl("qrc:/main.qml"));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,15 +14,15 @@ MenuBar {
 | 
				
			|||||||
        visible: defaultMenuBar.visible
 | 
					        visible: defaultMenuBar.visible
 | 
				
			||||||
        MenuItem {action: copyAction}
 | 
					        MenuItem {action: copyAction}
 | 
				
			||||||
        MenuItem {action: pasteAction}
 | 
					        MenuItem {action: pasteAction}
 | 
				
			||||||
        MenuSeparator{}
 | 
					        MenuSeparator{visible: Qt.platform.os !== "osx"}
 | 
				
			||||||
        MenuItem {action: showsettingsAction}
 | 
					        MenuItem {action: showsettingsAction}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    Menu{
 | 
					    Menu{
 | 
				
			||||||
        title: qsTr("View")
 | 
					        title: qsTr("View")
 | 
				
			||||||
        visible: defaultMenuBar.visible
 | 
					        visible: defaultMenuBar.visible
 | 
				
			||||||
        MenuItem {action: fullscreenAction}
 | 
					        MenuItem {action: fullscreenAction; visible: fullscreenAction.enabled}
 | 
				
			||||||
        MenuItem {action: showMenubarAction}
 | 
					        MenuItem {action: showMenubarAction; visible: showMenubarAction.enabled}
 | 
				
			||||||
        MenuSeparator{}
 | 
					        MenuSeparator{visible: showMenubarAction.enabled}
 | 
				
			||||||
        MenuItem {action: zoomIn}
 | 
					        MenuItem {action: zoomIn}
 | 
				
			||||||
        MenuItem {action: zoomOut}
 | 
					        MenuItem {action: zoomOut}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -152,9 +152,9 @@ Item{
 | 
				
			|||||||
        id: contextmenu
 | 
					        id: contextmenu
 | 
				
			||||||
        MenuItem{action: copyAction}
 | 
					        MenuItem{action: copyAction}
 | 
				
			||||||
        MenuItem{action: pasteAction}
 | 
					        MenuItem{action: pasteAction}
 | 
				
			||||||
        MenuSeparator{}
 | 
					        MenuSeparator{visible: Qt.platform.os !== "osx"}
 | 
				
			||||||
        MenuItem{action: fullscreenAction}
 | 
					        MenuItem{action: fullscreenAction; visible: Qt.platform.os !== "osx"}
 | 
				
			||||||
        MenuItem{action: showMenubarAction}
 | 
					        MenuItem{action: showMenubarAction; visible: Qt.platform.os !== "osx"}
 | 
				
			||||||
        MenuSeparator{visible: !shadersettings.showMenubar}
 | 
					        MenuSeparator{visible: !shadersettings.showMenubar}
 | 
				
			||||||
        CRTMainMenuBar{visible: !shadersettings.showMenubar}
 | 
					        CRTMainMenuBar{visible: !shadersettings.showMenubar}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,7 +56,6 @@ Tab{
 | 
				
			|||||||
                    id: txtslider
 | 
					                    id: txtslider
 | 
				
			||||||
                    onValueChanged: shadersettings.window_scaling = value;
 | 
					                    onValueChanged: shadersettings.window_scaling = value;
 | 
				
			||||||
                    value: shadersettings.window_scaling
 | 
					                    value: shadersettings.window_scaling
 | 
				
			||||||
                    tickmarksEnabled: true
 | 
					 | 
				
			||||||
                    stepSize: 0.25
 | 
					                    stepSize: 0.25
 | 
				
			||||||
                    Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
 | 
					                    Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,9 @@ ApplicationWindow{
 | 
				
			|||||||
    onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
 | 
					    onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //Workaround: if menubar is assigned ugly margins are visible.
 | 
					    //Workaround: if menubar is assigned ugly margins are visible.
 | 
				
			||||||
    menuBar: shadersettings.showMenubar ? defaultMenuBar : null
 | 
					    menuBar: Qt.platform.os === "osx"
 | 
				
			||||||
 | 
					                ? defaultMenuBar
 | 
				
			||||||
 | 
					                : shadersettings.showMenubar ? defaultMenuBar : null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    color: "#00000000"
 | 
					    color: "#00000000"
 | 
				
			||||||
    title: qsTr("cool-retro-term")
 | 
					    title: qsTr("cool-retro-term")
 | 
				
			||||||
@@ -45,6 +47,7 @@ ApplicationWindow{
 | 
				
			|||||||
    Action {
 | 
					    Action {
 | 
				
			||||||
        id: showMenubarAction
 | 
					        id: showMenubarAction
 | 
				
			||||||
        text: qsTr("Show Menubar")
 | 
					        text: qsTr("Show Menubar")
 | 
				
			||||||
 | 
					        enabled: Qt.platform.os !== "osx"
 | 
				
			||||||
        checkable: true
 | 
					        checkable: true
 | 
				
			||||||
        checked: shadersettings.showMenubar
 | 
					        checked: shadersettings.showMenubar
 | 
				
			||||||
        onTriggered: shadersettings.showMenubar = !shadersettings.showMenubar
 | 
					        onTriggered: shadersettings.showMenubar = !shadersettings.showMenubar
 | 
				
			||||||
@@ -52,6 +55,7 @@ ApplicationWindow{
 | 
				
			|||||||
    Action {
 | 
					    Action {
 | 
				
			||||||
        id: fullscreenAction
 | 
					        id: fullscreenAction
 | 
				
			||||||
        text: qsTr("Fullscreen")
 | 
					        text: qsTr("Fullscreen")
 | 
				
			||||||
 | 
					        enabled: Qt.platform.os !== "osx"
 | 
				
			||||||
        shortcut: "Alt+F11"
 | 
					        shortcut: "Alt+F11"
 | 
				
			||||||
        onTriggered: shadersettings.fullscreen = !shadersettings.fullscreen;
 | 
					        onTriggered: shadersettings.fullscreen = !shadersettings.fullscreen;
 | 
				
			||||||
        checkable: true
 | 
					        checkable: true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -307,6 +307,13 @@ void Session::run()
 | 
				
			|||||||
    QString argsTmp(_arguments.join(" ").trimmed());
 | 
					    QString argsTmp(_arguments.join(" ").trimmed());
 | 
				
			||||||
    QStringList arguments;
 | 
					    QStringList arguments;
 | 
				
			||||||
    arguments << exec;
 | 
					    arguments << exec;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef Q_OS_OSX
 | 
				
			||||||
 | 
					    // Fix osx initial behavior with -i (interactive) and -l (login).
 | 
				
			||||||
 | 
					    arguments.append("-i");
 | 
				
			||||||
 | 
					    arguments.append("-l");
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (argsTmp.length())
 | 
					    if (argsTmp.length())
 | 
				
			||||||
        arguments << _arguments;
 | 
					        arguments << _arguments;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user