Commit 8ed3facd authored by Camilo higuita's avatar Camilo higuita

use mauikit terminal control

parent 7b0a7713
......@@ -5,7 +5,6 @@
<file>widgets/views/Browser.qml</file>
<file>widgets_templates/ItemMenu.qml</file>
<file>Index.js</file>
<file>widgets/terminal/Terminal.qml</file>
<file>widgets/views/BrowserMenu.qml</file>
<file>widgets/views/DetailsDrawer.qml</file>
<file>widgets/views/Previewer/AudioPreview.qml</file>
......
import QMLTermWidget 1.0
import QtQuick 2.2
import QtQuick.Controls 1.1
Item
{
id: terminalContainer
property size virtualResolution: Qt.size(kterminal.width, kterminal.height)
property alias mainTerminal: kterminal
property alias session: ksession
property real fontWidth: 1.0
property real screenScaling: 1.0
property real scaleTexture: 1.0
property alias title: ksession.title
property alias kterminal: kterminal
//Parameters for the burnIn effect.
property size terminalSize: kterminal.terminalSize
property size fontMetrics: kterminal.fontMetrics
// Manage copy and paste
//When settings are updated sources need to be redrawn.
QMLTermWidget
{
id: kterminal
focus: true
anchors.fill: parent
smooth: true
enableBold: false
fullCursorHeight: true
onKeyPressedSignal: ksession.hasDarkBackground
colorScheme: "DarkPastels"
session: QMLTermSession
{
id: ksession
initialWorkingDirectory: "$HOME"
onFinished: Qt.quit()
}
MouseArea
{
anchors.fill: parent
propagateComposedEvents: true
onClicked:
{
console.log("temrinal cliked")
kterminal.forceActiveFocus()
}
}
QMLTermScrollbar
{
id: kterminalScrollbar
terminal: kterminal
anchors.margins: width * 0.5
width: terminal.fontMetrics.width * 0.75
Rectangle
{
anchors.fill: parent
anchors.topMargin: 1
anchors.bottomMargin: 1
color: "white"
radius: width * 0.25
opacity: 0.7
}
}
// function handleFontChange(fontSource, pixelSize, lineSpacing, screenScaling, fontWidth){
// fontLoader.source = fontSource;
// kterminal.antialiasText = !appSettings.lowResolutionFont;
// font.pixelSize = pixelSize;
// font.family = fontLoader.name;
// terminalContainer.fontWidth = fontWidth;
// terminalContainer.screenScaling = screenScaling;
// scaleTexture = Math.max(1.0, Math.floor(screenScaling * appSettings.windowScaling));
// kterminal.lineSpacing = lineSpacing;
// }
function startSession()
{
ksession.setShellProgram("/usr/bin/bash");
ksession.setArgs("");
ksession.startShellProgram();
forceActiveFocus();
}
Component.onCompleted:
{
startSession()
}
}
}
......@@ -403,7 +403,16 @@ Maui.Page
Layout.maximumHeight: parent.height *0.5
anchors.bottom: parent.bottom
anchors.top: handle.bottom
source: !isMobile ? "../terminal/Terminal.qml" : ""
sourceComponent: !isMobile ? terminalComponent : undefined
}
Component
{
id: terminalComponent
Maui.Terminal
{
id: terminal
}
}
}
......
......@@ -18,6 +18,8 @@ Maui.Menu
signal tagsClicked(var paths)
signal saveToClicked(var paths)
implicitWidth: 200 * unit
Maui.MenuItem
{
text: qsTr("Bookmark")
......@@ -133,7 +135,6 @@ Maui.Menu
Maui.FM.setDirConf(control.paths[i]+"/.directory", "Desktop Entry", "Icon", color)
browser.refresh()
}
}
}
......@@ -147,6 +148,5 @@ Maui.Menu
if(isMobile) open()
else popup()
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment