Commit 1ee665ba authored by Nate Graham's avatar Nate Graham 🔩
Browse files

Move search and filter bar close buttons to the right

Summary:
Close buttons for windows, tabs, and pretty much everything else in KDE are on the right,
not the left. This patch makes Dolphin's search and filter bars follow that.

BUG: 421372
FIXED-IN: 20.08.0

Test Plan: {F8314176}

Reviewers: abetts, #dolphin, #vdg, elvisangelaccio, GB_2

Reviewed By: #dolphin, #vdg, elvisangelaccio, GB_2

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D29693
parent a058c64e
......@@ -32,13 +32,6 @@
FilterBar::FilterBar(QWidget* parent) :
QWidget(parent)
{
// Create close button
QToolButton *closeButton = new QToolButton(this);
closeButton->setAutoRaise(true);
closeButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar"));
connect(closeButton, &QToolButton::clicked, this, &FilterBar::closeRequest);
// Create button to lock text when changing folders
m_lockButton = new QToolButton(this);
m_lockButton->setAutoRaise(true);
......@@ -57,12 +50,19 @@ FilterBar::FilterBar(QWidget* parent) :
this, &FilterBar::filterChanged);
setFocusProxy(m_filterInput);
// Create close button
QToolButton *closeButton = new QToolButton(this);
closeButton->setAutoRaise(true);
closeButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar"));
connect(closeButton, &QToolButton::clicked, this, &FilterBar::closeRequest);
// Apply layout
QHBoxLayout* hLayout = new QHBoxLayout(this);
hLayout->setContentsMargins(0, 0, 0, 0);
hLayout->addWidget(closeButton);
hLayout->addWidget(m_lockButton);
hLayout->addWidget(m_filterInput);
hLayout->addWidget(closeButton);
}
FilterBar::~FilterBar()
......
......@@ -344,13 +344,6 @@ void DolphinSearchBox::saveSettings()
void DolphinSearchBox::init()
{
// Create close button
QToolButton* closeButton = new QToolButton(this);
closeButton->setAutoRaise(true);
closeButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
closeButton->setToolTip(i18nc("@info:tooltip", "Quit searching"));
connect(closeButton, &QToolButton::clicked, this, &DolphinSearchBox::emitCloseRequest);
// Create search box
m_searchInput = new QLineEdit(this);
m_searchInput->setPlaceholderText(i18n("Search..."));
......@@ -371,11 +364,18 @@ void DolphinSearchBox::init()
m_searchInput->addAction(m_saveSearchAction, QLineEdit::TrailingPosition);
connect(m_saveSearchAction, &QAction::triggered, this, &DolphinSearchBox::slotSearchSaved);
// Create close button
QToolButton* closeButton = new QToolButton(this);
closeButton->setAutoRaise(true);
closeButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
closeButton->setToolTip(i18nc("@info:tooltip", "Quit searching"));
connect(closeButton, &QToolButton::clicked, this, &DolphinSearchBox::emitCloseRequest);
// Apply layout for the search input
QHBoxLayout* searchInputLayout = new QHBoxLayout();
searchInputLayout->setContentsMargins(0, 0, 0, 0);
searchInputLayout->addWidget(closeButton);
searchInputLayout->addWidget(m_searchInput);
searchInputLayout->addWidget(closeButton);
// Create "Filename" and "Content" button
m_fileNameButton = new QToolButton(this);
......
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