Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ad2404cf authored by Huon Imberger's avatar Huon Imberger Committed by Henrik Fehlauer

Improve background color code for URL Navigator and adjacent fullscreen toolbars

Summary:
Similar to {D10781}, modifying background role to get a dark background instead of
manually adjusting palette is a preferred solution. This way the palette is still
inherited so does not need to be continually adjusted when the overall palette
changes, like when switching to/from fullscreen.

This also makes the entire fullscreen toolbar (including URL nav) have a consistent background color

Fullscreen left edge before:
{F5731730}

Fullscreen left edge after:
{F5731731}

Fullscreen right edge before:
{F5731732}

Fullscreen right edge after:
{F5731733}

Test Plan:
In {nav Browse}, the URL Navigator should have a darker background color than the rest of the UI.

In {nav Fullscreen} {nav Browse}, the entire toolbar should have a consistent, dark, background color.

Reviewers: #gwenview, rkflx, ngraham

Reviewed By: #gwenview, rkflx, ngraham

Subscribers: ngraham

Differential Revision: https://phabricator.kde.org/D10880
parent a2dcfa2c
......@@ -94,16 +94,20 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage
mFilePlacesModel = new KFilePlacesModel(q);
mUrlNavigator = new KUrlNavigator(mFilePlacesModel, QUrl(), mUrlNavigatorContainer);
mUrlNavigatorContainer->setAutoFillBackground(true);
mUrlNavigatorContainer->setBackgroundRole(QPalette::Mid);
QVBoxLayout* layout = new QVBoxLayout(mUrlNavigatorContainer);
layout->setMargin(0);
layout->addWidget(mUrlNavigator);
QObject::connect(mUrlNavigator, SIGNAL(urlsDropped(QUrl,QDropEvent*)),
q, SLOT(slotUrlsDropped(QUrl,QDropEvent*)));
updateUrlNavigatorBackgroundColor();
// FullScreen Toolbar
mFullScreenToolBar->setVisible(false);
mFullScreenToolBar2->setVisible(false);
mFullScreenToolBar->setAutoFillBackground(true);
mFullScreenToolBar2->setAutoFillBackground(true);
mFullScreenToolBar->setBackgroundRole(QPalette::Mid);
mFullScreenToolBar2->setBackgroundRole(QPalette::Mid);
// Thumbnail slider
QObject::connect(mThumbnailSlider, SIGNAL(valueChanged(int)),
......@@ -213,13 +217,6 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage
return count;
}
void updateUrlNavigatorBackgroundColor()
{
QPalette pal(q->palette());
pal.setColor(QPalette::Window, pal.color(QPalette::Window).dark(110));
mUrlNavigatorContainer->setPalette(pal);
}
void updateContextBarActions()
{
PreviewItemDelegate::ContextBarActions actions;
......@@ -402,7 +399,6 @@ void BrowseMainPage::updateThumbnailDetails()
void BrowseMainPage::setFullScreenMode(bool fullScreen)
{
d->applyPalette(fullScreen);
d->updateUrlNavigatorBackgroundColor();
d->mUrlNavigatorContainer->setContentsMargins(
fullScreen ? 6 : 0,
0, 0, 0);
......
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