Expose terminalSize to QML side.
This commit is contained in:
@@ -3239,4 +3239,9 @@ void TerminalDisplay::simulateMouseDoubleClick(int x, int y, int button, int but
|
||||
mouseDoubleClickEvent(&event);
|
||||
}
|
||||
|
||||
QSize TerminalDisplay::getTerminalSize()
|
||||
{
|
||||
return QSize(_lines, _columns);
|
||||
}
|
||||
|
||||
//#include "TerminalDisplay.moc"
|
||||
|
||||
@@ -86,6 +86,7 @@ class KONSOLEPRIVATE_EXPORT TerminalDisplay : public QQuickPaintedItem
|
||||
Q_PROPERTY(KSession* session READ getSession WRITE setSession NOTIFY sessionChanged)
|
||||
Q_PROPERTY(QFont font READ getVTFont WRITE setVTFont )
|
||||
Q_PROPERTY(QString colorScheme WRITE setColorScheme )
|
||||
Q_PROPERTY(QSize terminalSize READ getTerminalSize NOTIFY changedContentSizeSignal)
|
||||
|
||||
|
||||
public:
|
||||
@@ -594,6 +595,7 @@ signals:
|
||||
|
||||
// QMLTermWidget
|
||||
void sessionChanged();
|
||||
void sizeChanged();
|
||||
|
||||
protected:
|
||||
virtual bool event( QEvent * );
|
||||
@@ -881,6 +883,8 @@ private:
|
||||
void setSession(KSession *session);
|
||||
KSession* getSession();
|
||||
|
||||
QSize getTerminalSize();
|
||||
|
||||
public:
|
||||
static void setTransparencyEnabled(bool enable)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ Rectangle {
|
||||
id: mainsession
|
||||
initialWorkingDirectory: "$HOME"
|
||||
}
|
||||
onTerminalSizeChanged: console.log(terminalSize);
|
||||
Component.onCompleted: mainsession.startShellProgram();
|
||||
}
|
||||
Component.onCompleted: terminal.forceActiveFocus();
|
||||
|
||||
Reference in New Issue
Block a user