Commit 552c8b4e authored by pvuorela's avatar pvuorela

Merge branch 'master' into 'master'

Fingerterm improvements

See merge request !27
parents 64a35549 e3893542
......@@ -71,27 +71,18 @@ int main(int argc, char *argv[])
if(execCmd.isEmpty()) {
execCmd = settings->value("general/execCmd").toString();
}
if(execCmd.isEmpty()) {
// execute the user's default shell
passwd *pwdstruct = getpwuid(getuid());
execCmd = QString(pwdstruct->pw_shell);
execCmd.append(" --login");
}
delete settings; // don't need 'em here
QStringList execParts = execCmd.split(' ', QString::SkipEmptyParts);
if(execParts.length()==0)
exit(0);
char *ptrs[execParts.length()+1];
for(int i=0; i<execParts.length(); i++) {
ptrs[i] = new char[execParts.at(i).toLatin1().length()+1];
memcpy(ptrs[i], execParts.at(i).toLatin1().data(), execParts.at(i).toLatin1().length());
ptrs[i][execParts.at(i).toLatin1().length()] = 0;
passwd *pwdstruct = getpwuid(getuid());
char *shell = pwdstruct->pw_shell;
if (execCmd.isEmpty()) {
// execute the user's default shell
execl(shell, shell, "--login", (char*)NULL);
} else {
execl(shell, shell, "-c", qPrintable(execCmd), (char*)NULL);
}
ptrs[execParts.length()] = 0;
execvp(execParts.first().toLatin1(), ptrs);
exit(0);
}
......@@ -99,11 +90,15 @@ int main(int argc, char *argv[])
QScreen* sc = app.primaryScreen();
if(sc){
sc->setOrientationUpdateMask(Qt::PrimaryOrientation
| Qt::LandscapeOrientation
| Qt::PortraitOrientation
| Qt::InvertedLandscapeOrientation
| Qt::InvertedPortraitOrientation);
QFlags<Qt::ScreenOrientation> mask = Qt::PrimaryOrientation
| Qt::PortraitOrientation
| Qt::LandscapeOrientation
| Qt::InvertedPortraitOrientation
| Qt::InvertedLandscapeOrientation;
if (settings->contains("ui/orientationMask")) {
mask &= settings->value("ui/orientationMask").toInt();
}
sc->setOrientationUpdateMask(mask);
}
qmlRegisterType<TextRender>("FingerTerm", 1, 0, "TextRender");
......
......@@ -87,7 +87,20 @@ Item {
property int scrollBarWidth: 6*window.pixelRatio
anchors.fill: parent
color: bellTimer.running ? "#ffffff" : bgcolor
color: bgcolor
Rectangle {
id: bellTimerRect
visible: opacity > 0
opacity: bellTimer.running ? 0.5 : 0.0
anchors.fill: parent
color: "#ffffff"
Behavior on opacity {
NumberAnimation {
duration: bellTimer.interval
}
}
}
Lineview {
id: lineView
......@@ -236,8 +249,7 @@ Item {
Timer {
id: bellTimer
interval: 80
interval: 120
}
Connections {
......
......@@ -178,6 +178,10 @@ void Terminal::keyPress(int key, int modifiers, const QString& text)
resetBackBufferScrollPos();
// physical sticky shift generates key=0, mod=Qt::ShiftModifier, sticky alt: key=0, mod=0
if (key == 0 && (modifiers == Qt::ShiftModifier || modifiers == Qt::NoModifier))
return;
if (key > 0xFFFF) {
int modcode = (modifiers & Qt::ShiftModifier ? 1 : 0) |
(modifiers & Qt::AltModifier ? 2 : 0) |
......
......@@ -76,6 +76,7 @@ TextRender::TextRender(QQuickItem *parent) :
iShowBufferScrollIndicator = false;
iFont = QFont(sUtil->fontFamily(), sUtil->fontSize());
iFont.setStyleHint(QFont::Monospace, QFont::StyleStrategy(QFont::PreferDefault | QFont::ForceIntegerMetrics));
iFont.setBold(false);
QFontMetrics fontMetrics(iFont);
iFontHeight = fontMetrics.height();
......
......@@ -154,7 +154,7 @@ void Util::keyPressFeedback()
void Util::keyReleaseFeedback()
{
if( !settingsValue("ui/keyPressFeedback", true).toBool() )
if( !settingsValue("ui/keyReleaseFeedback", true).toBool() )
return;
// TODO: check what's more comfortable, only press, or press and release
......
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