diff --git a/data/color-schemes/Breeze.colorscheme b/data/color-schemes/Breeze.colorscheme --- a/data/color-schemes/Breeze.colorscheme +++ b/data/color-schemes/Breeze.colorscheme @@ -1,14 +1,14 @@ [Background] -Color=49,54,59 +Color=35,38,39 [BackgroundFaint] Color=49,54,59 [BackgroundIntense] -Color=35,38,41 +Color=0,0,0 [Color0] -Color=49,54,59 +Color=35,38,39 [Color0Faint] Color=49,54,59 @@ -71,22 +71,22 @@ Color=22,160,133 [Color7] -Color=239,240,241 +Color=252,252,252 [Color7Faint] Color=99,104,109 [Color7Intense] -Color=252,252,252 +Color=255,255,255 [Foreground] -Color=239,240,241 +Color=252,252,252 [ForegroundFaint] -Color=220,230,231 +Color=239,240,241 [ForegroundIntense] -Color=252,252,252 +Color=255,255,255 [General] Description=Breeze diff --git a/src/KeyboardTranslator.h b/src/KeyboardTranslator.h --- a/src/KeyboardTranslator.h +++ b/src/KeyboardTranslator.h @@ -312,7 +312,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(KeyboardTranslator::States) Q_DECLARE_OPERATORS_FOR_FLAGS(KeyboardTranslator::Commands) -class FallbackKeyboardTranslator : public KeyboardTranslator +class KONSOLEPRIVATE_EXPORT FallbackKeyboardTranslator : public KeyboardTranslator { public: FallbackKeyboardTranslator(); diff --git a/src/Profile.cpp b/src/Profile.cpp --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -179,7 +179,7 @@ setProperty(AlternateScrolling, true); setProperty(KeyBindings, QStringLiteral("default")); - setProperty(ColorScheme, QStringLiteral("Linux")); //use DarkPastels when is start support blue ncurses UI properly + setProperty(ColorScheme, QStringLiteral("Breeze")); //use DarkPastels when is start support blue ncurses UI properly setProperty(Font, QFontDatabase::systemFont(QFontDatabase::FixedFont)); setProperty(HistoryMode, Enum::FixedSizeHistory); diff --git a/src/SearchHistoryTask.cpp b/src/SearchHistoryTask.cpp --- a/src/SearchHistoryTask.cpp +++ b/src/SearchHistoryTask.cpp @@ -18,10 +18,11 @@ 02110-1301 USA. */ +#include "SearchHistoryTask.h" + #include #include -#include "SearchHistoryTask.h" #include "TerminalCharacterDecoder.h" #include "Emulation.h" diff --git a/src/ViewContainer.h b/src/ViewContainer.h --- a/src/ViewContainer.h +++ b/src/ViewContainer.h @@ -78,7 +78,7 @@ ~TabbedViewContainer() Q_DECL_OVERRIDE; /** Adds a new view to the container widget */ - void addView(TerminalDisplay *view, ViewProperties *item, int index = -1); + void addView(TerminalDisplay *view, int index = -1); /** Removes a view from the container */ void removeView(TerminalDisplay *view); @@ -101,6 +101,7 @@ /** Changes the active view to the last used view */ void activateLastUsedView(bool reverse); + void setCss(const QString& styleSheet = QString()); void setCssFromFile(const QUrl& url); /** * This enum describes the directions @@ -171,7 +172,7 @@ void activeViewChanged(TerminalDisplay *view); /** Emitted when a view is added to the container. */ - void viewAdded(TerminalDisplay *view, ViewProperties *properties); + void viewAdded(TerminalDisplay *view); /** Emitted when a view is removed from the container. */ void viewRemoved(TerminalDisplay *view); diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp --- a/src/ViewContainer.cpp +++ b/src/ViewContainer.cpp @@ -201,10 +201,16 @@ if (KonsoleSettings::tabBarUseUserStyleSheet()) { setCssFromFile(KonsoleSettings::tabBarUserStyleSheetFile()); } else { - setStyleSheet(QString()); + setCss(); } } +void TabbedViewContainer::setCss(const QString& styleSheet) +{ + static const QString defaultCss = QStringLiteral("QTabWidget::tab-bar, QTabWidget::pane { margin: 0; }\n"); + setStyleSheet(defaultCss + styleSheet); +} + void TabbedViewContainer::setCssFromFile(const QUrl &url) { // Let's only deal w/ local files for now @@ -218,7 +224,7 @@ } QTextStream in(&file); - setStyleSheet(in.readAll()); + setCss(in.readAll()); } void TabbedViewContainer::moveActiveView(MoveDirection direction) @@ -241,8 +247,9 @@ setCurrentIndex(newIndex); } -void TabbedViewContainer::addView(TerminalDisplay *view, ViewProperties *item, int index) +void TabbedViewContainer::addView(TerminalDisplay *view, int index) { + auto item = view->sessionController(); if (index == -1) { addTab(view, item->icon(), item->title()); } else { @@ -258,7 +265,7 @@ &Konsole::TabbedViewContainer::updateActivity); connect(view, &QWidget::destroyed, this, &Konsole::TabbedViewContainer::viewDestroyed); - emit viewAdded(view, item); + emit viewAdded(view); } void TabbedViewContainer::viewDestroyed(QObject *view) diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -604,10 +604,10 @@ const QSize &preferredSize = session->preferredSize(); display->setSize(preferredSize.width(), preferredSize.height()); - ViewProperties *properties = createController(session, display); + createController(session, display); _sessionMap[display] = session; - container->addView(display, properties, index); + container->addView(display, index); session->addView(display); // tell the session whether it has a light or dark background diff --git a/src/autotests/KeyboardTranslatorTest.h b/src/autotests/KeyboardTranslatorTest.h --- a/src/autotests/KeyboardTranslatorTest.h +++ b/src/autotests/KeyboardTranslatorTest.h @@ -33,6 +33,7 @@ private Q_SLOTS: void testEntryTextWildcards(); void testEntryTextWildcards_data(); + void testFallback(); }; } diff --git a/src/autotests/KeyboardTranslatorTest.cpp b/src/autotests/KeyboardTranslatorTest.cpp --- a/src/autotests/KeyboardTranslatorTest.cpp +++ b/src/autotests/KeyboardTranslatorTest.cpp @@ -1,5 +1,5 @@ /* - Copyright 2013 by Kurt Hindenburg + Copyright 2013, 2018 by Kurt Hindenburg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -96,5 +96,30 @@ QCOMPARE(entry.text(wildcards, modifiers), result); } +// Use FallbackKeyboardTranslator to test basic functionality +void KeyboardTranslatorTest::testFallback() +{ + auto fallback = new FallbackKeyboardTranslator(); + + QCOMPARE(QStringLiteral("fallback"), fallback->name()); + QCOMPARE(QStringLiteral("Fallback Keyboard Translator"), fallback->description()); + + auto entries = fallback->entries(); + QCOMPARE(1, entries.size()); + auto entry = fallback->findEntry(Qt::Key_Tab, nullptr); + QVERIFY(!entry.isNull()); + QCOMPARE(FallbackKeyboardTranslator::Command::NoCommand, entry.command()); + QCOMPARE(Qt::Key_Tab, entry.keyCode()); + QCOMPARE(QByteArray("\t"), entry.text()); + QCOMPARE(QByteArray("\\t"), entry.escapedText()); + QCOMPARE(Qt::NoModifier, entry.modifiers()); + QCOMPARE(Qt::NoModifier, entry.modifierMask()); + QCOMPARE(KeyboardTranslator::NoState, entry.state()); + QCOMPARE(QStringLiteral("Tab"), entry.conditionToString()); + QCOMPARE(QStringLiteral("\\t"), entry.resultToString()); + QVERIFY(entry.matches(Qt::Key_Tab, Qt::NoModifier, KeyboardTranslator::NoState)); + QVERIFY(entry == fallback->findEntry(Qt::Key_Tab, nullptr)); +} + QTEST_GUILESS_MAIN(KeyboardTranslatorTest)