1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-03-20 09:39:07 +00:00

Merge pull request #192 from Swordfish90/unstable

Disable antialias when using rasterization. Fix windows raise behavior, OSX build issue with Qt 5.4 and OSX quit behavior.
This commit is contained in:
Filippo Scognamiglio 2014-12-22 23:30:22 +01:00
commit ebbb1f82fe
4 changed files with 48 additions and 12 deletions

View File

@ -9,6 +9,8 @@ Window{
width: 600 width: 600
height: 400 height: 400
modality: Qt.ApplicationModal
ColumnLayout{ ColumnLayout{
anchors.fill: parent anchors.fill: parent
anchors.margins: 15 anchors.margins: 15

View File

@ -114,6 +114,8 @@ Item{
function handleFontChange(fontSource, pixelSize, lineSpacing, screenScaling, fontWidth){ function handleFontChange(fontSource, pixelSize, lineSpacing, screenScaling, fontWidth){
fontLoader.source = fontSource; fontLoader.source = fontSource;
kterminal.antialiasText = appSettings.rasterization === appSettings.no_rasterization
font.pixelSize = pixelSize; font.pixelSize = pixelSize;
font.family = fontLoader.name; font.family = fontLoader.name;
@ -141,6 +143,8 @@ Item{
forceActiveFocus(); forceActiveFocus();
} }
} }
Component {
id: linuxContextMenu
Menu{ Menu{
id: contextmenu id: contextmenu
MenuItem{action: copyAction} MenuItem{action: copyAction}
@ -151,6 +155,24 @@ Item{
MenuSeparator{visible: !appSettings.showMenubar} MenuSeparator{visible: !appSettings.showMenubar}
CRTMainMenuBar{visible: !appSettings.showMenubar} CRTMainMenuBar{visible: !appSettings.showMenubar}
} }
}
Component {
id: osxContextMenu
Menu{
id: contextmenu
MenuItem{action: copyAction}
MenuItem{action: pasteAction}
MenuSeparator{visible: Qt.platform.os !== "osx"}
MenuItem{action: fullscreenAction; visible: Qt.platform.os !== "osx"}
MenuItem{action: showMenubarAction; visible: Qt.platform.os !== "osx"}
}
}
Loader {
id: menuLoader
sourceComponent: (Qt.platform.os === "osx" ? osxContextMenu : linuxContextMenu)
}
property alias contextmenu: menuLoader.item
MouseArea{ MouseArea{
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
anchors.fill: parent anchors.fill: parent

View File

@ -68,12 +68,16 @@ ApplicationWindow{
id: quitAction id: quitAction
text: qsTr("Quit") text: qsTr("Quit")
shortcut: "Ctrl+Shift+Q" shortcut: "Ctrl+Shift+Q"
onTriggered: terminalWindow.close(); onTriggered: Qt.quit();
} }
Action{ Action{
id: showsettingsAction id: showsettingsAction
text: qsTr("Settings") text: qsTr("Settings")
onTriggered: settingswindow.show(); onTriggered: {
settingswindow.show();
settingswindow.requestActivate();
settingswindow.raise();
}
} }
Action{ Action{
id: copyAction id: copyAction
@ -102,6 +106,8 @@ ApplicationWindow{
text: qsTr("About") text: qsTr("About")
onTriggered: { onTriggered: {
aboutDialog.show(); aboutDialog.show();
aboutDialog.requestActivate();
aboutDialog.raise();
} }
} }
ApplicationSettings{ ApplicationSettings{
@ -134,4 +140,10 @@ ApplicationWindow{
} }
} }
Component.onCompleted: appSettings.handleFontChanged(); Component.onCompleted: appSettings.handleFontChanged();
onClosing: {
// OSX Since we are currently supporting only one window
// quit the application when it is closed.
if (Qt.platform.os === "osx")
Qt.quit()
}
} }

@ -1 +1 @@
Subproject commit 71f2f3f9f0db5ad42e7b39596e968be110e70267 Subproject commit b03e96edb5d984040b1816edee8f1f51eadbaff9