Files
konsole/src/HistorySizeDialog.cpp
Mariusz Glebocki 31d4830392 Edit Profile Dialog UI redesign
Summary:
Overall changes
---------------

* Use a dialog with category buttons on the left, which is used in most
  KDE applications
* Apply KDE HIG as much as possible
* Align layout columns in multiple group boxes
* Move some settings to another groups

General page
------------

{F6447280}

Profile name and icon, and settings related to session/application
initialization.

* Move "Show hint for terminal size after resizing" to Appearance page
* Move "Dim the colors when the window loses focus" to Appearance page

Tabs page, rename tab dialog
----------------------------

{F6447281}

Tabs settings

* Only minor UI changes

Appearance page
---------------

{F6447282} {F6447283} {F6447284}
{F6447290}

Settings related to basic appearance.

* Add additional tabs
  * Cursor - cursor settings from Advanced page
  * Miscellaneous
    * Add "Line spacing" from Advanced page
    * Add previously missing terminal margins and terminal center
      settings (4 years old config-only feature)
    * Add "Show hint for terminal size after resizing" from General page
    * Add "Dim the colors when the window loses focus" from General page
* Use customized font selection dialog
  * Show all printable ASCII characters and look-alike character sets as
    a preview
  * Live preview for changes in the dialog
* Move "Show all fonts" to the font selection dialog
* Remove "text size" (it is replaced with live preview in the font
  dialog)
* Add live preview for cursor settings
* Add live preview for "Line spacing"

Scrolling page, history size dialog
-----------------------------------

{F6447285}

Settings related to scrolling and history.

* Replace popping-in warning frames in "Scrollback" group with warning
  buttons which show floating warning after click. The controls does
  not change position anymore when switching the scrollback options.
  Applies also to history size dialog.
* Replace scrollbar "hide"/"show on left side"/"show on right side"
  options with "visible" checkbox and "show on left side"/"show on
  right side" options enabled after checking the checkbox.

Keyboard page
-------------

{F6447286}

* Removed redundant group box

Mouse page
----------

{F6447287}
{F6447288}

* Shorten "Characters considered part of a word..." label
* Replace "triple-click selects" drop-down with option buttons
* Split settings to "Text interaction" and "Miscellaneous" tabs
* Use monospace font for "Word characters" text input

Advanced page
-------------

{F6447289}

More advanced settings or settings regular user don't care about.

* Replace "Show URL hints when these keys are pressed" checkboxes with
  toggle buttons which are easier to associate visually with hardware
  keys
* Move "Line spacing" to Appearance tab
* Move cursor settings to Appearance tab
* Show "Default character encoding" value directly on drop-down button

Preview for: breeze (dark colors), Oxygen, QtCurve
--------------------------------------------------

{F6447339}

Test Plan:
* Check visually with light/dark color scheme, Breeze, Fusion, Oxygen,
  QtCurve widget styles, normal/large font, QT_SCALE_FACTOR set
  to 1 and 2
* Change every possible control to check UI logic
* Change as much settings as possible and see if they are applied

Reviewers: #konsole, #vdg, ngraham, hindenburg

Reviewed By: #konsole, #vdg, ngraham, hindenburg

Subscribers: emateli, loh.tar, hein, mart, hindenburg, rizzitello, abetts, ngraham, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D17244
2018-12-16 09:44:32 -05:00

93 lines
2.8 KiB
C++

/*
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
Copyright 2012 by Kurt Hindenburg <kurt.hindenburg@gmail.com>
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
// Own
#include "HistorySizeDialog.h"
// Konsole
#include "ui_HistorySizeDialog.h"
#include "Shortcut_p.h"
#include <KLocalizedString>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
using namespace Konsole;
HistorySizeDialog::HistorySizeDialog(QWidget *parent) :
QDialog(parent),
_ui(nullptr)
{
setWindowTitle(i18nc("@title:window", "Adjust Scrollback"));
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
connect(buttonBox, &QDialogButtonBox::accepted, this, &HistorySizeDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &HistorySizeDialog::reject);
mainLayout->addWidget(buttonBox);
setWindowModality(Qt::WindowModal);
_ui = new Ui::HistorySizeDialog();
_ui->setupUi(mainWidget);
_ui->tempWarningWidget->setVisible(true);
_ui->tempWarningWidget->setWordWrap(false);
_ui->tempWarningWidget->setCloseButtonVisible(false);
_ui->tempWarningWidget->setMessageType(KMessageWidget::Information);
_ui->tempWarningWidget->setText(i18nc("@info:status",
"Any adjustments are only temporary to this session."));
}
HistorySizeDialog::~HistorySizeDialog()
{
delete _ui;
}
void HistorySizeDialog::setMode(Enum::HistoryModeEnum aMode)
{
_ui->historySizeWidget->setMode(aMode);
}
Enum::HistoryModeEnum HistorySizeDialog::mode() const
{
return _ui->historySizeWidget->mode();
}
int HistorySizeDialog::lineCount() const
{
return _ui->historySizeWidget->lineCount();
}
void HistorySizeDialog::setLineCount(int lines)
{
_ui->historySizeWidget->setLineCount(lines);
}
QSize HistorySizeDialog::sizeHint() const {
return QSize(_ui->tempWarningWidget->sizeHint().width(), 0);
}